Skip to content
Snippets Groups Projects
Commit 80ac99e9 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix missing field into response

parent 25a3f8a8
No related branches found
No related tags found
No related merge requests found
...@@ -2849,9 +2849,10 @@ class Facture extends CommonInvoice ...@@ -2849,9 +2849,10 @@ class Facture extends CommonInvoice
$field2='fk_paiementfourn'; $field2='fk_paiementfourn';
} }
$sql = 'SELECT pf.amount, pf.multicurrency_amount, p.fk_paiement, p.datep, t.code'; $sql = 'SELECT 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.= ' AND pf.'.$field2.' = p.rowid'; $sql.= ' AND pf.'.$field2.' = p.rowid';
$sql.= ' AND p.fk_paiement = t.id'; $sql.= ' AND p.fk_paiement = t.id';
if ($filtertype) $sql.=" AND t.code='PRE'"; if ($filtertype) $sql.=" AND t.code='PRE'";
...@@ -2865,7 +2866,7 @@ class Facture extends CommonInvoice ...@@ -2865,7 +2866,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); $retarray[]=array('amount'=>$obj->amount,'type'=>$obj->code, 'date'=>$obj->datep, 'num'=>$obj->num);
$i++; $i++;
} }
$this->db->free($resql); $this->db->free($resql);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment