dolibarr  16.0.5
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 require '../../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
29 
30 // Security check
31 restrictedArea($user, 'facture');
32 
33 // Load translation files required by the page
34 $langs->load('bills');
35 
36 // Filter to show only result of one customer
37 $socid = GETPOST('socid', 'int');
38 if (isset($user->socid) && $user->socid > 0) {
39  $action = '';
40  $socid = $user->socid;
41 }
42 
43 $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
44 
45 // Maximum elements of the tables
46 $maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD;
47 $maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD;
48 
49 
50 /*
51  * View
52  */
53 
54 llxHeader("", $langs->trans("CustomersInvoicesArea"), "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes");
55 
56 print load_fiche_titre($langs->trans("CustomersInvoicesArea"), '', 'bill');
57 
58 print '<div class="fichecenter">';
59 
60 print '<div class="fichethirdleft">';
61 $tmp = getNumberInvoicesPieChart('customers');
62 if ($tmp) {
63  print $tmp;
64  print '<br>';
65 }
66 $tmp = getCustomerInvoiceDraftTable($maxDraftCount, $socid);
67 if ($tmp) {
68  print $tmp;
69  print '<br>';
70 }
71 
72 print '</div>';
73 
74 print '<div class="fichetwothirdright">';
75 
76 $tmp = getCustomerInvoiceLatestEditTable($max, $socid);
77 if ($tmp) {
78  print $tmp;
79  print '<br>';
80 }
81 
82 $tmp = getCustomerInvoiceUnpaidOpenTable($maxOpenCount, $socid);
83 if ($tmp) {
84  print $tmp;
85  print '<br>';
86 }
87 
88 print '</div>';
89 
90 print '</div>';
91 
92 // End of page
93 llxFooter();
94 $db->close();
restrictedArea
restrictedArea($user, $features, $objectid=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.
Definition: security.lib.php:234
getCustomerInvoiceLatestEditTable
getCustomerInvoiceLatestEditTable($maxCount=5, $socid=0)
Return a HTML table that contains a list with latest edited customer invoices.
Definition: invoice.lib.php:673
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
llxFooter
llxFooter()
Footer empty.
Definition: index.php:71
getCustomerInvoiceDraftTable
getCustomerInvoiceDraftTable($maxCount=500, $socid=0)
Return a HTML table that contains a list with customer invoice drafts.
Definition: invoice.lib.php:396
getCustomerInvoiceUnpaidOpenTable
getCustomerInvoiceUnpaidOpenTable($maxCount=500, $socid=0)
Return a HTML table that contains of unpaid customers invoices.
Definition: invoice.lib.php:889
getNumberInvoicesPieChart
getNumberInvoicesPieChart($mode)
Return an HTML table that contains a pie chart of the number of customers or supplier invoices.
Definition: invoice.lib.php:256
llxHeader
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
Definition: index.php:63