dolibarr 24.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';
27
36require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
37require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
38require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
39require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
40
41// Load translation files required by the page
42$langs->loadLangs(['bills', 'boxes']);
43
44// Filter to show only result of one supplier
45$socid = GETPOSTINT('socid');
46if (!empty($user->socid) && $user->socid > 0) {
47 $action = '';
48 $socid = $user->socid;
49}
50
51// Maximum elements of the tables
52$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
53$maxDraftCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500);
54$maxLatestEditCount = 5;
55$maxOpenCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', 500);
56
57// Security check
58restrictedArea($user, 'fournisseur', 0, '', 'facture');
59
60
61/*
62 * Actions
63 */
64
65// None
66
67
68
69/*
70 * View
71 */
72
73llxHeader("", $langs->trans("SupplierInvoicesArea"), 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
74
75print load_fiche_titre($langs->trans("SupplierInvoicesArea"), '', 'supplier_invoice');
76
77print '<div class="fichecenter">';
78
79print '<div class="fichethirdleft">';
80$tmp = getNumberInvoicesPieChart('suppliers');
81if ($tmp) {
82 print $tmp;
83 print '<br>';
84}
85
86$tmp = getDraftSupplierTable($max, $socid);
87if ($tmp) {
88 print $tmp;
89 print '<br>';
90}
91
92print '</div>';
93
94print '<div class="fichetwothirdright">';
95
96$tmp = getPurchaseInvoiceLatestEditTable($maxLatestEditCount, $socid);
97if ($tmp) {
98 print $tmp;
99 print '<br>';
100}
101
102$tmp = getPurchaseInvoiceUnpaidOpenTable($max, $socid);
103if ($tmp) {
104 print $tmp;
105 print '<br>';
106}
107
108print '</div>';
109
110print '</div>';
111
112// End of page
113llxFooter();
114$db->close();
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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:73
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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.