NEW Adds the payment reference to the return of the function getListOfPayements

Adds the payment reference to the return of the function getListOfPayements
This commit is contained in:
Neil Orley 2017-11-03 13:04:23 +01:00
parent ce3e586bd0
commit 3ecccadb8b

View File

@ -3193,7 +3193,7 @@ class Facture extends CommonInvoice
$field2='fk_paiementfourn'; $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.= ' 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.' = '.$this->id;
//$sql.= ' WHERE pf.'.$field.' = 1'; //$sql.= ' WHERE pf.'.$field.' = 1';
@ -3211,7 +3211,7 @@ class Facture extends CommonInvoice
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($resql); $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++; $i++;
} }
$this->db->free($resql); $this->db->free($resql);