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