dolibarr 25.0.0-alpha
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.'/compta/facture/class/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// Security check
41restrictedArea($user, 'facture');
42
43// Load translation files required by the page
44$langs->load('bills');
45
46// Filter to show only result of one customer
47$socid = GETPOSTINT('socid');
48if (!empty($user->socid) && $user->socid > 0) {
49 $action = '';
50 $socid = $user->socid;
51}
52
53// Maximum elements of the tables
54$max = getDolUserInt('MAIN_SIZE_SHORTLIST_LIMIT', getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5));
55
56$maxDraftCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', $max);
57$maxOpenCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', $max);
58
59
60/*
61 * View
62 */
63
64llxHeader("", $langs->trans("CustomersInvoicesArea"), "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes");
65
66print load_fiche_titre($langs->trans("CustomersInvoicesArea"), '', 'bill');
67
68print '<div class="fichecenter">';
69
70print '<div class="fichethirdleft">';
71$tmp = getNumberInvoicesPieChart('customers');
72if ($tmp) {
73 print $tmp;
74 print '<br>';
75}
76$tmp = getCustomerInvoiceDraftTable($maxDraftCount, $socid);
77if ($tmp) {
78 print $tmp;
79 print '<br>';
80}
81
82print '</div>';
83
84print '<div class="fichetwothirdright">';
85
86$tmp = getCustomerInvoiceLatestEditTable($max, $socid);
87if ($tmp) {
88 print $tmp;
89 print '<br>';
90}
91
92$tmp = getCustomerInvoiceUnpaidOpenTable($maxOpenCount, $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();
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.
getDolUserInt($key, $default=0, $tmpuser=null)
Return Dolibarr user constant int value.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
getCustomerInvoiceLatestEditTable($maxCount=5, $socid=0)
Return a HTML table that contains a list with latest edited customer invoices.
getCustomerInvoiceDraftTable($maxCount=500, $socid=0)
Return a HTML table that contains a list with customer invoice drafts.
getCustomerInvoiceUnpaidOpenTable($maxCount=500, $socid=0)
Return a HTML table that contains of unpaid customers 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.