From 085aa8a247015180f9dbbc2f3391b69abf910902 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 26 Feb 2019 18:31:00 +0100 Subject: [PATCH 1/3] FIX dolibarize fk_soc / socid --- htdocs/don/class/don.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index f6c2ff1847c..4125e9e97db 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -644,7 +644,7 @@ class Don extends CommonObject global $conf; $sql = "SELECT d.rowid, d.datec, d.date_valid, d.tms as datem, d.datedon,"; - $sql.= " d.fk_soc,d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, "; + $sql.= " d.fk_soc as socid,d.firstname, d.lastname, d.societe, d.amount, d.fk_statut, d.address, d.zip, d.town, "; $sql.= " d.fk_country, d.country as country_olddata, d.public, d.amount, d.fk_payment, d.paid, d.note_private, d.note_public, d.email, d.phone, "; $sql.= " d.phone_mobile, d.fk_projet as fk_project, d.model_pdf,"; $sql.= " p.ref as project_ref,"; @@ -678,7 +678,7 @@ class Don extends CommonObject $this->date_valid = $this->db->jdate($obj->date_valid); $this->datem = $this->db->jdate($obj->datem); $this->date = $this->db->jdate($obj->datedon); - $this->fk_soc = $obj->fk_soc; + $this->socid = $obj->socid; $this->firstname = $obj->firstname; $this->lastname = $obj->lastname; $this->societe = $obj->societe; From 70e451a88647bacb822a489ff3f6cb39c0b89db6 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 26 Feb 2019 18:44:07 +0100 Subject: [PATCH 2/3] Update don.class.php --- htdocs/don/class/don.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 4125e9e97db..27e124d6db2 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -395,7 +395,7 @@ class Don extends CommonObject $sql.= ", ".$conf->entity; $sql.= ", ".price2num($this->amount); $sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null"); - $sql.= ", '".$this->db->escape($this->fk_soc)."'"; + $sql.= ", '".$this->db->escape($this->socid)."'"; $sql.= ", '".$this->db->escape($this->firstname)."'"; $sql.= ", '".$this->db->escape($this->lastname)."'"; $sql.= ", '".$this->db->escape($this->societe)."'"; From 70fc33e8bba937d65bf74a967e8bff9560098708 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 27 Feb 2019 00:14:11 +0100 Subject: [PATCH 3/3] Update don.class.php --- htdocs/don/class/don.class.php | 70 +++++++++++++++++----------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 27e124d6db2..f361299f83a 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -672,40 +672,42 @@ class Don extends CommonObject { $obj = $this->db->fetch_object($resql); - $this->id = $obj->rowid; - $this->ref = $obj->rowid; - $this->datec = $this->db->jdate($obj->datec); - $this->date_valid = $this->db->jdate($obj->date_valid); - $this->datem = $this->db->jdate($obj->datem); - $this->date = $this->db->jdate($obj->datedon); - $this->socid = $obj->socid; - $this->firstname = $obj->firstname; - $this->lastname = $obj->lastname; - $this->societe = $obj->societe; - $this->statut = $obj->fk_statut; - $this->address = $obj->address; - $this->town = $obj->town; - $this->zip = $obj->zip; - $this->town = $obj->town; - $this->country_id = $obj->fk_country; - $this->country_code = $obj->country_code; - $this->country = $obj->country; - $this->country_olddata= $obj->country_olddata; // deprecated - $this->email = $obj->email; - $this->phone = $obj->phone; - $this->phone_mobile = $obj->phone_mobile; - $this->project = $obj->project_ref; - $this->fk_projet = $obj->fk_project; // deprecated - $this->fk_project = $obj->fk_project; - $this->public = $obj->public; - $this->modepaymentid = $obj->fk_payment; - $this->modepaymentcode = $obj->payment_code; - $this->modepayment = $obj->payment_label; - $this->paid = $obj->paid; - $this->amount = $obj->amount; - $this->note_private = $obj->note_private; - $this->note_public = $obj->note_public; - $this->modelpdf = $obj->model_pdf; + $this->id = $obj->rowid; + $this->ref = $obj->rowid; + $this->date_creation = $this->db->jdate($obj->datec); + $this->datec = $this->db->jdate($obj->datec); + $this->date_validation = $this->db->jdate($obj->date_valid); + $this->date_modification = $this->db->jdate($obj->datem); + $this->datem = $this->db->jdate($obj->datem); + $this->date = $this->db->jdate($obj->datedon); + $this->socid = $obj->socid; + $this->firstname = $obj->firstname; + $this->lastname = $obj->lastname; + $this->societe = $obj->societe; + $this->statut = $obj->fk_statut; + $this->address = $obj->address; + $this->town = $obj->town; + $this->zip = $obj->zip; + $this->town = $obj->town; + $this->country_id = $obj->fk_country; + $this->country_code = $obj->country_code; + $this->country = $obj->country; + $this->country_olddata = $obj->country_olddata; // deprecated + $this->email = $obj->email; + $this->phone = $obj->phone; + $this->phone_mobile = $obj->phone_mobile; + $this->project = $obj->project_ref; + $this->fk_projet = $obj->fk_project; // deprecated + $this->fk_project = $obj->fk_project; + $this->public = $obj->public; + $this->mode_reglement_id = $obj->fk_payment; + $this->mode_reglement_code= $obj->payment_code; + $this->mode_reglement = $obj->payment_label; + $this->paid = $obj->paid; + $this->amount = $obj->amount; + $this->note_private = $obj->note_private; + $this->note_public = $obj->note_public; + $this->modelpdf = $obj->model_pdf; // Retreive all extrafield // fetch optionals attributes and labels