Qual: Better compatibility with other databases
This commit is contained in:
parent
78643ec12a
commit
c451386b8e
@ -229,14 +229,14 @@ if ($socid > 0)
|
|||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
$sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.total, f.total_ttc';
|
$sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.total, f.total_ttc,';
|
||||||
$sql.= ', '.$db->pdate("f.datef").' as df, f.paye as paye, f.fk_statut as statut';
|
$sql.= ' '.$db->pdate("f.datef").' as df, '.$db->pdate("f.datec").' as dc, f.paye as paye, f.fk_statut as statut,';
|
||||||
$sql.= ', s.nom, s.rowid as socid';
|
$sql.= ' s.nom, s.rowid as socid,';
|
||||||
$sql.= ', sum(pf.amount) as am';
|
$sql.= ' sum(pf.amount) as am';
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON f.rowid=pf.fk_facture';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON f.rowid=pf.fk_facture';
|
||||||
$sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id;
|
$sql.= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id;
|
||||||
$sql.= ' GROUP BY f.rowid';
|
$sql.= ' GROUP BY f.rowid, f.facnumber, f.type, f.amount, f.total, f.total_ttc, f.datef, f.datec, f.paye, f.fk_statut, s.nom, s.rowid';
|
||||||
$sql.= " ORDER BY f.datef DESC, f.datec DESC";
|
$sql.= " ORDER BY f.datef DESC, f.datec DESC";
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user