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.'/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 = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
55$maxDraftCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', $max);
56$maxOpenCount = getDolGlobalInt('MAIN_MAXLIST_OVERLOAD', $max);
57
58
59/*
60 * View
61 */
62
63llxHeader("", $langs->trans("CustomersInvoicesArea"), "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes");
64
65print load_fiche_titre($langs->trans("CustomersInvoicesArea"), '', 'bill');
66
67print '<div class="fichecenter">';
68
69print '<div class="fichethirdleft">';
70$tmp = getNumberInvoicesPieChart('customers');
71if ($tmp) {
72 print $tmp;
73 print '<br>';
74}
75$tmp = getCustomerInvoiceDraftTable($maxDraftCount, $socid);
76if ($tmp) {
77 print $tmp;
78 print '<br>';
79}
80
81print '</div>';
82
83print '<div class="fichetwothirdright">';
84
85$tmp = getCustomerInvoiceLatestEditTable($max, $socid);
86if ($tmp) {
87 print $tmp;
88 print '<br>';
89}
90
91$tmp = getCustomerInvoiceUnpaidOpenTable($maxOpenCount, $socid);
92if ($tmp) {
93 print $tmp;
94 print '<br>';
95}
96
97print '</div>';
98
99print '</div>';
100
101// End of page
102llxFooter();
103$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.
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.