|
@@ -83,6 +83,11 @@ class FactureFournisseurRec extends CommonInvoice
|
|
|
public $ref_supplier;
|
|
|
public $socid;
|
|
|
|
|
|
+ /**
|
|
|
+ * @deprecated
|
|
|
+ */
|
|
|
+ public $fk_soc;
|
|
|
+
|
|
|
public $suspended; // status
|
|
|
|
|
|
/**
|
|
@@ -491,8 +496,10 @@ class FactureFournisseurRec extends CommonInvoice
|
|
|
$sql .= " titre = '" . (!empty($this->title) ? $this->db->escape($this->title) : "")."'," ;
|
|
|
$sql .= " ref_supplier = '". (!empty($this->ref_supplier) ? $this->db->escape($this->ref_supplier) : "")."',";
|
|
|
$sql .= " entity = ". (!empty($this->entity) ? ((int) $this->entity) : 1) . ',';
|
|
|
- if ($this->fk_soc > 0) {
|
|
|
- $sql .= " fk_soc = ". (int) $this->fk_soc. ',';
|
|
|
+ if (!empty($this->socid) && $this->socid > 0) {
|
|
|
+ $sql .= " fk_soc = ". ((int) $this->socid). ',';
|
|
|
+ } elseif (!empty($this->fk_soc) && $this->fk_soc > 0) { // For backward compatibility
|
|
|
+ $sql .= " fk_soc = ". ((int) $this->fk_soc). ',';
|
|
|
}
|
|
|
$sql .= " suspended = ". (!empty($this->suspended) ? ((int) $this->suspended) : 0) . ',';
|
|
|
$sql .= " libelle = ". (!empty($this->libelle) ? "'".$this->db->escape($this->libelle)."'" : 'NULL') . ",";
|