Merge pull request #23721 from Notmarrco/develop

feat(invoice): Add bankline id to listOfPayments fields
This commit is contained in:
Laurent Destailleur 2023-01-29 20:21:23 +01:00 committed by GitHub
commit 5009e55a08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -332,6 +332,7 @@ abstract class CommonInvoice extends CommonObject
$field = 'fk_facture';
$field2 = 'fk_paiement';
$field3 = ', p.ref_ext';
$field4 = ', p.fk_bank'; // Bank line id
$sharedentity = 'facture';
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') {
$table = 'paiementfourn_facturefourn';
@ -342,7 +343,7 @@ abstract class CommonInvoice extends CommonObject
$sharedentity = 'facture_fourn';
}
$sql = "SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code".$field3;
$sql = "SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code".$field3 . $field4;
$sql .= " FROM ".$this->db->prefix().$table." as pf, ".$this->db->prefix().$table2." as p, ".$this->db->prefix()."c_paiement as t";
$sql .= " WHERE pf.".$field." = ".((int) $this->id);
$sql .= " AND pf.".$field2." = p.rowid";
@ -363,6 +364,9 @@ abstract class CommonInvoice extends CommonObject
if (!empty($field3)) {
$tmp['ref_ext'] = $obj->ref_ext;
}
if (!empty($field4)) {
$tmp['fk_bank_line'] = $obj->fk_bank;
}
$retarray[] = $tmp;
$i++;
}