diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e0a7ec1b9f2..cc718334f13 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3743,7 +3743,7 @@ function yn($yesno, $case=1, $color=0) * * @param string $num Id of object * @param int $level Level of subdirs to return (1, 2 or 3 levels) - * @param int $alpha Use alpha ref + * @param int $alpha 0=Keep number only to forge path, 1=Use alpha part afer the - (By default, use 0). * @param int $withoutslash 0=With slash at end, 1=without slash at end (except if '/', we return '') * @param Object $object Object * @param string $modulepart Type of object ('invoice_supplier, 'donation', 'invoice', ...') diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 1bf286ff5aa..5e24417f618 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1151,7 +1151,7 @@ class FactureFournisseur extends CommonInvoice if (empty($txtva)) $txtva=0; if (empty($txlocaltax1)) $txlocaltax1=0; if (empty($txlocaltax2)) $txlocaltax2=0; - + $remise_percent=price2num($remise_percent); $qty=price2num($qty); $pu=price2num($pu); @@ -1197,7 +1197,7 @@ class FactureFournisseur extends CommonInvoice } else { - dol_syslog("Error error=".$this->error, LOG_ERR); + dol_syslog("Error after updateline error=".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -2096,16 +2096,17 @@ class SupplierInvoiceLine extends CommonObjectLine $this->db->begin(); - if ($this->fk_product) { + if (empty($this->fk_product)) + { $fk_product = "null"; } else { $fk_product = $this->fk_product; } - if ($this->fk_unit) { - $fk_unit = "'".$this->db->escape($this->fk_unit)."'"; - } else { + if (empty($this->fk_unit)) { $fk_unit = "null"; + } else { + $fk_unit = "'".$this->db->escape($this->fk_unit)."'"; } $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";