diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 1c0bb2bbfc2..4bb874dcccf 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -27,6 +27,17 @@ require_once("../../facture.class.php"); $mesg = ''; +if ($page == -1) +{ +$page = 0 ; +} +$limit = $conf->liste_limit; +$offset = $limit * $page ; + +if (! $sortorder) $sortorder="DESC"; +if (! $sortfield) $sortfield="f.datef"; + + if ($user->societe_id > 0) { $action = ''; @@ -74,24 +85,9 @@ if ($_GET["id"]) print ''.$langs->trans("CurrentPrice").''.price($product->price).''; print ""; - if ($page == -1) - { - $page = 0 ; - } - $limit = $conf->liste_limit; - $offset = $limit * $page ; - - if ($sortorder == "") - { - $sortorder="DESC"; - } - if ($sortfield == "") - { - $sortfield="f.datef"; - } - + print "
"; - print_barre_liste("Factures",$page,"facture.php","&id=$product->id",$sortfield,$sortorder); + print_barre_liste($langs->trans("Bills"),$page,"facture.php","&id=$product->id",$sortfield,$sortorder); $sql = "SELECT distinct(f.rowid), s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,f.paye,f.fk_statut as statut,f.rowid as facid"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as d WHERE f.fk_soc = s.idp"; @@ -115,7 +111,7 @@ if ($_GET["id"]) print_liste_field_titre($langs->trans("Company"),"facture.php","s.nom","","&id=".$_GET["id"],'',$sortfield); print_liste_field_titre($langs->trans("Date"),"facture.php","f.datef","","&id=".$_GET["id"],'align="right"',$sortfield); print_liste_field_titre($langs->trans("Amount"),"facture.php","f.amount","","&id=".$_GET["id"],'align="right"',$sortfield); - print ' '; + print_liste_field_titre($langs->trans("Status"),"facture.php","f.paye,f.fk_statut","","&id=".$_GET["id"],'align="center"',$sortfield); print "\n"; if ($num > 0) @@ -127,17 +123,10 @@ if ($_GET["id"]) $var=!$var; print ""; - print ''; - if ($objp->paye) - { - print $objp->facnumber; - } - else - { - print ''.$objp->facnumber.''; - } + print ''.img_object($langs->trans("ShowBill"),"bill").' '; + print $objp->facnumber; print "\n"; - print ''.$objp->nom.''; + print ''.img_object($langs->trans("ShowCompany"),"company").' '.$objp->nom.''; if ($objp->df > 0 ) {