Merge pull request #10697 from ptibogxiv/patch-133

FIX dolibarize  don.class.php
This commit is contained in:
Laurent Destailleur 2019-02-27 01:09:00 +01:00 committed by GitHub
commit 60d01771b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)."'";
@ -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,";
@ -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->fk_soc = $obj->fk_soc;
$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