index.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. /**
  18. * \file htdocs/compta/facture/index.php
  19. * \ingroup facture
  20. * \brief Home page of customer invoices area
  21. */
  22. // Load Dolibarr environment
  23. require '../../main.inc.php';
  24. require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
  25. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
  28. // Security check
  29. restrictedArea($user, 'facture');
  30. // Load translation files required by the page
  31. $langs->load('bills');
  32. // Filter to show only result of one customer
  33. $socid = GETPOST('socid', 'int');
  34. if (isset($user->socid) && $user->socid > 0) {
  35. $action = '';
  36. $socid = $user->socid;
  37. }
  38. $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
  39. // Maximum elements of the tables
  40. $maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD;
  41. $maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD;
  42. /*
  43. * View
  44. */
  45. llxHeader("", $langs->trans("CustomersInvoicesArea"), "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes");
  46. print load_fiche_titre($langs->trans("CustomersInvoicesArea"), '', 'bill');
  47. print '<div class="fichecenter">';
  48. print '<div class="fichethirdleft">';
  49. $tmp = getNumberInvoicesPieChart('customers');
  50. if ($tmp) {
  51. print $tmp;
  52. print '<br>';
  53. }
  54. $tmp = getCustomerInvoiceDraftTable($maxDraftCount, $socid);
  55. if ($tmp) {
  56. print $tmp;
  57. print '<br>';
  58. }
  59. print '</div>';
  60. print '<div class="fichetwothirdright">';
  61. $tmp = getCustomerInvoiceLatestEditTable($max, $socid);
  62. if ($tmp) {
  63. print $tmp;
  64. print '<br>';
  65. }
  66. $tmp = getCustomerInvoiceUnpaidOpenTable($maxOpenCount, $socid);
  67. if ($tmp) {
  68. print $tmp;
  69. print '<br>';
  70. }
  71. print '</div>';
  72. print '</div>';
  73. // End of page
  74. llxFooter();
  75. $db->close();