From 3da96500032b9f6b3ceca4692e24fc264a98ddea Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Mon, 10 Dec 2018 16:06:11 +0100 Subject: [PATCH] FIX if qty is 0 --- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 72bd20fc25c..1e408c697f7 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -3035,7 +3035,7 @@ class SupplierInvoiceLine extends CommonObjectLine $sql.= " ".$this->product_type.","; $sql.= " ".price2num($this->remise_percent).","; $sql.= " ".price2num($this->subprice).","; - $sql.= " ".price2num($this->total_ttc/$this->qty).","; + $sql.= " ".!empty($this->qty)?price2num($this->total_ttc/$this->qty):price2num($this->total_ttc).","; $sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").","; $sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").","; $sql.= ' '.(!empty($this->fk_code_ventilation)?$this->fk_code_ventilation:0).',';