| '.$langs->trans("Ref").' | ';
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index a8fceb2a998..56b8f78762f 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -127,7 +127,7 @@ if ($object->id > 0)
print '';
- $linkback = ''.$langs->trans("BackToList").'';
+ $linkback = ''.$langs->trans("BackToList").'';
// Ref
print '| '.$langs->trans("Ref").' | ';
diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index 7789d673b1e..5f717cce3d3 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -1404,7 +1404,7 @@ else
*/
print '';
- $linkback = ''.$langs->trans("BackToList").'';
+ $linkback = ''.$langs->trans("BackToList").'';
// Ref
print '| '.$langs->trans("Ref").' | ';
@@ -1419,7 +1419,7 @@ else
// Third party
print ' | | '.$langs->trans('Supplier').' | '.$societe->getNomUrl(1);
- print ' ('.$langs->trans('OtherBills').') | ';
+ print ' ('.$langs->trans('OtherBills').')';
print ' ';
// Type
diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php
index 540cbebea12..7db0dd9ebf9 100644
--- a/htdocs/fourn/facture/index.php
+++ b/htdocs/fourn/facture/index.php
@@ -1,306 +1 @@
-
- * Copyright (C) 2004-2013 Laurent Destailleur
- * Copyright (C) 2005-2013 Regis Houssin
- * Copyright (C) 2013 Philippe Grand
- *
- * 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 3 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, see .
- */
-
-/**
- * \file htdocs/fourn/facture/index.php
- * \ingroup fournisseur,facture
- * \brief List of suppliers invoices
- */
-
-require '../../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
-require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
-
-if (!$user->rights->fournisseur->facture->lire) accessforbidden();
-
-$langs->load("companies");
-$langs->load("bills");
-
-$socid = GETPOST('socid','int');
-
-// Security check
-if ($user->societe_id > 0)
-{
- $action='';
- $_GET["action"] = '';
- $socid = $user->societe_id;
-}
-
-$mode=GETPOST("mode");
-$modesearch=GETPOST("mode_search");
-
-$page=GETPOST("page",'int');
-$sortorder = GETPOST("sortorder",'alpha');
-$sortfield = GETPOST("sortfield",'alpha');
-
-if ($page == -1) { $page = 0 ; }
-$limit = $conf->liste_limit;
-$offset = $limit * $page ;
-$pageprev = $page - 1;
-$pagenext = $page + 1;
-if (! $sortorder) $sortorder="DESC";
-if (! $sortfield) $sortfield="fac.datef,fac.rowid";
-
-$month = GETPOST('month','int');
-$year = GETPOST('year','int');
-
-
-/*
- * Actions
- */
-
-if ($mode == 'search')
-{
- if ($modesearch == 'soc')
- {
- $sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s ";
- $sql.= " WHERE s.nom LIKE '%".$db->escape($socname)."%'";
- $sql.= " AND s.entity IN (".getEntity('societe', 1).")";
- }
-
- $resql=$db->query($sql);
- if ($resql)
- {
- if ( $db->num_rows($resql) == 1)
- {
- $obj = $db->fetch_object($resql);
- $socid = $obj->rowid;
- }
- $db->free($resql);
- }
-}
-
-
-
-
-/*
- * View
- */
-
-$now=dol_now();
-$form=new Form($db);
-$htmlother=new FormOther($db);
-
-llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
-
-$sql = "SELECT s.rowid as socid, s.nom, ";
-$sql.= " fac.rowid as facid, fac.ref, fac.ref_supplier, fac.datef, 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";
-if (!$user->rights->societe->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";
-if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
-$sql.= " WHERE fac.entity = ".$conf->entity;
-$sql.= " AND fac.fk_soc = s.rowid";
-if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
-if ($socid)
-{
- $sql .= " AND s.rowid = ".$socid;
-}
-if (GETPOST('filtre'))
-{
- $filtrearr = explode(",", GETPOST('filtre'));
- foreach ($filtrearr as $fil)
- {
- $filt = explode(":", $fil);
- $sql .= " AND " . $filt[0] . " = " . $filt[1];
- }
-}
-
-if (GETPOST("search_ref"))
-{
- if (is_numeric(GETPOST("search_ref"))) $sql .= " AND (fac.rowid = ".GETPOST("search_ref",'int')." OR fac.ref = '".$db->escape(GETPOST("search_ref"))."')"; // For backward compatibility
- else $sql .= " AND fac.ref LIKE '%".$db->escape(GETPOST("search_ref"))."%'";
-}
-if (GETPOST("search_ref_supplier"))
-{
- $sql .= " AND fac.ref_supplier LIKE '%".$db->escape(GETPOST("search_ref_supplier"))."%'";
-}
-if ($month > 0)
-{
- if ($year > 0)
- $sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
- else
- $sql.= " AND date_format(fac.datef, '%m') = '$month'";
-}
-else if ($year > 0)
-{
- $sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
-}
-if (GETPOST("search_libelle"))
-{
- $sql .= " AND fac.libelle LIKE '%".$db->escape(GETPOST("search_libelle"))."%'";
-}
-
-if (GETPOST("search_societe"))
-{
- $sql .= " AND s.nom LIKE '%".$db->escape(GETPOST("search_societe"))."%'";
-}
-
-if (GETPOST("search_montant_ht"))
-{
- $sql .= " AND fac.total_ht = '".$db->escape(price2num(GETPOST("search_montant_ht")))."'";
-}
-
-if (GETPOST("search_montant_ttc"))
-{
- $sql .= " AND fac.total_ttc = '".$db->escape(price2num(GETPOST("search_montant_ttc")))."'";
-}
-
-$sql.= $db->order($sortfield,$sortorder);
-$sql.= $db->plimit($limit+1, $offset);
-
-$resql = $db->query($sql);
-if ($resql)
-{
- $num = $db->num_rows($resql);
- $i = 0;
-
- if ($socid) {
- $soc = new Societe($db);
- $soc->fetch($socid);
- }
-
- $param='&socid='.$socid;
- if ($month) $param.='&month='.urlencode($month);
- if ($year) $param.='&year=' .urlencode($year);
- if (GETPOST("search_ref")) $param.='&search_ref='.urlencode(GETPOST("search_ref"));
- if (GETPOST("search_ref_supplier")) $param.='&search_ref_supplier'.urlencode(GETPOST("search_ref_supplier"));
- if (GETPOST("search_libelle")) $param.='&search_libelle='.urlencode(GETPOST("search_libelle"));
- if (GETPOST("search_societe")) $param.='&search_societe='.urlencode(GETPOST("search_societe"));
- if (GETPOST("search_montant_ht")) $param.='&search_montant_ht='.urlencode(GETPOST("search_montant_ht"));
- if (GETPOST("search_montant_ttc")) $param.='&search_montant_ttc='.urlencode(GETPOST("search_montant_ttc"));
-
- print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->nom":""),$page,"index.php",$param,$sortfield,$sortorder,'',$num);
- print '\n";
- $db->free($resql);
-}
-else
-{
- dol_print_error($db);
-}
-
-$db->close();
-
-
-llxFooter();
-?>
+Url not available
\ No newline at end of file
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
new file mode 100644
index 00000000000..80c20a821ba
--- /dev/null
+++ b/htdocs/fourn/facture/list.php
@@ -0,0 +1,306 @@
+
+ * Copyright (C) 2004-2013 Laurent Destailleur
+ * Copyright (C) 2005-2013 Regis Houssin
+ * Copyright (C) 2013 Philippe Grand
+ *
+ * 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 3 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, see .
+ */
+
+/**
+ * \file htdocs/fourn/facture/list.php
+ * \ingroup fournisseur,facture
+ * \brief List of suppliers invoices
+ */
+
+require '../../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
+require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+
+if (!$user->rights->fournisseur->facture->lire) accessforbidden();
+
+$langs->load("companies");
+$langs->load("bills");
+
+$socid = GETPOST('socid','int');
+
+// Security check
+if ($user->societe_id > 0)
+{
+ $action='';
+ $_GET["action"] = '';
+ $socid = $user->societe_id;
+}
+
+$mode=GETPOST("mode");
+$modesearch=GETPOST("mode_search");
+
+$page=GETPOST("page",'int');
+$sortorder = GETPOST("sortorder",'alpha');
+$sortfield = GETPOST("sortfield",'alpha');
+
+if ($page == -1) { $page = 0 ; }
+$limit = $conf->liste_limit;
+$offset = $limit * $page ;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
+if (! $sortorder) $sortorder="DESC";
+if (! $sortfield) $sortfield="fac.datef,fac.rowid";
+
+$month = GETPOST('month','int');
+$year = GETPOST('year','int');
+
+
+/*
+ * Actions
+ */
+
+if ($mode == 'search')
+{
+ if ($modesearch == 'soc')
+ {
+ $sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s ";
+ $sql.= " WHERE s.nom LIKE '%".$db->escape($socname)."%'";
+ $sql.= " AND s.entity IN (".getEntity('societe', 1).")";
+ }
+
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ if ( $db->num_rows($resql) == 1)
+ {
+ $obj = $db->fetch_object($resql);
+ $socid = $obj->rowid;
+ }
+ $db->free($resql);
+ }
+}
+
+
+
+
+/*
+ * View
+ */
+
+$now=dol_now();
+$form=new Form($db);
+$htmlother=new FormOther($db);
+
+llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
+
+$sql = "SELECT s.rowid as socid, s.nom, ";
+$sql.= " fac.rowid as facid, fac.ref, fac.ref_supplier, fac.datef, 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";
+if (!$user->rights->societe->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";
+if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+$sql.= " WHERE fac.entity = ".$conf->entity;
+$sql.= " AND fac.fk_soc = s.rowid";
+if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
+if ($socid)
+{
+ $sql .= " AND s.rowid = ".$socid;
+}
+if (GETPOST('filtre'))
+{
+ $filtrearr = explode(",", GETPOST('filtre'));
+ foreach ($filtrearr as $fil)
+ {
+ $filt = explode(":", $fil);
+ $sql .= " AND " . $filt[0] . " = " . $filt[1];
+ }
+}
+
+if (GETPOST("search_ref"))
+{
+ if (is_numeric(GETPOST("search_ref"))) $sql .= " AND (fac.rowid = ".GETPOST("search_ref",'int')." OR fac.ref = '".$db->escape(GETPOST("search_ref"))."')"; // For backward compatibility
+ else $sql .= " AND fac.ref LIKE '%".$db->escape(GETPOST("search_ref"))."%'";
+}
+if (GETPOST("search_ref_supplier"))
+{
+ $sql .= " AND fac.ref_supplier LIKE '%".$db->escape(GETPOST("search_ref_supplier"))."%'";
+}
+if ($month > 0)
+{
+ if ($year > 0)
+ $sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
+ else
+ $sql.= " AND date_format(fac.datef, '%m') = '$month'";
+}
+else if ($year > 0)
+{
+ $sql.= " AND fac.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
+}
+if (GETPOST("search_libelle"))
+{
+ $sql .= " AND fac.libelle LIKE '%".$db->escape(GETPOST("search_libelle"))."%'";
+}
+
+if (GETPOST("search_societe"))
+{
+ $sql .= " AND s.nom LIKE '%".$db->escape(GETPOST("search_societe"))."%'";
+}
+
+if (GETPOST("search_montant_ht"))
+{
+ $sql .= " AND fac.total_ht = '".$db->escape(price2num(GETPOST("search_montant_ht")))."'";
+}
+
+if (GETPOST("search_montant_ttc"))
+{
+ $sql .= " AND fac.total_ttc = '".$db->escape(price2num(GETPOST("search_montant_ttc")))."'";
+}
+
+$sql.= $db->order($sortfield,$sortorder);
+$sql.= $db->plimit($limit+1, $offset);
+
+$resql = $db->query($sql);
+if ($resql)
+{
+ $num = $db->num_rows($resql);
+ $i = 0;
+
+ if ($socid) {
+ $soc = new Societe($db);
+ $soc->fetch($socid);
+ }
+
+ $param='&socid='.$socid;
+ if ($month) $param.='&month='.urlencode($month);
+ if ($year) $param.='&year=' .urlencode($year);
+ if (GETPOST("search_ref")) $param.='&search_ref='.urlencode(GETPOST("search_ref"));
+ if (GETPOST("search_ref_supplier")) $param.='&search_ref_supplier'.urlencode(GETPOST("search_ref_supplier"));
+ if (GETPOST("search_libelle")) $param.='&search_libelle='.urlencode(GETPOST("search_libelle"));
+ if (GETPOST("search_societe")) $param.='&search_societe='.urlencode(GETPOST("search_societe"));
+ if (GETPOST("search_montant_ht")) $param.='&search_montant_ht='.urlencode(GETPOST("search_montant_ht"));
+ if (GETPOST("search_montant_ttc")) $param.='&search_montant_ttc='.urlencode(GETPOST("search_montant_ttc"));
+
+ print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->nom":""),$page,"index.php",$param,$sortfield,$sortorder,'',$num);
+ print '\n";
+ $db->free($resql);
+}
+else
+{
+ dol_print_error($db);
+}
+
+
+llxFooter();
+
+$db->close();
+?>
diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php
index d1143966010..b4bb99dcefc 100644
--- a/htdocs/fourn/facture/note.php
+++ b/htdocs/fourn/facture/note.php
@@ -88,7 +88,7 @@ if ($object->id > 0)
print '';
- $linkback = ''.$langs->trans("BackToList").'';
+ $linkback = ''.$langs->trans("BackToList").'';
// Ref
print '| '.$langs->trans("Ref").' | ';
diff --git a/htdocs/index.php b/htdocs/index.php
index e2d50d77a6f..a93e0f10a54 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -416,7 +416,7 @@ if (! empty($conf->fournisseur->enabled) && ! empty($conf->facture->enabled) &&
$board->load_board($user);
$board->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24;
$board->label=$langs->trans("SupplierBillsToPay");
- $board->url=DOL_URL_ROOT.'/fourn/facture/index.php?filtre=paye:0';
+ $board->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=paye:0';
$board->img=img_object($langs->trans("Bills"),"bill");
$rowspan++;
$dashboardlines[]=$board;
| | |