2
0
forked from Wavyzz/dolibarr

fix wrong test for product type in order->getNbProductsLines()

also add getNbServicesLines() function in order class.
This commit is contained in:
Christophe Battarel
2012-10-25 11:26:36 +02:00
parent f8f1d3a0df
commit 144b08cac1

View File

@@ -1521,7 +1521,22 @@ class Commande extends CommonOrder
$nb=0;
foreach($this->lines as $line)
{
if ($line->fk_product_type == 0) $nb++;
if ($line->product_type == 0) $nb++;
}
return $nb;
}
/**
* Return number of line with type service.
*
* @return int <0 if KO, Nbr of service lines if OK
*/
function getNbOfServicesLines()
{
$nb=0;
foreach($this->lines as $line)
{
if ($line->product_type == 1) $nb++;
}
return $nb;
}