From 144b08cac185759a79179afd2cc37bc95f7e7d07 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Thu, 25 Oct 2012 11:26:36 +0200 Subject: [PATCH] fix wrong test for product type in order->getNbProductsLines() also add getNbServicesLines() function in order class. --- htdocs/commande/class/commande.class.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 5306e8866be..fe3c9bfd424 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -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; }