Update commoninvoice.class.php
This commit is contained in:
parent
29931bbded
commit
acc995a553
@ -297,6 +297,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
$table2 = 'paiement';
|
||||
$field = 'fk_facture';
|
||||
$field2 = 'fk_paiement';
|
||||
$field3=', p.ref_ext';
|
||||
$sharedentity = 'facture';
|
||||
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier')
|
||||
{
|
||||
@ -304,10 +305,11 @@ abstract class CommonInvoice extends CommonObject
|
||||
$table2 = 'paiementfourn';
|
||||
$field = 'fk_facturefourn';
|
||||
$field2 = 'fk_paiementfourn';
|
||||
$field3='';
|
||||
$sharedentity = 'facture_fourn';
|
||||
}
|
||||
|
||||
$sql = 'SELECT p.ref, 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'.$field3;
|
||||
$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';
|
||||
@ -325,7 +327,11 @@ abstract class CommonInvoice extends CommonObject
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$retarray[] = array('amount'=>$obj->amount, 'type'=>$obj->code, 'date'=>$obj->datep, 'num'=>$obj->num, 'ref'=>$obj->ref);
|
||||
$tmp = array('amount'=>$obj->amount,'type'=>$obj->code, 'date'=>$obj->datep, 'num'=>$obj->num, 'ref'=>$obj->ref);
|
||||
if (!empty($field3)) {
|
||||
$tmp['ref_ext'] = $obj->ref_ext;
|
||||
}
|
||||
$retarray[]=$tmp;
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user