From 2f93bac9bfc38d5eb8815596ecce9174c806fa6a Mon Sep 17 00:00:00 2001 From: Irvine Fleith Date: Tue, 17 Dec 2024 15:52:39 +0100 Subject: [PATCH] FIX : fk_societe_rib --- htdocs/compta/facture/class/facture-rec.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index ef3d96fed53..056d34018fc 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -398,7 +398,7 @@ class FactureRec extends CommonInvoice $sql .= ", '".$this->db->escape($facsrc->multicurrency_code)."'"; $sql .= ", ".((float) $facsrc->multicurrency_tx); $sql .= ", ".((int) $this->suspended); - $sql .= ", ".((int) $this->fk_societe_rib); + $sql .= ", ".(!empty($this->fk_societe_rib) ? ((int) $this->fk_societe_rib) : 'NULL'); $sql .= ")"; if ($this->db->query($sql)) { @@ -571,7 +571,7 @@ class FactureRec extends CommonInvoice $sql .= " localtax2 = ".((float) $this->total_localtax2).","; $sql .= " total_ht = ".((float) $this->total_ht).","; $sql .= " total_ttc = ".((float) $this->total_ttc).","; - $sql .= " fk_societe_rib = ".((int) $this->fk_societe_rib); + $sql .= " fk_societe_rib = ".(!empty($this->fk_societe_rib) ? ((int) $this->fk_societe_rib) : 'NULL');; // TODO Add missing fields $sql .= " WHERE rowid = ".((int) $this->id);