From 2e77b9fed9ef745a24d133d346478bfcc86aacd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 16 Oct 2018 22:42:18 +0200 Subject: [PATCH 1/2] fix phpunit --- htdocs/compta/paiement/class/paiement.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index cc60c2cba8e..50f7bc2c4e6 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -76,8 +76,8 @@ class Paiement extends CommonObject //paiement de llx_c_paiement public $num_paiement; // Numero du CHQ, VIR, etc... public $num_payment; // Numero du CHQ, VIR, etc... - public $payment_id; // Id of external modepayment - public $payment_site; // name of external modepayment + public $payment_id; // Id of external modepayment + public $payment_site; // name of external modepayment public $bank_account; // Id compte bancaire du paiement public $bank_line; // Id de la ligne d'ecriture bancaire // fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...) @@ -233,11 +233,11 @@ 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; + $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->payment_id."', '".$this->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->db->escape($payment_id)."', '".$this->db->escape($payment_site)."', ".$user->id.")"; dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG); $resql = $this->db->query($sql); From 7d8ff0429251f4860ca70c8aa5226e8266a4e0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 17 Oct 2018 08:15:12 +0200 Subject: [PATCH 2/2] Update paiement.class.php --- htdocs/compta/paiement/class/paiement.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 50f7bc2c4e6..4fdc4a0ae63 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -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);