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.= ", ".$conf->entity;
$sql.= ", ".price2num($this->amount); $sql.= ", ".price2num($this->amount);
$sql.= ", ".($this->modepaymentid?$this->modepaymentid:"null"); $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->firstname)."'";
$sql.= ", '".$this->db->escape($this->lastname)."'"; $sql.= ", '".$this->db->escape($this->lastname)."'";
$sql.= ", '".$this->db->escape($this->societe)."'"; $sql.= ", '".$this->db->escape($this->societe)."'";
@ -644,7 +644,7 @@ class Don extends CommonObject
global $conf; global $conf;
$sql = "SELECT d.rowid, d.datec, d.date_valid, d.tms as datem, d.datedon,"; $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.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.= " d.phone_mobile, d.fk_projet as fk_project, d.model_pdf,";
$sql.= " p.ref as project_ref,"; $sql.= " p.ref as project_ref,";
@ -672,40 +672,42 @@ class Don extends CommonObject
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->rowid; $this->ref = $obj->rowid;
$this->datec = $this->db->jdate($obj->datec); $this->date_creation = $this->db->jdate($obj->datec);
$this->date_valid = $this->db->jdate($obj->date_valid); $this->datec = $this->db->jdate($obj->datec);
$this->datem = $this->db->jdate($obj->datem); $this->date_validation = $this->db->jdate($obj->date_valid);
$this->date = $this->db->jdate($obj->datedon); $this->date_modification = $this->db->jdate($obj->datem);
$this->fk_soc = $obj->fk_soc; $this->datem = $this->db->jdate($obj->datem);
$this->firstname = $obj->firstname; $this->date = $this->db->jdate($obj->datedon);
$this->lastname = $obj->lastname; $this->socid = $obj->socid;
$this->societe = $obj->societe; $this->firstname = $obj->firstname;
$this->statut = $obj->fk_statut; $this->lastname = $obj->lastname;
$this->address = $obj->address; $this->societe = $obj->societe;
$this->town = $obj->town; $this->statut = $obj->fk_statut;
$this->zip = $obj->zip; $this->address = $obj->address;
$this->town = $obj->town; $this->town = $obj->town;
$this->country_id = $obj->fk_country; $this->zip = $obj->zip;
$this->country_code = $obj->country_code; $this->town = $obj->town;
$this->country = $obj->country; $this->country_id = $obj->fk_country;
$this->country_olddata= $obj->country_olddata; // deprecated $this->country_code = $obj->country_code;
$this->email = $obj->email; $this->country = $obj->country;
$this->phone = $obj->phone; $this->country_olddata = $obj->country_olddata; // deprecated
$this->phone_mobile = $obj->phone_mobile; $this->email = $obj->email;
$this->project = $obj->project_ref; $this->phone = $obj->phone;
$this->fk_projet = $obj->fk_project; // deprecated $this->phone_mobile = $obj->phone_mobile;
$this->fk_project = $obj->fk_project; $this->project = $obj->project_ref;
$this->public = $obj->public; $this->fk_projet = $obj->fk_project; // deprecated
$this->modepaymentid = $obj->fk_payment; $this->fk_project = $obj->fk_project;
$this->modepaymentcode = $obj->payment_code; $this->public = $obj->public;
$this->modepayment = $obj->payment_label; $this->mode_reglement_id = $obj->fk_payment;
$this->paid = $obj->paid; $this->mode_reglement_code= $obj->payment_code;
$this->amount = $obj->amount; $this->mode_reglement = $obj->payment_label;
$this->note_private = $obj->note_private; $this->paid = $obj->paid;
$this->note_public = $obj->note_public; $this->amount = $obj->amount;
$this->modelpdf = $obj->model_pdf; $this->note_private = $obj->note_private;
$this->note_public = $obj->note_public;
$this->modelpdf = $obj->model_pdf;
// Retreive all extrafield // Retreive all extrafield
// fetch optionals attributes and labels // fetch optionals attributes and labels