diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index 83b0bcc5dbb..451946fea99 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -45,7 +45,6 @@ if ($user->societe_id > 0)
llxHeader("","Accueil Compta");
-
/*
* Actions
*/
@@ -235,19 +234,19 @@ print '
';
if ($conf->commande->enabled && $user->rights->commande->lire)
{
$langs->load("orders");
-
- $sql = "SELECT sum(f.total) as tot_fht,sum(f.total_ttc) as tot_fttc, p.rowid, p.ref, s.nom, s.idp, p.total_ht, p.total_ttc
- FROM ".MAIN_DB_PREFIX."commande AS p, llx_societe AS s
- LEFT JOIN ".MAIN_DB_PREFIX."co_fa AS co_fa ON co_fa.fk_commande = p.rowid
- LEFT JOIN ".MAIN_DB_PREFIX."facture AS f ON co_fa.fk_facture = f.rowid
- WHERE p.fk_soc = s.idp
- AND p.fk_statut >=1
- AND p.facture =0
- GROUP BY p.rowid";
+
+ $sql = "SELECT sum(f.total) as tot_fht,sum(f.total_ttc) as tot_fttc";
+ $sql .= " ,s.nom, s.idp, p.rowid, p.ref, p.total_ht, p.total_ttc";
+ $sql .= " FROM ".MAIN_DB_PREFIX."commande AS p, llx_societe AS s";
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."co_fa AS co_fa ON co_fa.fk_commande = p.rowid";
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture AS f ON co_fa.fk_facture = f.rowid";
+ $sql .= " WHERE p.fk_soc = s.idp";
if ($socidp)
{
$sql .= " AND p.fk_soc = $socidp";
}
+ $sql .= " AND p.fk_statut >=1 AND p.facture =0";
+ $sql .= " GROUP BY p.rowid";
$resql = $db->query($sql);
@@ -260,7 +259,7 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
print '';
print "";
print '| '.$langs->trans("OrdersToBill").' ('.$num.') | ';
- print ''.$langs->trans("AmountHT").' | '.$langs->trans("AmountTTC").' | | ';
+ print ''.$langs->trans("AmountHT").' | '.$langs->trans("AmountTTC").' | ';
$var = True;
$tot_ht=0;
$tot_ttc=0;
@@ -330,7 +329,7 @@ if ($conf->facture->enabled)
{
$obj = $db->fetch_object($resql);
- if ($i < 20)
+ if ($i < 10)
{
$var=!$var;
print '| '.img_object($langs->trans("ShowBill"),"bill").' '.$obj->facnumber.' | ';
@@ -345,7 +344,9 @@ if ($conf->facture->enabled)
$i++;
}
$var=!$var;
+
print ' | '.$langs->trans("Total").' ('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).') | '.price($total)." | ".price($total_ttc)." | ".price($totalam)." | ";
+
print " ";
}
$db->free($resql);
|