dolibarr 20.0.0
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
25require '../../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
27require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
28require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
29require_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 = GETPOSTINT('socid');
36if (isset($user->socid) && $user->socid > 0) {
37 $action = '';
38 $socid = $user->socid;
39}
40
41// Maximum elements of the tables
42$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
43$maxDraftCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500);
44$maxLatestEditCount = 5;
45$maxOpenCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500);
46
47// Security check
48restrictedArea($user, 'fournisseur', 0, '', 'facture');
49
50
51/*
52 * Actions
53 */
54
55// None
56
57
58
59/*
60 * View
61 */
62
63llxHeader("", $langs->trans("SupplierInvoicesArea"), 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
64
65print load_fiche_titre($langs->trans("SupplierInvoicesArea"), '', 'supplier_invoice');
66
67print '<div class="fichecenter">';
68
69print '<div class="fichethirdleft">';
70$tmp = getNumberInvoicesPieChart('suppliers');
71if ($tmp) {
72 print $tmp;
73 print '<br>';
74}
75
76$tmp = getDraftSupplierTable($max, $socid);
77if ($tmp) {
78 print $tmp;
79 print '<br>';
80}
81
82print '</div>';
83
84print '<div class="fichetwothirdright">';
85
86$tmp = getPurchaseInvoiceLatestEditTable($maxLatestEditCount, $socid);
87if ($tmp) {
88 print $tmp;
89 print '<br>';
90}
91
92$tmp = getPurchaseInvoiceUnpaidOpenTable($max, $socid);
93if ($tmp) {
94 print $tmp;
95 print '<br>';
96}
97
98print '</div>';
99
100print '</div>';
101
102// End of page
103llxFooter();
104$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.
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.