diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php
index fbb98def8e6..4d04e031b0f 100644
--- a/htdocs/compta/fiche.php
+++ b/htdocs/compta/fiche.php
@@ -242,7 +242,7 @@ if ($socid > 0)
print "";
- print '
| Code compta | '.$societe->code_compta.' | ';
+ print '
| '.$langs->trans("AccountancyCode").' | '.$societe->code_compta.' | ';
print ''.$langs->trans("CustomerCode").' | ';
print $societe->code_client;
print " |
";
@@ -266,15 +266,17 @@ if ($socid > 0)
{
print '';
- $sql = "SELECT s.nom, s.idp, f.facnumber, f.amount, ".$db->pdate("f.datef")." as df, f.paye as paye, f.fk_statut as statut, f.rowid as facid ";
+ $sql = "SELECT s.nom, s.idp, f.facnumber, f.amount, f.total, f.total_ttc, ".$db->pdate("f.datef")." as df, f.paye as paye, f.fk_statut as statut, f.rowid as facid ";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql .= " WHERE f.fk_soc = s.idp AND s.idp = ".$societe->id;
$sql .= " ORDER BY f.datef DESC";
- if ( $db->query($sql) )
+ $resql=$db->query($sql);
+ if ($resql)
{
$var=true;
- $num = $db->num_rows(); $i = 0;
+ $num = $db->num_rows($resql);
+ $i = 0;
if ($num > 0)
{
print '';
@@ -284,7 +286,7 @@ if ($socid > 0)
while ($i < $num && $i < $MAXLIST)
{
- $objp = $db->fetch_object();
+ $objp = $db->fetch_object($resql);
$var=!$var;
print "
";
print "| facid\">".img_object($langs->trans("ShowBill"),"bill")." ".$objp->facnumber." | \n";
@@ -296,7 +298,7 @@ if ($socid > 0)
{
print "!!! | \n";
}
- print "".number_format($objp->amount, 2, ',', ' ')." | \n";
+ print "".price($objp->total_ttc)." | \n";
$fac = new Facture($db);
print "".($fac->LibStatut($objp->paye,$objp->statut))." | \n";