dolibarr  19.0.0-dev
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
24 // Load Dolibarr environment
25 require '../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
30 
31 // Load translation files required by the page
32 $langs->loadLangs(['bills', 'boxes']);
33 
34 // Filter to show only result of one supplier
35 $socid = GETPOST('socid', 'int');
36 if (isset($user->socid) && $user->socid > 0) {
37  $action = '';
38  $socid = $user->socid;
39 }
40 
41 $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
42 
43 // Maximum elements of the tables
44 $maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
45 $maxLatestEditCount = 5;
46 $maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
47 
48 // Security check
49 restrictedArea($user, 'fournisseur', 0, '', 'facture');
50 
51 
52 /*
53  * Actions
54  */
55 
56 // None
57 
58 
59 
60 /*
61  * View
62  */
63 
64 llxHeader("", $langs->trans("SupplierInvoicesArea"), 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
65 
66 print load_fiche_titre($langs->trans("SupplierInvoicesArea"), '', 'supplier_invoice');
67 
68 print '<div class="fichecenter">';
69 
70 print '<div class="fichethirdleft">';
71 $tmp = getNumberInvoicesPieChart('suppliers');
72 if ($tmp) {
73  print $tmp;
74  print '<br>';
75 }
76 
77 $tmp = getDraftSupplierTable($max, $socid);
78 if ($tmp) {
79  print $tmp;
80  print '<br>';
81 }
82 
83 print '</div>';
84 
85 print '<div class="fichetwothirdright">';
86 
87 $tmp = getPurchaseInvoiceLatestEditTable($maxLatestEditCount, $socid);
88 if ($tmp) {
89  print $tmp;
90  print '<br>';
91 }
92 
93 $tmp = getPurchaseInvoiceUnpaidOpenTable($max, $socid);
94 if ($tmp) {
95  print $tmp;
96  print '<br>';
97 }
98 
99 print '</div>';
100 
101 print '</div>';
102 
103 // End of page
104 llxFooter();
105 $db->close();
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getNumberInvoicesPieChart($mode)
Return an HTML table that contains a pie chart of the number of customers or supplier invoices.
getPurchaseInvoiceLatestEditTable($maxCount=5, $socid=0)
Return a HTML table that contains a list with latest edited supplier invoices.
getDraftSupplierTable($maxCount=500, $socid=0)
Return a HTML table that contains a list with customer invoice drafts.
getPurchaseInvoiceUnpaidOpenTable($maxCount=500, $socid=0)
Return a HTML table that contains of unpaid purchase invoices.
llxFooter()
Footer empty.
Definition: index.php:71
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
Definition: index.php:63
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.