From 958de03248efc5c3509a0aca8d8ba2b2f5c29570 Mon Sep 17 00:00:00 2001 From: marc_ocebo Date: Fri, 29 Apr 2005 00:56:44 +0000 Subject: [PATCH] =?UTF-8?q?ordonnancement=20des=20factures=20impay=E9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/index.php | 901 ++++++++++++++++++++-------------------- 1 file changed, 451 insertions(+), 450 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index a1e9c3a3440..0429fd13d60 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -1,454 +1,455 @@ - - * Copyright (C) 2004-2005 Laurent Destailleur - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * - */ - -/** - \file htdocs/compta/index.php - \ingroup compta - \brief Page accueil zone comptabilité - \version $Revision$ -*/ - -require("./pre.inc.php"); - -$user->getrights(); // On a besoin des permissions sur plusieurs modules - -$langs->load("compta"); -$langs->load("bills"); - -/* - * Sécurité accés client - */ -if ($user->societe_id > 0) -{ - $action = ''; - $socidp = $user->societe_id; -} - -llxHeader("","Accueil Compta"); - -/* - * Actions - */ - -if ($_GET["action"] == 'add_bookmark') -{ - $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE fk_soc = ".$socidp." AND fk_user=".$user->id; - if (! $db->query($sql) ) - { - dolibarr_print_error($db); - } - $sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES ($socidp, now(),".$user->id.");"; - if (! $db->query($sql) ) - { - dolibarr_print_error($db); - } -} - -if ($_GET["action"] == 'del_bookmark') -{ - $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=".$_GET["bid"]; - $result = $db->query($sql); -} - - - -/* - * Affichage page - * - */ -print_titre($langs->trans("AccountancyTreasuryArea")); - + + * Copyright (C) 2004-2005 Laurent Destailleur + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ + +/** + \file htdocs/compta/index.php + \ingroup compta + \brief Page accueil zone comptabilité + \version $Revision$ +*/ + +require("./pre.inc.php"); + +$user->getrights(); // On a besoin des permissions sur plusieurs modules + +$langs->load("compta"); +$langs->load("bills"); + +/* + * Sécurité accés client + */ +if ($user->societe_id > 0) +{ + $action = ''; + $socidp = $user->societe_id; +} + +llxHeader("","Accueil Compta"); + +/* + * Actions + */ + +if ($_GET["action"] == 'add_bookmark') +{ + $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE fk_soc = ".$socidp." AND fk_user=".$user->id; + if (! $db->query($sql) ) + { + dolibarr_print_error($db); + } + $sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES ($socidp, now(),".$user->id.");"; + if (! $db->query($sql) ) + { + dolibarr_print_error($db); + } +} + +if ($_GET["action"] == 'del_bookmark') +{ + $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=".$_GET["bid"]; + $result = $db->query($sql); +} + + + +/* + * Affichage page + * + */ +print_titre($langs->trans("AccountancyTreasuryArea")); + print ''; print ''; - -print '
'; -/* - * Zone recherche facture - */ -if ($conf->facture->anabled) { - print '
'; - print ''; - print ""; - print ''; - print "'; - print "
'.$langs->trans("SearchABill").'
"; - print $langs->trans("Ref").':  

"; -} - - -/* - * Factures brouillons - */ -if ($conf->facture->enabled && $user->rights->facture->lire) -{ - - $sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp"; - $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; - $sql .= " WHERE s.idp = f.fk_soc AND f.fk_statut = 0"; - - if ($socidp) - { - $sql .= " AND f.fk_soc = $socidp"; - } - - $resql = $db->query($sql); - - if ( $resql ) - { - $num = $db->num_rows($resql); - $i = 0; - - if ($num) - { - print ''; - print ''; - print ''; - $var = True; - while ($i < $num && $i < 20) - { - $obj = $db->fetch_object($resql); - $var=!$var; - print ''; - print ''; - $i++; - } - - print "
'.$langs->trans("DraftBills").' ('.$num.')
'.img_object($langs->trans("ShowBill"),"bill").' '.$obj->facnumber.''.img_object($langs->trans("Showcompany"),"company").' '.$obj->nom.'

"; - } - $db->free($resql); - } - else - { - dolibarr_print_error($db); - } -} - -if ($conf->compta->enabled) { - -/* - * Charges a payer - */ -if ($user->societe_id == 0) -{ - - $sql = "SELECT c.amount, cc.libelle"; - $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as c, ".MAIN_DB_PREFIX."c_chargesociales as cc"; - $sql .= " WHERE c.fk_type = cc.id AND c.paye=0"; - - $resql = $db->query($sql); - - if ( $resql ) - { - $num = $db->num_rows($resql); - if ($num) - { - print ''; - print ''; - print ''; - $i = 0; - $var = True; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $var = !$var; - print ""; - print ''; - print ''; - print ''; - $i++; - } - print '
Charges à payer ('.$num.')
'.$obj->libelle.''.price($obj->amount).'

'; - } - $db->free($resql); - } - else - { - dolibarr_print_error($db); - } -} - -} - - -/* - * Bookmark - */ -$sql = "SELECT s.idp, s.nom,b.rowid as bid"; -$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."bookmark as b"; -$sql .= " WHERE b.fk_soc = s.idp AND b.fk_user = ".$user->id; -$sql .= " ORDER BY lower(s.nom) ASC"; - -$resql = $db->query($sql); - -if ( $resql ) -{ - $num = $db->num_rows($resql); - $i = 0; - if ($num) - { - print ''; - print "\n"; - $var = True; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $var = !$var; - print ""; - print ''; - print ''; - print ''; - $i++; - } - print '
".$langs->trans("Bookmarks")."
'.$obj->nom.''.img_delete().'
'; - } - $db->free($resql); -} -else -{ - dolibarr_print_error($db); -} -print '
'; - - -/* - * Commandes à facturer - */ -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"; - $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); - - if ( $resql ) - { - $num = $db->num_rows($resql); - if ($num) - { - $i = 0; - print ''; - print ""; - print ''; - print ''; - print ''; - print ''; - print ''; - $var = True; - $tot_ht=0; - $tot_ttc=0; - while ($i < $num) - { - $var=!$var; - $obj = $db->fetch_object($resql); - print ""; - print "'; - - print ''; - print ''; - print ''; - print ''; - $tot_ht += $obj->total_ht; - $tot_ttc += $obj->total_ttc; - $tot_tobill += ($obj->total_ttc-$obj->tot_fttc); - $i++; - } - $var=!$var; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'.$langs->trans("OrdersToBill").' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("ToBill").'
rowid\">".img_object($langs->trans("ShowOrder"),"order").' '; - print "rowid\">".$obj->ref.''.img_object($langs->trans("ShowCompany"),"company").' '; - print ''.$obj->nom.''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->total_ttc-$obj->tot_fttc).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')'.price($tot_ht).''.price($tot_ttc).''.price($tot_tobill).'

'; - } - $db->free($resql); - } - else - { - dolibarr_print_error($db); - } -} - - -if ($conf->facture->enabled && $user->rights->facture->lire) -{ - - /* - * Factures impayées - * - */ - - $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) - { - $sql .= " AND f.fk_soc = $socidp"; - } - $sql .= " GROUP BY f.facnumber, f.rowid, s.nom, s.idp, f.total, f.total_ttc"; - - $resql = $db->query($sql); - - if ( $resql ) - { - $num = $db->num_rows($resql); - $i = 0; - - if ($num) - { - print ''; - print ''; - print ''; - $var = True; - $total_ttc = $totalam = $total = 0; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - - if ($i < $conf->liste_limit) - { - $var=!$var; - print ''; - print ''; - print ''; - print ''; - print ''; - } - $total_ttc += $obj->total_ttc; - $total += $obj->total; - $totalam += $obj->am; - $i++; - } - $var=!$var; - - print '"; - - print "
'.$langs->trans("BillsCustomersUnpayed").' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Received").'
'.img_object($langs->trans("ShowBill"),"bill").' '.$obj->facnumber.''.img_object($langs->trans("ShowCustomer"),"company").' '.$obj->nom.''.price($obj->total).''.price($obj->total_ttc).''.price($obj->am).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')'.price($total)."".price($total_ttc)."".price($totalam)."

"; - } - $db->free($resql); - } - else - { - dolibarr_print_error($db); - } -} - - -// \todo Mettre ici recup des actions en rapport avec la compta -$resql = 0; -if ($resql) -{ - print ''; - print ''; - print "\n"; - $var = True; - $i = 0; - while ($i < $db->num_rows($resql) ) - { - $obj = $db->fetch_object($resql); - $var=!$var; - - print ""; - $i++; - } - $db->free($resql); - print "
'.$langs->trans("TasksToDo").'
".strftime("%d %b %Y",$obj->da)."$obj->libelle $obj->label

"; -} - - -/* - * Factures a payer - */ -if ($conf->facture->enabled) { - - if ($user->societe_id == 0) - { - $sql = "SELECT ff.rowid, ff.facnumber, ff.libelle, ff.total_ht, ff.total_ttc, s.nom, s.idp"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; - $sql .= " WHERE s.idp = ff.fk_soc"; - $sql .= " AND ff.paye=0"; - - $result=$db->query($sql); - if ($result) - { - $num = $db->num_rows(); - if ($num) - { - print ''; - print ''; - print ''; - print ''; - print "\n"; - $i = 0; - $var = True; - $total = $total_ttc = $totalam = 0; - while ($i < $num) - { - $obj = $db->fetch_object($result); - $var = !$var; - print ''; - print ''; - print ''; - print ''; - print ''; - $total += $obj->total_ht; - $total_ttc += $obj->total_ttc; - $totalam += $obj->am; - $i++; - } - $var=!$var; - print ''; - print ''; - print '
'.$langs->trans("BillsSuppliersUnpayed").' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").'
'.img_object($langs->trans("ShowBill"),"bill").' '.$obj->facnumber.''.img_object($langs->trans("ShowSupplier"),"company").' '.$obj->nom.''.price($obj->total_ht).''.price($obj->total_ttc).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')'.price($total).''.price($total_ttc).'

'; - } - } - else - { - dolibarr_print_error($db); - } - } - -} - - -print '
'; - -$db->close(); - -llxFooter("Dernière modification $Date$ révision $Revision$"); -?> +/* + * Zone recherche facture + */ +if ($conf->facture->enabled) { + print '
'; + print ''; + print ""; + print ''; + print "'; + print "
'.$langs->trans("SearchABill").'
"; + print $langs->trans("Ref").':  

"; +} + + +/* + * Factures brouillons + */ +if ($conf->facture->enabled && $user->rights->facture->lire) +{ + + $sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; + $sql .= " WHERE s.idp = f.fk_soc AND f.fk_statut = 0"; + + if ($socidp) + { + $sql .= " AND f.fk_soc = $socidp"; + } + + $resql = $db->query($sql); + + if ( $resql ) + { + $num = $db->num_rows($resql); + $i = 0; + + if ($num) + { + print ''; + print ''; + print ''; + $var = True; + while ($i < $num && $i < 20) + { + $obj = $db->fetch_object($resql); + $var=!$var; + print ''; + print ''; + $i++; + } + + print "
'.$langs->trans("DraftBills").' ('.$num.')
'.img_object($langs->trans("ShowBill"),"bill").' '.$obj->facnumber.''.img_object($langs->trans("Showcompany"),"company").' '.$obj->nom.'

"; + } + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } +} + +if ($conf->compta->enabled) { + +/* + * Charges a payer + */ +if ($user->societe_id == 0) +{ + + $sql = "SELECT c.amount, cc.libelle"; + $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as c, ".MAIN_DB_PREFIX."c_chargesociales as cc"; + $sql .= " WHERE c.fk_type = cc.id AND c.paye=0"; + + $resql = $db->query($sql); + + if ( $resql ) + { + $num = $db->num_rows($resql); + if ($num) + { + print ''; + print ''; + print ''; + $i = 0; + $var = True; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $var = !$var; + print ""; + print ''; + print ''; + print ''; + $i++; + } + print '
Charges à payer ('.$num.')
'.$obj->libelle.''.price($obj->amount).'

'; + } + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } +} + +} + + +/* + * Bookmark + */ +$sql = "SELECT s.idp, s.nom,b.rowid as bid"; +$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."bookmark as b"; +$sql .= " WHERE b.fk_soc = s.idp AND b.fk_user = ".$user->id; +$sql .= " ORDER BY lower(s.nom) ASC"; + +$resql = $db->query($sql); + +if ( $resql ) +{ + $num = $db->num_rows($resql); + $i = 0; + if ($num) + { + print ''; + print "\n"; + $var = True; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $var = !$var; + print ""; + print ''; + print ''; + print ''; + $i++; + } + print '
".$langs->trans("Bookmarks")."
'.$obj->nom.''.img_delete().'
'; + } + $db->free($resql); +} +else +{ + dolibarr_print_error($db); +} +print ''; + + +/* + * Commandes à facturer + */ +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"; + $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); + + if ( $resql ) + { + $num = $db->num_rows($resql); + if ($num) + { + $i = 0; + print ''; + print ""; + print ''; + print ''; + print ''; + print ''; + print ''; + $var = True; + $tot_ht=0; + $tot_ttc=0; + while ($i < $num) + { + $var=!$var; + $obj = $db->fetch_object($resql); + print ""; + print "'; + + print ''; + print ''; + print ''; + print ''; + $tot_ht += $obj->total_ht; + $tot_ttc += $obj->total_ttc; + $tot_tobill += ($obj->total_ttc-$obj->tot_fttc); + $i++; + } + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans("OrdersToBill").' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("ToBill").'
rowid\">".img_object($langs->trans("ShowOrder"),"order").' '; + print "rowid\">".$obj->ref.''.img_object($langs->trans("ShowCompany"),"company").' '; + print ''.$obj->nom.''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->total_ttc-$obj->tot_fttc).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')'.price($tot_ht).''.price($tot_ttc).''.price($tot_tobill).'

'; + } + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } +} + + +if ($conf->facture->enabled && $user->rights->facture->lire) +{ + + /* + * Factures impayées + * + */ + + $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) + { + $sql .= " AND f.fk_soc = $socidp"; + } + $sql .= " GROUP BY f.facnumber, f.rowid, s.nom, s.idp, f.total, f.total_ttc"; + $sql .= " ORDER BY f.datef ASC "; + + $resql = $db->query($sql); + + if ( $resql ) + { + $num = $db->num_rows($resql); + $i = 0; + + if ($num) + { + print ''; + print ''; + print ''; + $var = True; + $total_ttc = $totalam = $total = 0; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + + if ($i < $conf->liste_limit) + { + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; + } + $total_ttc += $obj->total_ttc; + $total += $obj->total; + $totalam += $obj->am; + $i++; + } + $var=!$var; + + print '"; + + print "
'.$langs->trans("BillsCustomersUnpayed").' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Received").'
'.img_object($langs->trans("ShowBill"),"bill").' '.$obj->facnumber.''.img_object($langs->trans("ShowCustomer"),"company").' '.$obj->nom.''.price($obj->total).''.price($obj->total_ttc).''.price($obj->am).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')'.price($total)."".price($total_ttc)."".price($totalam)."

"; + } + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } +} + + +// \todo Mettre ici recup des actions en rapport avec la compta +$resql = 0; +if ($resql) +{ + print ''; + print ''; + print "\n"; + $var = True; + $i = 0; + while ($i < $db->num_rows($resql) ) + { + $obj = $db->fetch_object($resql); + $var=!$var; + + print ""; + $i++; + } + $db->free($resql); + print "
'.$langs->trans("TasksToDo").'
".strftime("%d %b %Y",$obj->da)."$obj->libelle $obj->label

"; +} + + +/* + * Factures a payer + */ +if ($conf->facture->enabled) { + + if ($user->societe_id == 0) + { + $sql = "SELECT ff.rowid, ff.facnumber, ff.libelle, ff.total_ht, ff.total_ttc, s.nom, s.idp"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; + $sql .= " WHERE s.idp = ff.fk_soc"; + $sql .= " AND ff.paye=0"; + + $result=$db->query($sql); + if ($result) + { + $num = $db->num_rows(); + if ($num) + { + print ''; + print ''; + print ''; + print ''; + print "\n"; + $i = 0; + $var = True; + $total = $total_ttc = $totalam = 0; + while ($i < $num) + { + $obj = $db->fetch_object($result); + $var = !$var; + print ''; + print ''; + print ''; + print ''; + print ''; + $total += $obj->total_ht; + $total_ttc += $obj->total_ttc; + $totalam += $obj->am; + $i++; + } + $var=!$var; + print ''; + print ''; + print '
'.$langs->trans("BillsSuppliersUnpayed").' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").'
'.img_object($langs->trans("ShowBill"),"bill").' '.$obj->facnumber.''.img_object($langs->trans("ShowSupplier"),"company").' '.$obj->nom.''.price($obj->total_ht).''.price($obj->total_ttc).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')'.price($total).''.price($total_ttc).'

'; + } + } + else + { + dolibarr_print_error($db); + } + } + +} + + +print ''; + +print ''; + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?>