mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 09:02:59 +01:00
Fix trouble with product id = -1
This commit is contained in:
@@ -1518,7 +1518,7 @@ class Commande extends CommonOrder
|
||||
$this->db->begin();
|
||||
|
||||
$product_type = $type;
|
||||
if (!empty($fk_product)) {
|
||||
if (!empty($fk_product) && $fk_product > 0) {
|
||||
$product = new Product($this->db);
|
||||
$result = $product->fetch($fk_product);
|
||||
$product_type = $product->type;
|
||||
@@ -4389,7 +4389,7 @@ class OrderLine extends CommonOrderLine
|
||||
$sql .= " '".price2num($this->localtax2_tx)."',";
|
||||
$sql .= " '".$this->db->escape($this->localtax1_type)."',";
|
||||
$sql .= " '".$this->db->escape($this->localtax2_type)."',";
|
||||
$sql .= ' '.(!empty($this->fk_product) ? $this->fk_product : "null").',';
|
||||
$sql .= ' '.((!empty($this->fk_product) && $this->fk_product > 0) ? $this->fk_product : "null").',';
|
||||
$sql .= " '".$this->db->escape($this->product_type)."',";
|
||||
$sql .= " '".price2num($this->remise_percent)."',";
|
||||
$sql .= " ".(price2num($this->subprice) !== '' ?price2num($this->subprice) : "null").",";
|
||||
|
||||
Reference in New Issue
Block a user