Merge pull request #7760 from Oeris/develop-api

NEW Adds the payment reference to the return of the function getListOfPayements
This commit is contained in:
Laurent Destailleur 2017-11-05 18:29:59 +01:00 committed by GitHub
commit 21a0f11395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3193,7 +3193,7 @@ class Facture extends CommonInvoice
$field2='fk_paiementfourn';
}
$sql = 'SELECT pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code';
$sql = 'SELECT p.ref, pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, p.num_paiement as num, t.code';
$sql.= ' FROM '.MAIN_DB_PREFIX.$table.' as pf, '.MAIN_DB_PREFIX.$table2.' as p, '.MAIN_DB_PREFIX.'c_paiement as t';
$sql.= ' WHERE pf.'.$field.' = '.$this->id;
//$sql.= ' WHERE pf.'.$field.' = 1';
@ -3211,7 +3211,7 @@ class Facture extends CommonInvoice
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$retarray[]=array('amount'=>$obj->amount,'type'=>$obj->code, 'date'=>$obj->datep, 'num'=>$obj->num);
$retarray[]=array('amount'=>$obj->amount,'type'=>$obj->code, 'date'=>$obj->datep, 'num'=>$obj->num, 'ref'=>$obj->ref);
$i++;
}
$this->db->free($resql);