From d3161f2c4ea79c5352e590eaf840c357a353c9d5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Apr 2022 16:19:34 +0200 Subject: [PATCH] Clean code --- htdocs/fourn/class/fournisseur.facture-rec.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 3a20ee85d10..3d6c0868f01 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -243,7 +243,8 @@ class FactureFournisseurRec extends CommonInvoice // Clean parameters $this->titre = empty($this->titre) ? '' : $this->titre; - $this->ref = $this->{$this->table_ref_field}; + $keyforref = $this->table_ref_field; + $this->ref = $this->$keyforref; $this->ref_supplier = empty($this->ref_supplier) ? '' : $this->ref_supplier; $this->usenewprice = empty($this->usenewprice) ? 0 : $this->usenewprice; $this->suspended = empty($this->suspended) ? 0 : $this->suspended; @@ -583,9 +584,11 @@ class FactureFournisseurRec extends CommonInvoice if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); + $keyforref = $this->table_ref_field; + $this->id = $obj->rowid; $this->titre = $obj->titre; - $this->ref = $this->{$this->table_ref_field}; + $this->ref = $obj->$keyforref; $this->ref_supplier = $obj->ref_supplier; $this->entity = $obj->entity; $this->socid = $obj->fk_soc;