|
@@ -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";
|