dolibarr 21.0.0-beta
index.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
25// Load Dolibarr environment
26require '../../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
28require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
29require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
31
40// Load translation files required by the page
41$langs->loadLangs(['bills', 'boxes']);
42
43// Filter to show only result of one supplier
44$socid = GETPOSTINT('socid');
45if (!empty($user->socid) && $user->socid > 0) {
46 $action = '';
47 $socid = $user->socid;
48}
49
50// Maximum elements of the tables
51$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
52$maxDraftCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500);
53$maxLatestEditCount = 5;
54$maxOpenCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500);
55
56// Security check
57restrictedArea($user, 'fournisseur', 0, '', 'facture');
58
59
60/*
61 * Actions
62 */
63
64// None
65
66
67
68/*
69 * View
70 */
71
72llxHeader("", $langs->trans("SupplierInvoicesArea"), 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
73
74print load_fiche_titre($langs->trans("SupplierInvoicesArea"), '', 'supplier_invoice');
75
76print '<div class="fichecenter">';
77
78print '<div class="fichethirdleft">';
79$tmp = getNumberInvoicesPieChart('suppliers');
80if ($tmp) {
81 print $tmp;
82 print '<br>';
83}
84
85$tmp = getDraftSupplierTable($max, $socid);
86if ($tmp) {
87 print $tmp;
88 print '<br>';
89}
90
91print '</div>';
92
93print '<div class="fichetwothirdright">';
94
95$tmp = getPurchaseInvoiceLatestEditTable($maxLatestEditCount, $socid);
96if ($tmp) {
97 print $tmp;
98 print '<br>';
99}
100
101$tmp = getPurchaseInvoiceUnpaidOpenTable($max, $socid);
102if ($tmp) {
103 print $tmp;
104 print '<br>';
105}
106
107print '</div>';
108
109print '</div>';
110
111// End of page
112llxFooter();
113$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:71
llxFooter()
Footer empty.
Definition document.php:107
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.