diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 4132dda2bdf..dccad572a62 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -235,7 +235,6 @@ if ($user->comm > 0 && $conf->commercial ) */ $sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp, f.total_ttc, sum(pf.amount) as am"; -//$sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s "; $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"; $sql .= " GROUP BY f.facnumber"; @@ -305,7 +304,7 @@ else */ if ($user->societe_id == 0) { - $sql = "SELECT ff.rowid, ff.facnumber, ff.libelle, ff.total_ttc as amount"; + $sql = "SELECT ff.rowid, ff.facnumber, ff.libelle, ff.total_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql .= " WHERE ff.paye=0"; @@ -327,7 +326,7 @@ if ($user->societe_id == 0) print ''.img_file().''; print ' '.$obj->facnumber.''; print ''.$obj->libelle.''; - print ''.price($obj->amount).''; + print ''.price($obj->total_ttc).''; print ''; $total += $obj->total_ttc; $totalam += $obj->am;