diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index a495253a19c..46f01dcce67 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -22,10 +22,10 @@ */ /** - \file htdocs/compta/facture/imapyees.php - \ingroup facture - \brief Page de liste des factures imapyées - \version $Revision$ + \file htdocs/compta/facture/impayees.php + \ingroup facture + \brief Page de liste des factures clients impayées + \version $Revision$ */ require("./pre.inc.php"); @@ -36,7 +36,7 @@ $user->getrights('facture'); $user->getrights('banque'); if (!$user->rights->facture->lire) - accessforbidden(); +accessforbidden(); $langs->load("main"); // BUG De chargement de traduction ne pas modifier cette ligne $langs->load("bills"); @@ -48,8 +48,8 @@ if ($_GET["socid"]) { $socid=$_GET["socid"]; } // Sécurité accés client if ($user->societe_id > 0) { - $action = ''; - $socid = $user->societe_id; + $action = ''; + $socid = $user->societe_id; } @@ -69,182 +69,183 @@ if (! $sortorder) $sortorder="ASC"; if ($user->rights->facture->lire) { - $limit = $conf->liste_limit; - $offset = $limit * $page ; - - $sql = "SELECT s.nom,s.idp,f.facnumber,f.increment,f.total,f.total_ttc,"; - $sql.= $db->pdate("f.datef")." as df, ".$db->pdate("f.date_lim_reglement")." as datelimite, "; - $sql.= " f.paye as paye, f.rowid as facid, f.fk_statut"; - $sql.= " ,sum(pf.amount) as am"; - if (! $user->rights->commercial->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (! $user->rights->commercial->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= ",".MAIN_DB_PREFIX."facture as f"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid=pf.fk_facture "; - $sql.= " WHERE f.fk_soc = s.idp"; - $sql.= " AND f.paye = 0 AND f.fk_statut = 1"; - if (! $user->rights->commercial->client->voir && ! $socid) $sql .= " AND s.idp = sc.fk_soc AND sc.fk_user = " .$user->id; - if ($socid) $sql .= " AND s.idp = $socid"; + $limit = $conf->liste_limit; + $offset = $limit * $page ; - if ($_GET["filtre"]) - { - $filtrearr = split(",", $_GET["filtre"]); - foreach ($filtrearr as $fil) - { - $filt = split(":", $fil); - $sql .= " AND " . $filt[0] . " = " . $filt[1]; - } - } - - if ($_GET["search_ref"]) - { - $sql .= " AND f.facnumber like '%".$_GET["search_ref"]."%'"; - } - - if ($_GET["search_societe"]) - { - $sql .= " AND s.nom like '%".$_GET["search_societe"]."%'"; - } - - if ($_GET["search_montant_ht"]) - { - $sql .= " AND f.total = '".$_GET["search_montant_ht"]."'"; - } - - if ($_GET["search_montant_ttc"]) - { - $sql .= " AND f.total_ttc = '".$_GET["search_montant_ttc"]."'"; - } - - if (strlen($_POST["sf_ref"]) > 0) - { - $sql .= " AND f.facnumber like '%".$_POST["sf_ref"] . "%'"; - } - $sql.= " GROUP BY f.facnumber"; + $sql = "SELECT s.nom, s.idp,"; + $sql.= " f.facnumber,f.increment,f.total as total_ht,f.total_ttc,"; + $sql.= $db->pdate("f.datef")." as df, ".$db->pdate("f.date_lim_reglement")." as datelimite, "; + $sql.= " f.paye as paye, f.rowid as facid, f.fk_statut"; + $sql.= " ,sum(pf.amount) as am"; + if (! $user->rights->commercial->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + if (! $user->rights->commercial->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= ",".MAIN_DB_PREFIX."facture as f"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON f.rowid=pf.fk_facture "; + $sql.= " WHERE f.fk_soc = s.idp"; + $sql.= " AND f.paye = 0 AND f.fk_statut = 1"; + if (! $user->rights->commercial->client->voir && ! $socid) $sql .= " AND s.idp = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($socid) $sql .= " AND s.idp = ".$socid; - $sql.= " ORDER BY "; - $listfield=split(',',$sortfield); - foreach ($listfield as $key => $value) $sql.=$listfield[$key]." ".$sortorder.","; - $sql.= " f.facnumber DESC"; + if ($_GET["filtre"]) + { + $filtrearr = split(",", $_GET["filtre"]); + foreach ($filtrearr as $fil) + { + $filt = split(":", $fil); + $sql .= " AND " . $filt[0] . " = " . $filt[1]; + } + } - //$sql .= $db->plimit($limit+1,$offset); + if ($_GET["search_ref"]) + { + $sql .= " AND f.facnumber like '%".$_GET["search_ref"]."%'"; + } + + if ($_GET["search_societe"]) + { + $sql .= " AND s.nom like '%".$_GET["search_societe"]."%'"; + } + + if ($_GET["search_montant_ht"]) + { + $sql .= " AND f.total = '".$_GET["search_montant_ht"]."'"; + } + + if ($_GET["search_montant_ttc"]) + { + $sql .= " AND f.total_ttc = '".$_GET["search_montant_ttc"]."'"; + } + + if (strlen($_POST["sf_ref"]) > 0) + { + $sql .= " AND f.facnumber like '%".$_POST["sf_ref"] . "%'"; + } + $sql.= " GROUP BY f.facnumber"; + + $sql.= " ORDER BY "; + $listfield=split(',',$sortfield); + foreach ($listfield as $key => $value) $sql.=$listfield[$key]." ".$sortorder.","; + $sql.= " f.facnumber DESC"; + + //$sql .= $db->plimit($limit+1,$offset); + + $result = $db->query($sql); + + if ($result) + { + $num = $db->num_rows($result); + + if ($socid) + { + $soc = new Societe($db); + $soc->fetch($socid); + } + + $titre=($socid?$langs->trans("BillsCustomersUnpayedForCompany",$soc->nom):$langs->trans("BillsCustomersUnpayed")); + print_barre_liste($titre,$page,"impayees.php","&socid=$socid",$sortfield,$sortorder,'',$num); + $i = 0; + print ''; + print ''; + + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.facnumber","","&socid=$socid","",$sortfield); + print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","","&socid=$socid",'align="center"',$sortfield); + print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","","&socid=$socid",'align="center"',$sortfield); + print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid","",$sortfield); + print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","","&socid=$socid",'align="right"',$sortfield); + print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","","&socid=$socid",'align="right"',$sortfield); + print_liste_field_titre($langs->trans("Received"),$_SERVER["PHP_SELF"],"am","","&socid=$socid",'align="right"',$sortfield); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","","&socid=$socid",'align="right"',$sortfield); + print "\n"; + + // Lignes des champs de filtre + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + print ''; - $result = $db->query($sql); - if ($result) - { - $num = $db->num_rows($result); - - if ($socid) - { - $soc = new Societe($db); - $soc->fetch($socid); - } - - $titre=($socid?$langs->trans("BillsCustomersUnpayedForCompany",$soc->nom):$langs->trans("BillsCustomersUnpayed")); - print_barre_liste($titre,$page,"impayees.php","&socid=$socid",$sortfield,$sortorder,'',$num); - $i = 0; - print '
'; + print '  '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; - print ''; - - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.facnumber","","&socid=$socid","",$sortfield); - print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","","&socid=$socid",'align="center"',$sortfield); - print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","","&socid=$socid",'align="center"',$sortfield); - print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid","",$sortfield); - print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","","&socid=$socid",'align="right"',$sortfield); - print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","","&socid=$socid",'align="right"',$sortfield); - print_liste_field_titre($langs->trans("Received"),$_SERVER["PHP_SELF"],"am","","&socid=$socid",'align="right"',$sortfield); - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","","&socid=$socid",'align="right"',$sortfield); - print "\n"; - - // Lignes des champs de filtre - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - print ''; - - $facturestatic=new Facture($db); - - - if ($num > 0) - { - $var=True; - $total=0; - $totalrecu=0; - - while ($i < $num) - { - $objp = $db->fetch_object($result); - - $var=!$var; - - print ""; - $class = "impayee"; - - print '\n"; - print "\n"; - print "\n"; - print ''; + if ($num > 0) + { + $var=True; + $total_ht=0; + $total_ttc=0; + $total_payed=0; - print ""; - print ""; - print ""; + while ($i < $num) + { + $objp = $db->fetch_object($result); - // Affiche statut de la facture + $var=!$var; + + print ""; + $class = "impayee"; + + print '\n"; + + print "\n"; + print "\n"; + + print ''; + + print ""; + print ""; + print ""; + + // Affiche statut de la facture print ''; - print "\n"; - $total+=$objp->total; - $total_ttc+=$objp->total_ttc; - $totalrecu+=$objp->am; + print "\n"; + $total_ht+=$objp->total_ht; + $total_ttc+=$objp->total_ttc; + $total_payed+=$objp->am; - $i++; - } + $i++; + } - print ''; - print ""; - print ""; - print ""; - print ""; - print ''; - print "\n"; - } + print ''; + print ""; + print ""; + print ""; + print ""; + print ''; + print "\n"; + } - print "
'; - print '  '; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'.img_object($langs->trans("ShowBill"),"bill")." "; - print ''.$objp->facnumber.''.$objp->increment; - if ($objp->datelimite < (time() - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); - print "".dolibarr_print_date($objp->df)."".dolibarr_print_date($objp->datelimite)."'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,32).'".price($objp->total)."".price($objp->total_ttc)."".price($objp->am)."
'.img_object($langs->trans("ShowBill"),"bill")." "; + print ''.$objp->facnumber.''.$objp->increment; + if ($objp->datelimite < (time() - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); + print "".dolibarr_print_date($objp->df)."".dolibarr_print_date($objp->datelimite)."'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,32).'".price($objp->total_ht)."".price($objp->total_ttc)."".price($objp->am)."'; print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am); print '
".$langs->trans("Total").": ".price($total)."".price($total_ttc)."".price($totalrecu)." 
".$langs->trans("Total").": ".price($total_ht)."".price($total_ttc)."".price($total_payed)." 
"; - $db->free(); - } - else - { - dolibarr_print_error($db); - } + print ""; + $db->free(); + } + else + { + dolibarr_print_error($db); + } } - $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php new file mode 100644 index 00000000000..fc3805f6747 --- /dev/null +++ b/htdocs/fourn/facture/impayees.php @@ -0,0 +1,253 @@ + + * Copyright (C) 2004 Éric Seigne + * Copyright (C) 2004-2006 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/fourn/facture/impayees.php + \ingroup facture + \brief Page de liste des factures fournisseurs impayées + \version $Revision$ +*/ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"); +require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); + +$user->getrights('facture'); +$user->getrights('banque'); + +if (!$user->rights->facture->lire) +accessforbidden(); + +$langs->load("main"); // BUG De chargement de traduction ne pas modifier cette ligne +$langs->load("companies"); +$langs->load("bills"); + + + +if ($_GET["socid"]) { $socid=$_GET["socid"]; } + +// Sécurité accés client +if ($user->societe_id > 0) +{ + $action = ''; + $socid = $user->societe_id; +} + + +llxHeader('',$langs->trans("BillsSuppliersUnpayed")); + + +/*************************************************************************** +* * +* Mode Liste * +* * +***************************************************************************/ +$page = $_GET["page"]; +$sortfield=$_GET["sortfield"]; +$sortorder=$_GET["sortorder"]; +if (! $sortfield) $sortfield="f.date_lim_reglement"; +if (! $sortorder) $sortorder="ASC"; + +if ($user->rights->fournisseur->facture->lire) +{ + $limit = $conf->liste_limit; + $offset = $limit * $page ; + + $sql = "SELECT s.nom, s.idp,"; + $sql.= " f.facnumber,f.total_ht,f.total_ttc,"; + $sql.= $db->pdate("f.datef")." as df, ".$db->pdate("f.date_lim_reglement")." as datelimite, "; + $sql.= " f.paye as paye, f.rowid as facid, f.fk_statut"; + $sql.= " ,sum(pf.amount) as am"; + if (! $user->rights->commercial->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; + if (! $user->rights->commercial->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= ",".MAIN_DB_PREFIX."facture_fourn as f"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn "; + $sql.= " WHERE f.fk_soc = s.idp"; + $sql.= " AND f.paye = 0 AND f.fk_statut = 1"; + if (! $user->rights->commercial->client->voir && ! $socid) $sql .= " AND s.idp = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($socid) $sql .= " AND s.idp = ".$socid; + + if ($_GET["filtre"]) + { + $filtrearr = split(",", $_GET["filtre"]); + foreach ($filtrearr as $fil) + { + $filt = split(":", $fil); + $sql .= " AND " . $filt[0] . " = " . $filt[1]; + } + } + + if ($_GET["search_ref"]) + { + $sql .= " AND f.facnumber like '%".$_GET["search_ref"]."%'"; + } + + if ($_GET["search_societe"]) + { + $sql .= " AND s.nom like '%".$_GET["search_societe"]."%'"; + } + + if ($_GET["search_montant_ht"]) + { + $sql .= " AND f.total_ht = '".$_GET["search_montant_ht"]."'"; + } + + if ($_GET["search_montant_ttc"]) + { + $sql .= " AND f.total_ttc = '".$_GET["search_montant_ttc"]."'"; + } + + if (strlen($_POST["sf_ref"]) > 0) + { + $sql .= " AND f.facnumber like '%".$_POST["sf_ref"] . "%'"; + } + $sql.= " GROUP BY f.facnumber"; + + $sql.= " ORDER BY "; + $listfield=split(',',$sortfield); + foreach ($listfield as $key => $value) $sql.=$listfield[$key]." ".$sortorder.","; + $sql.= " f.facnumber DESC"; + + //$sql .= $db->plimit($limit+1,$offset); + + $result = $db->query($sql); + + if ($result) + { + $num = $db->num_rows($result); + + if ($socid) + { + $soc = new Societe($db); + $soc->fetch($socid); + } + + $titre=($socid?$langs->trans("BillsSuppliersUnpayedForCompany",$soc->nom):$langs->trans("BillsSuppliersUnpayed")); + print_barre_liste($titre,$page,"impayees.php","&socid=$socid",$sortfield,$sortorder,'',$num); + $i = 0; + print ''; + print ''; + + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.facnumber","","&socid=$socid","",$sortfield); + print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","","&socid=$socid",'align="center"',$sortfield); + print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","","&socid=$socid",'align="center"',$sortfield); + print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","&socid=$socid","",$sortfield); + print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total_ht","","&socid=$socid",'align="right"',$sortfield); + print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","","&socid=$socid",'align="right"',$sortfield); + print_liste_field_titre($langs->trans("AlreadyPayed"),$_SERVER["PHP_SELF"],"am","","&socid=$socid",'align="right"',$sortfield); + print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"fk_statut,paye,am","","&socid=$socid",'align="right"',$sortfield); + print "\n"; + + // Lignes des champs de filtre + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + print ''; + + + $facturestatic=new FactureFournisseur($db); + + + if ($num > 0) + { + $var=True; + $total_ht=0; + $total_ttc=0; + $total_payed=0; + + while ($i < $num) + { + $objp = $db->fetch_object($result); + + $var=!$var; + + print ""; + $class = "impayee"; + + print '\n"; + + print "\n"; + print "\n"; + + print ''; + + print ""; + print ""; + print ""; + + // Affiche statut de la facture + print ''; + + print "\n"; + $total_ht+=$objp->total_ht; + $total_ttc+=$objp->total_ttc; + $total_payed+=$objp->am; + + $i++; + } + + print ''; + print ""; + print ""; + print ""; + print ""; + print ''; + print "\n"; + } + + print "
'; + print '  '; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'.img_object($langs->trans("ShowBill"),"bill")." "; + print ''.$objp->facnumber.''; + if ($objp->datelimite < (time() - $conf->facture->fournisseur->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); + print "".dolibarr_print_date($objp->df)."".dolibarr_print_date($objp->datelimite)."'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,32).'".price($objp->total_ht)."".price($objp->total_ttc)."".price($objp->am)."'; + print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am); + print '
".$langs->trans("Total").": ".price($total_ht)."".price($total_ttc)."".price($total_payed)." 
"; + $db->free(); + } + else + { + dolibarr_print_error($db); + } + +} + + + + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index ec829716a94..69db9c3b054 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -53,7 +53,7 @@ $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="DESC"; -if (! $sortfield) $sortfield="fac.date_lim_reglement"; +if (! $sortfield) $sortfield="fac.datef"; /* @@ -89,12 +89,13 @@ if ($_POST["mode"] == 'search') llxHeader(); -$sql = "SELECT s.idp as socid, s.nom, ".$db->pdate("fac.date_lim_reglement")." as date_echeance, fac.total_ht"; -$sql .= ", fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_statut, fac.libelle, fac.rowid as facid, fac.facnumber"; +$sql = "SELECT s.idp as socid, s.nom, "; +$sql.= " ".$db->pdate("fac.datef")." as datef, ".$db->pdate("fac.date_lim_reglement")." as date_echeance,"; +$sql.= " fac.total_ht, fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_statut, fac.libelle, fac.rowid as facid, fac.facnumber"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; -$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as fac"; +$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as fac"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql .= " WHERE fac.fk_soc = s.idp"; +$sql.= " WHERE fac.fk_soc = s.idp"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.idp = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) { @@ -154,7 +155,7 @@ if ($resql) print ''; print ''; print_liste_field_titre($langs->trans("Ref"),"index.php","facnumber","&socid=$socid","","",$sortfield); - print_liste_field_titre($langs->trans("DateEcheance"),"index.php","fac.date_lim_reglement","&socid=$socid","","",$sortfield); + print_liste_field_titre($langs->trans("Date"),"index.php","fac.datef","&socid=$socid","",'align="center"',$sortfield); print_liste_field_titre($langs->trans("Label"),"index.php","fac.libelle","&socid=$socid","","",$sortfield); print_liste_field_titre($langs->trans("Company"),"index.php","s.nom","&socid=$socid","","",$sortfield); print_liste_field_titre($langs->trans("AmountHT"),"index.php","fac.total_ht","&socid=$socid","",'align="right"',$sortfield); @@ -194,10 +195,10 @@ if ($resql) $var=!$var; print ""; - print '\n"; - print ''; + print "\n"; + print ''; print ''; print '
'.img_object($langs->trans("ShowBill"),"bill").' '.dolibarr_trunc($obj->facnumber,12)."'.dolibarr_print_date($obj->date_echeance); + print ''.img_object($langs->trans("ShowBill"),"bill").' '.dolibarr_trunc($obj->facnumber,12).""; if (($obj->paye == 0) && ($obj->fk_statut > 0) && $obj->date_echeance < (time() - $conf->facture->fournisseur->warning_delay)) print img_picto($langs->trans("Late"),"warning"); - print ''.dolibarr_print_date($obj->datef).''.dolibarr_trunc($obj->libelle,36).''; print ''.img_object($langs->trans("ShowSupplier"),"company").' '.$obj->nom.''; diff --git a/htdocs/fourn/facture/pre.inc.php b/htdocs/fourn/facture/pre.inc.php index a245fcab503..aae7d992a88 100644 --- a/htdocs/fourn/facture/pre.inc.php +++ b/htdocs/fourn/facture/pre.inc.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 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 @@ -18,13 +18,12 @@ * * $Id$ * $Source$ - * */ /** - \file htdocs/fourn/facture/pre.inc.php - \ingroup fournisseur,facture - \brief Fichier gestionnaire du menu factures fournisseurs + \file htdocs/fourn/facture/pre.inc.php + \ingroup fournisseur,facture + \brief Fichier gestionnaire du menu factures fournisseurs */ require("../../main.inc.php"); @@ -32,78 +31,75 @@ require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.class.php"; require_once DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php"; $user->getrights('fournisseur'); -function llxHeader($head = "", $title = "", $addons='') { - global $user, $conf, $langs; +function llxHeader($head = "", $title = "", $addons='') +{ + global $user, $conf, $langs; - $langs->load("suppliers"); - $langs->load("propal"); + $langs->load("suppliers"); + $langs->load("propal"); - top_menu($head, $title); + top_menu($head, $title); - $menu = new Menu(); + $menu = new Menu(); - if (is_array($addons)) - { - //$menu->add($url, $libelle); + if (is_array($addons)) + { + //$menu->add($url, $libelle); - $menu->add($addons[0][0], $addons[0][1]); - } + $menu->add($addons[0][0], $addons[0][1]); + } - if ($conf->fournisseur->enabled) - { - if ($user->rights->societe->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); - } + if ($conf->fournisseur->enabled) + { + if ($user->rights->societe->lire) + { + $menu->add(DOL_URL_ROOT."/fourn/index.php", $langs->trans("Suppliers")); + } - // Sécurité accés client - if ($user->societe_id == 0 && $user->rights->societe->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&type=f",$langs->trans("NewSupplier")); - } - } + // Sécurité accés client + if ($user->societe_id == 0 && $user->rights->societe->creer) + { + $menu->add_submenu(DOL_URL_ROOT."/soc.php?action=create&type=f",$langs->trans("NewSupplier")); + } + } - if ($conf->societe->enabled) - { - if ($user->rights->societe->lire) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts")); - } - } - - - $langs->load("bills"); - if ($user->rights->fournisseur->facture->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills")); - } - - - if ($user->rights->fournisseur->facture->creer) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill")); - } - if ($user->rights->fournisseur->facture->lire) - { - $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments")); - } - - - $langs->load("orders"); - if ($user->rights->fournisseur->commande->lire) - { - $menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders")); - } + if ($conf->societe->enabled) + { + if ($user->rights->societe->lire) + { + $menu->add_submenu(DOL_URL_ROOT."/fourn/contact.php",$langs->trans("Contacts")); + } + } - if ($conf->produit->enabled || $conf->service->enabled) - { - $menu->add(DOL_URL_ROOT."/product/liste.php?type=0", $langs->trans("Products")); - } - - left_menu($menu->liste); + $langs->load("bills"); + if ($user->rights->fournisseur->facture->creer) + { + $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill")); + } + if ($user->rights->fournisseur->facture->lire) + { + $menu->add(DOL_URL_ROOT."/fourn/facture/index.php", $langs->trans("Bills")); + $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/impayees.php",$langs->trans("Unpayed")); + $menu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments")); + } + + + $langs->load("orders"); + if ($user->rights->fournisseur->commande->lire) + { + $menu->add(DOL_URL_ROOT."/fourn/commande/",$langs->trans("Orders")); + } + + $langs->load("products"); + if ($conf->produit->enabled || $conf->service->enabled) + { + $menu->add(DOL_URL_ROOT."/product/liste.php?type=0", $langs->trans("Products")); + } + + left_menu($menu->liste); } diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index 869aff12994..440b64b88b8 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -291,6 +291,7 @@ class MenuLeft { { if ($leftmenu=="suppliers_bills") $newmenu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),2,$user->rights->fournisseur->facture->creer); } + if ($leftmenu=="suppliers_bills") $newmenu->add_submenu(DOL_URL_ROOT."/fourn/facture/impayees.php", $langs->trans("Unpayed"),2,$user->rights->fournisseur->facture->lire); if ($leftmenu=="suppliers_bills") $newmenu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments"),2,$user->rights->fournisseur->facture->lire); } } diff --git a/htdocs/includes/menus/barre_left/eldy_frontoffice.php b/htdocs/includes/menus/barre_left/eldy_frontoffice.php index 2b65c945ac8..6d7456ae5ab 100644 --- a/htdocs/includes/menus/barre_left/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_frontoffice.php @@ -293,6 +293,7 @@ class MenuLeft { { if ($leftmenu=="suppliers_bills") $newmenu->add_submenu(DOL_URL_ROOT."/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),2,$user->rights->fournisseur->facture->creer); } + if ($leftmenu=="suppliers_bills") $newmenu->add_submenu(DOL_URL_ROOT."/fourn/facture/impayees.php", $langs->trans("Unpayed"),2,$user->rights->fournisseur->facture->lire); if ($leftmenu=="suppliers_bills") $newmenu->add_submenu(DOL_URL_ROOT."/fourn/facture/paiement.php", $langs->trans("Payments"),2,$user->rights->fournisseur->facture->lire); } }