Update paiement.class.php

This commit is contained in:
Frédéric FRANCE 2018-10-17 08:15:12 +02:00 committed by GitHub
parent 2e77b9fed9
commit 7d8ff04292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,8 +138,8 @@ class Paiement extends CommonObject
$this->type_libelle = $obj->type_libelle;
$this->type_code = $obj->type_code;
$this->statut = $obj->statut;
$this->payment_id = $obj->ext_payment_id;
$this->payment_site = $obj->ext_payment_site;
$this->payment_id = $obj->ext_payment_id;
$this->payment_site = $obj->ext_payment_site;
$this->bank_account = $obj->fk_account; // deprecated
$this->fk_account = $obj->fk_account;
@ -233,11 +233,9 @@ class Paiement extends CommonObject
$mtotal = $totalamount;
}
$note = ($this->note_public?$this->note_public:$this->note);
$payment_id = $this->payment_id ? $this->payment_id : null;
$payment_site = $this->payment_site ? $this->payment_site : null;
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, ext_payment_id, ext_payment_site, fk_user_creat)";
$sql.= " VALUES (".$conf->entity.", '".$this->ref."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($note)."', '".$this->db->escape($payment_id)."', '".$this->db->escape($payment_site)."', ".$user->id.")";
$sql.= " VALUES (".$conf->entity.", '".$this->ref."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($note)."', ".($this->payment_id?"'".$this->db->escape($this->payment_id)."'":"null").", ".($this->payment_site?"'".$this->db->escape($this->payment_site)."'":"null").", ".$user->id.")";
dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG);
$resql = $this->db->query($sql);