dolibarr  16.0.5
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 require '../../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
29 
30 // Load translation files required by the page
31 $langs->loadLangs(['bills', 'boxes']);
32 
33 // Filter to show only result of one supplier
34 $socid = GETPOST('socid', 'int');
35 if (isset($user->socid) && $user->socid > 0) {
36  $action = '';
37  $socid = $user->socid;
38 }
39 
40 $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
41 
42 // Maximum elements of the tables
43 $maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
44 $maxLatestEditCount = 5;
45 $maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
46 
47 // Security check
48 restrictedArea($user, 'fournisseur', 0, '', 'facture');
49 
50 
51 /*
52  * Actions
53  */
54 
55 // None
56 
57 
58 
59 /*
60  * View
61  */
62 
63 llxHeader("", $langs->trans("SupplierInvoicesArea"), 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
64 
65 print load_fiche_titre($langs->trans("SupplierInvoicesArea"), '', 'supplier_invoice');
66 
67 print '<div class="fichecenter">';
68 
69 print '<div class="fichethirdleft">';
70 $tmp = getNumberInvoicesPieChart('suppliers');
71 if ($tmp) {
72  print $tmp;
73  print '<br>';
74 }
75 
76 $tmp = getDraftSupplierTable($max, $socid);
77 if ($tmp) {
78  print $tmp;
79  print '<br>';
80 }
81 
82 print '</div>';
83 
84 print '<div class="fichetwothirdright">';
85 
86 $tmp = getPurchaseInvoiceLatestEditTable($maxLatestEditCount, $socid);
87 if ($tmp) {
88  print $tmp;
89  print '<br>';
90 }
91 
92 $tmp = getPurchaseInvoiceUnpaidOpenTable($max, $socid);
93 if ($tmp) {
94  print $tmp;
95  print '<br>';
96 }
97 
98 print '</div>';
99 
100 print '</div>';
101 
102 // End of page
103 llxFooter();
104 $db->close();
restrictedArea
restrictedArea($user, $features, $objectid=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.
Definition: security.lib.php:234
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
getPurchaseInvoiceUnpaidOpenTable
getPurchaseInvoiceUnpaidOpenTable($maxCount=500, $socid=0)
Return a HTML table that contains of unpaid purchase invoices.
Definition: invoice.lib.php:1077
llxFooter
llxFooter()
Footer empty.
Definition: index.php:71
getNumberInvoicesPieChart
getNumberInvoicesPieChart($mode)
Return an HTML table that contains a pie chart of the number of customers or supplier invoices.
Definition: invoice.lib.php:256
llxHeader
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
getDraftSupplierTable
getDraftSupplierTable($maxCount=500, $socid=0)
Return a HTML table that contains a list with customer invoice drafts.
Definition: invoice.lib.php:543
getPurchaseInvoiceLatestEditTable
getPurchaseInvoiceLatestEditTable($maxCount=5, $socid=0)
Return a HTML table that contains a list with latest edited supplier invoices.
Definition: invoice.lib.php:781