diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a0dbe0df5bd..efd729d3715 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1047,7 +1047,7 @@ class Commande extends CommonOrder $sql .= ", '".$this->db->escape($this->location_incoterms)."'"; $sql .= ", ".(int) $this->entity; $sql .= ", ".($this->module_source ? "'".$this->db->escape($this->module_source)."'" : "null"); - $sql .= ", ".($this->pos_source != '' ? "'".$this->db->escape($this->pos_source)."'" : "null"); + $sql .= ", ".((!is_null($this->pos_source) && $this->pos_source != '') ? "'".$this->db->escape($this->pos_source)."'" : "null"); // Can be null, '', '0', '1' $sql .= ", ".(int) $this->fk_multicurrency; $sql .= ", '".$this->db->escape($this->multicurrency_code)."'"; $sql .= ", ".(float) $this->multicurrency_tx;