diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index f57352d2cd3..30a9e25f830 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -266,7 +266,7 @@ if ($conf->facture->enabled) * */ - $sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp, f.total_ttc, sum(pf.amount) as am"; + $sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp, f.total, f.total_ttc, sum(pf.amount) as am"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f left join ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture"; $sql .= " WHERE s.idp = f.fk_soc AND f.paye = 0 AND f.fk_statut = 1"; if ($socidp) @@ -283,9 +283,9 @@ if ($conf->facture->enabled) if ($num) { print ''; - print ''; + print ''; $var = True; - $total = $totalam = 0; + $total_ttc = $totalam = $total = 0; while ($i < $num) { $obj = $db->fetch_object(); @@ -296,15 +296,18 @@ if ($conf->facture->enabled) print ''; print ''; + print ''; print ''; print ''; } - $total += $obj->total_ttc; + $total_ttc += $obj->total_ttc; + $total += $obj->total; $totalam += $obj->am; $i++; } $var=!$var; - print ''; + print ""; + print ''; print "
Factures clients impayées ('.$num.')Montant TTCReçu
Factures clients impayées ('.$num.')Montant HTMontant TTCReçu
'.img_file().''; print ' '.$obj->facnumber.''.$obj->nom.''.price($obj->total).''.price($obj->total_ttc).''.price($obj->am).'
Reste à encaisser : '.price($total-$totalam).'
Total : ".price($total)."".price($total_ttc)."".price($totalam)."
Reste à encaisser : '.price($total_ttc-$totalam).' 

"; } $db->free();