Merge pull request #18500 from francisbesset/fix-fk_unit
Fix bad comparison for fk_unit to avoid always null value for all case
This commit is contained in:
commit
5ec286fdb7
@ -3392,13 +3392,13 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
if (empty($this->fk_product)) {
|
||||
$fk_product = "null";
|
||||
} else {
|
||||
$fk_product = $this->fk_product;
|
||||
$fk_product = (int) $this->fk_product;
|
||||
}
|
||||
|
||||
if (empty($this->fk_unit)) {
|
||||
$fk_unit = "null";
|
||||
} else {
|
||||
$fk_unit = "'".$this->db->escape($this->fk_unit)."'";
|
||||
$fk_unit = (int) $this->fk_unit;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det SET";
|
||||
@ -3426,7 +3426,7 @@ class SupplierInvoiceLine extends CommonObjectLine
|
||||
$sql .= ", fk_product = ".((int) $fk_product);
|
||||
$sql .= ", product_type = ".((int) $this->product_type);
|
||||
$sql .= ", info_bits = ".((int) $this->info_bits);
|
||||
$sql .= ", fk_unit = ".($fk_unit > 0 ? (int) $fk_unit : 'null');
|
||||
$sql .= ", fk_unit = ".((int) $fk_unit);
|
||||
|
||||
// Multicurrency
|
||||
$sql .= " , multicurrency_subprice=".price2num($this->multicurrency_subprice)."";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user