diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php
index a9864e34c0d..7bb252394c3 100644
--- a/htdocs/blockedlog/class/blockedlog.class.php
+++ b/htdocs/blockedlog/class/blockedlog.class.php
@@ -476,7 +476,7 @@ class BlockedLog
$this->object_data->ref = $object->ref;
$this->object_data->date = $datepayment;
$this->object_data->type_code = dol_getIdFromCode($this->db, $paymenttypeid, 'c_paiement', 'id', 'code');
- $this->object_data->payment_num = ($object->num_paiement ? $object->num_paiement : $object->num_payment);
+ $this->object_data->payment_num = $object->num_payment;
//$this->object_data->fk_account = $object->fk_account;
$this->object_data->note = $object->note;
//var_dump($this->object_data);exit;
diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php
index 3253d6d5d3e..6b8e9af94f1 100644
--- a/htdocs/cashdesk/validation_verif.php
+++ b/htdocs/cashdesk/validation_verif.php
@@ -294,9 +294,8 @@ switch ($action)
// Add the payment
$payment = new Paiement($db);
$payment->datepaye = $now;
- $payment->bank_account = $conf_fkaccount;
$payment->amounts[$invoice->id] = $obj_facturation->amountWithTax();
- $payment->note = $langs->trans("Payment").' '.$langs->trans("Invoice").' '.$obj_facturation->numInvoice();
+ $payment->note_public = $langs->trans("Payment").' '.$langs->trans("Invoice").' '.$obj_facturation->numInvoice();
$payment->paiementid = $invoice->mode_reglement_id;
$payment->num_paiement = '';
$payment->num_payment = '';
diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php
index f0125482cf9..fe8ca7d42d3 100644
--- a/htdocs/compta/facture/class/api_invoices.class.php
+++ b/htdocs/compta/facture/class/api_invoices.class.php
@@ -1285,7 +1285,7 @@ class Invoices extends DolibarrApi
* @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no}
* @param int $accountid {@from body} Account Id {@min 1}
* @param string $num_payment {@from body} Payment number (optional)
- * @param string $comment {@from body} Note public (optional)
+ * @param string $comment {@from body} Note private (optional)
* @param string $chqemetteur {@from body} Payment issuer (mandatory if paymentcode = 'CHQ')
* @param string $chqbank {@from body} Issuer bank name (optional)
*
@@ -1365,7 +1365,7 @@ class Invoices extends DolibarrApi
$paymentobj->paiementid = $paymentid;
$paymentobj->paiementcode = dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1);
$paymentobj->num_payment = $num_payment;
- $paymentobj->note_public = $comment;
+ $paymentobj->note_private = $comment;
$payment_id = $paymentobj->create(DolibarrApiAccess::$user, ($closepaidinvoices == 'yes' ? 1 : 0)); // This include closing invoices
if ($payment_id < 0)
@@ -1405,7 +1405,7 @@ class Invoices extends DolibarrApi
* @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no}
* @param int $accountid {@from body} Account Id {@min 1}
* @param string $num_payment {@from body} Payment number (optional)
- * @param string $comment {@from body} Note public (optional)
+ * @param string $comment {@from body} Note private (optional)
* @param string $chqemetteur {@from body} Payment issuer (mandatory if paiementcode = 'CHQ')
* @param string $chqbank {@from body} Issuer bank name (optional)
*
@@ -1497,7 +1497,7 @@ class Invoices extends DolibarrApi
$paymentobj->paiementid = $paymentid;
$paymentobj->paiementcode = dol_getIdFromCode($this->db, $paymentid, 'c_paiement', 'id', 'code', 1);
$paymentobj->num_payment = $num_payment;
- $paymentobj->note_public = $comment;
+ $paymentobj->note_private = $comment;
$payment_id = $paymentobj->create(DolibarrApiAccess::$user, ($closepaidinvoices == 'yes' ? 1 : 0)); // This include closing invoices
if ($payment_id < 0)
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 4390c9c1cb0..865ef40a258 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -265,8 +265,6 @@ if (empty($reshook))
$paiement->paiementid = dol_getIdFromCode($db, GETPOST('paiementcode'), 'c_paiement', 'code', 'id', 1);
$paiement->num_payment = GETPOST('num_paiement', 'alpha');
$paiement->note_private = GETPOST('comment', 'alpha');
- $paiement->num_paiement = $paiement->num_payment; // For bacward compatibility
- $paiement->note = $paiement->note_private; // For bacward compatibility
if (!$error)
{
@@ -851,7 +849,7 @@ if (!GETPOST('action', 'aZ09'))
if (!$sortfield) $sortfield = 'p.datep';
$sql = 'SELECT p.datep as dp, p.amount, f.total_ttc as fa_amount, f.ref';
- $sql .= ', f.rowid as facid, c.libelle as paiement_type, p.num_paiement';
+ $sql .= ', f.rowid as facid, c.libelle as paiement_type, p.num_paiement as num_payment';
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiement as p LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id';
$sql .= ', '.MAIN_DB_PREFIX.'facture as f';
$sql .= ' WHERE p.fk_facture = f.rowid';
@@ -887,7 +885,7 @@ if (!GETPOST('action', 'aZ09'))
print '
';
print '| '.$objp->ref." | \n";
print ''.dol_print_date($db->jdate($objp->dp))." | \n";
- print ''.$objp->paiement_type.' '.$objp->num_paiement." | \n";
+ print ''.$objp->paiement_type.' '.$objp->num_payment." | \n";
print ''.price($objp->amount).' | ';
print ' | ';
print '
';
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 67ab5fc3c22..a772d1856ee 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -90,13 +90,6 @@ class Paiement extends CommonObject
*/
public $type_code;
- /**
- * @var string Numero du CHQ, VIR, etc...
- * @deprecated
- * @see $num_payment
- */
- public $numero;
-
/**
* @var string Numero du CHQ, VIR, etc...
* @deprecated
@@ -194,7 +187,6 @@ class Paiement extends CommonObject
$this->ref_ext = $obj->ref_ext;
$this->date = $this->db->jdate($obj->dp);
$this->datepaye = $this->db->jdate($obj->dp);
- $this->num_paiement = $obj->num_payment; // deprecated
$this->num_payment = $obj->num_payment;
$this->montant = $obj->amount; // deprecated
$this->amount = $obj->amount;
@@ -297,8 +289,8 @@ class Paiement extends CommonObject
$mtotal = $totalamount;
}
- $num_payment = ($this->num_payment ? $this->num_payment : $this->num_paiement);
- $note = ($this->note_public ? $this->note_public : $this->note);
+ $num_payment = $this->num_payment;
+ $note = ($this->note_private ? $this->note_private : $this->note);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, ref_ext, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, ext_payment_id, ext_payment_site, fk_user_creat, pos_change)";
$sql .= " VALUES (".$conf->entity.", '".$this->db->escape($this->ref)."', '".$this->db->escape($this->ref_ext)."', '".$this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', ".$total.", ".$mtotal.", ".$this->paiementid.", ";
@@ -716,7 +708,7 @@ class Paiement extends CommonObject
$bank_line_id,
$this->id_prelevement,
DOL_URL_ROOT.'/compta/prelevement/card.php?id=',
- $this->num_paiement,
+ $this->num_payment,
'withdraw'
);
}
diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php
index fbe5d926d33..2819e492f7b 100644
--- a/htdocs/compta/payment_sc/card.php
+++ b/htdocs/compta/payment_sc/card.php
@@ -182,7 +182,7 @@ print '| '.$langs->trans('Date').' | '.dol_print_date($o
print ' |
| '.$langs->trans('Mode').' | '.$langs->trans("PaymentType".$object->type_code).' |
';
// Numero
-print '| '.$langs->trans('Numero').' | '.$object->num_paiement.' |
';
+print '| '.$langs->trans('Numero').' | '.$object->num_payment.' |
';
// Montant
print '| '.$langs->trans('Amount').' | '.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).' |
';
diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php
index fa2ef4e1387..067dd33cd81 100644
--- a/htdocs/compta/prelevement/class/bonprelevement.class.php
+++ b/htdocs/compta/prelevement/class/bonprelevement.class.php
@@ -507,7 +507,6 @@ class BonPrelevement extends CommonObject
}
$paiement->num_payment = $this->ref; // Set ref of direct debit note
- $paiement->num_paiement = $this->ref; // For backward compatibility
$paiement->id_prelevement = $this->id;
$paiement_id = $paiement->create($user); // This use ->paiementid, that is ID of payment mode
diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php
index 8599987fb23..20d600bf9b4 100644
--- a/htdocs/compta/prelevement/class/rejetprelevement.class.php
+++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php
@@ -153,7 +153,6 @@ class RejetPrelevement
$pai->amounts[$facs[$i][0]] = price2num($facs[$i][1] * -1);
$pai->datepaye = $date_rejet;
$pai->paiementid = 3; // type of payment: withdrawal
- $pai->num_paiement = $fac->ref;
$pai->num_payment = $fac->ref;
if ($pai->create($this->user) < 0) // we call with no_commit
diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
index 52939d6add7..62b02860f08 100644
--- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
+++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
@@ -134,9 +134,8 @@ class PaymentSocialContribution extends CommonObject
if (isset($this->fk_charge)) $this->fk_charge = (int) $this->fk_charge;
if (isset($this->amount)) $this->amount = trim($this->amount);
if (isset($this->fk_typepaiement)) $this->fk_typepaiement = (int) $this->fk_typepaiement;
- if (isset($this->num_paiement)) $this->num_paiement = trim($this->num_paiement); // deprecated
if (isset($this->num_payment)) $this->num_payment = trim($this->num_payment);
- if (isset($this->note)) $this->note = trim($this->note);
+ if (isset($this->note_private)) $this->note_private = trim($this->note_private);
if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank;
if (isset($this->fk_user_creat)) $this->fk_user_creat = (int) $this->fk_user_creat;
if (isset($this->fk_user_modif)) $this->fk_user_modif = (int) $this->fk_user_modif;
@@ -265,9 +264,8 @@ class PaymentSocialContribution extends CommonObject
$this->datep = $this->db->jdate($obj->datep);
$this->amount = $obj->amount;
$this->fk_typepaiement = $obj->fk_typepaiement;
- $this->num_paiement = $obj->num_payment;
$this->num_payment = $obj->num_payment;
- $this->note = $obj->note;
+ $this->note_private = $obj->note;
$this->fk_bank = $obj->fk_bank;
$this->fk_user_creat = $obj->fk_user_creat;
$this->fk_user_modif = $obj->fk_user_modif;
@@ -305,9 +303,8 @@ class PaymentSocialContribution extends CommonObject
if (isset($this->fk_charge)) $this->fk_charge = (int) $this->fk_charge;
if (isset($this->amount)) $this->amount = trim($this->amount);
if (isset($this->fk_typepaiement)) $this->fk_typepaiement = (int) $this->fk_typepaiement;
- if (isset($this->num_paiement)) $this->num_paiement = trim($this->num_paiement); // deprecated
if (isset($this->num_payment)) $this->num_payment = trim($this->num_payment);
- if (isset($this->note)) $this->note = trim($this->note);
+ if (isset($this->note_private)) $this->note_private = trim($this->note_private);
if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank;
if (isset($this->fk_user_creat)) $this->fk_user_creat = (int) $this->fk_user_creat;
if (isset($this->fk_user_modif)) $this->fk_user_modif = (int) $this->fk_user_modif;
@@ -326,7 +323,7 @@ class PaymentSocialContribution extends CommonObject
$sql .= " datep=".(dol_strlen($this->datep) != 0 ? "'".$this->db->idate($this->datep)."'" : 'null').",";
$sql .= " amount=".(isset($this->amount) ? $this->amount : "null").",";
$sql .= " fk_typepaiement=".(isset($this->fk_typepaiement) ? $this->fk_typepaiement : "null").",";
- $sql .= " num_paiement=".(isset($this->num_paiement) ? "'".$this->db->escape($this->num_paiement)."'" : "null").",";
+ $sql .= " num_paiement=".(isset($this->num_payment) ? "'".$this->db->escape($this->num_payment)."'" : "null").",";
$sql .= " note=".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : "null").",";
$sql .= " fk_bank=".(isset($this->fk_bank) ? $this->fk_bank : "null").",";
$sql .= " fk_user_creat=".(isset($this->fk_user_creat) ? $this->fk_user_creat : "null").",";
@@ -504,7 +501,7 @@ class PaymentSocialContribution extends CommonObject
global $conf;
// Clean data
- $this->num_payment = trim($this->num_payment ? $this->num_payment : $this->num_paiement);
+ $this->num_payment = trim($this->num_payment);
$error = 0;
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index c3883ee6b3d..023b114835a 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -1933,7 +1933,6 @@ if ($action == 'create')
$paymentexpensereportstatic->id = $objp->rowid;
$paymentexpensereportstatic->datepaye = $db->jdate($objp->dp);
$paymentexpensereportstatic->ref = $objp->rowid;
- $paymentexpensereportstatic->num_paiement = $objp->num_payment;
$paymentexpensereportstatic->num_payment = $objp->num_payment;
$paymentexpensereportstatic->payment_code = $objp->payment_code;
diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php
index 404566b5392..67133ed97b2 100644
--- a/htdocs/fourn/class/paiementfourn.class.php
+++ b/htdocs/fourn/class/paiementfourn.class.php
@@ -119,7 +119,6 @@ class PaiementFourn extends Paiement
$this->entity = $obj->entity;
$this->date = $this->db->jdate($obj->dp);
$this->datepaye = $this->db->jdate($obj->dp);
- $this->num_paiement = $obj->num_payment;
$this->num_payment = $obj->num_payment;
$this->bank_account = $obj->fk_account;
$this->fk_account = $obj->fk_account;
@@ -207,7 +206,7 @@ class PaiementFourn extends Paiement
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiementfourn (';
$sql .= 'ref, entity, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, fk_user_author, fk_bank)';
$sql .= " VALUES ('".$this->db->escape($ref)."', ".$conf->entity.", '".$this->db->idate($now)."',";
- $sql .= " '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->db->escape($this->num_paiement)."', '".$this->db->escape($this->note)."', ".$user->id.", 0)";
+ $sql .= " '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_private)."', ".$user->id.", 0)";
$resql = $this->db->query($sql);
if ($resql)
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index d53a554f9d8..278896aae9b 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -2717,7 +2717,7 @@ if ($action == 'create')
if ($societe->localtax1_assuj == "1") $nbrows++;
if ($societe->localtax2_assuj == "1") $nbrows++;
- $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement, p.rowid, p.fk_bank,';
+ $sql = 'SELECT p.datep as dp, p.ref, p.num_paiement as num_payment, p.rowid, p.fk_bank,';
$sql .= ' c.id as paiement_type,';
$sql .= ' pf.amount,';
$sql .= ' ba.rowid as baid, ba.ref as baref, ba.label, ba.number as banumber, ba.account_number, ba.fk_accountancy_journal';
@@ -2755,7 +2755,7 @@ if ($action == 'create')
$paymentstatic->id = $objp->rowid;
$paymentstatic->datepaye = $db->jdate($objp->dp);
$paymentstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
- $paymentstatic->num_paiement = $objp->num_paiement;
+ $paymentstatic->num_payment = $objp->num_payment;
$paymentstatic->payment_code = $objp->payment_code;
print '';
@@ -2764,7 +2764,7 @@ if ($action == 'create')
print '';
print '| '.dol_print_date($db->jdate($objp->dp), 'day').' | ';
print '';
- print $form->form_modes_reglement(null, $objp->paiement_type, 'none').' '.$objp->num_paiement;
+ print $form->form_modes_reglement(null, $objp->paiement_type, 'none').' '.$objp->num_payment;
print ' | ';
if (!empty($conf->banque->enabled))
{
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index d5212582420..65b8936a592 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -301,9 +301,7 @@ if (empty($reshook))
$paiement->num_payment = GETPOST('num_paiement', 'alphanohtml');
$paiement->note_private = GETPOST('comment', 'alpha');
- $paiement->num_paiement = $paiement->num_payment; // For backward compatibility
$paiement->num_payment = $paiement->num_payment;
- $paiement->note = $paiement->note_private; // For backward compatibility
$paiement->note_private = $paiement->note_private;
if (!$error)
diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php
index b2993ec86f5..3be1af4935e 100644
--- a/htdocs/public/payment/paymentok.php
+++ b/htdocs/public/payment/paymentok.php
@@ -628,7 +628,6 @@ if ($ispaymentok)
$error++; // Not yet supported
}
$paiement->paiementid = $paymentTypeId;
- $paiement->num_paiement = '';
$paiement->num_payment = '';
$paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
$paiement->ext_payment_id = $TRANSACTIONID;