Fix num payment

This commit is contained in:
Laurent Destailleur 2020-06-06 15:39:18 +02:00
parent a305c43901
commit 919cc0da87

View File

@ -159,7 +159,7 @@ class PaymentSocialContribution extends CommonObject
if ($totalamount != 0) if ($totalamount != 0)
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiementcharge (fk_charge, datec, datep, amount,"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiementcharge (fk_charge, datec, datep, amount,";
$sql .= " fk_typepaiement, num_paiement as num_payment, note, fk_user_creat, fk_bank)"; $sql .= " fk_typepaiement, num_paiement, note, fk_user_creat, fk_bank)";
$sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',"; $sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',";
$sql .= " '".$this->db->idate($this->datepaye)."',"; $sql .= " '".$this->db->idate($this->datepaye)."',";
$sql .= " ".$totalamount.","; $sql .= " ".$totalamount.",";
@ -516,6 +516,9 @@ class PaymentSocialContribution extends CommonObject
{ {
global $conf; global $conf;
// Clean data
$this->num_payment = trim($this->num_payment ? $this->num_payment : $this->num_paiement);
$error = 0; $error = 0;
if (!empty($conf->banque->enabled)) if (!empty($conf->banque->enabled))
@ -534,7 +537,7 @@ class PaymentSocialContribution extends CommonObject
$this->paiementtype, // Payment mode id or code ("CHQ or VIR for example") $this->paiementtype, // Payment mode id or code ("CHQ or VIR for example")
$label, $label,
$total, $total,
$this->num_paiement, $this->num_payment,
'', '',
$user, $user,
$emetteur_nom, $emetteur_nom,