index.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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/fourn/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.'/fourn/class/fournisseur.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. // Load translation files required by the page
  29. $langs->loadLangs(['bills', 'boxes']);
  30. // Filter to show only result of one supplier
  31. $socid = GETPOST('socid', 'int');
  32. if (isset($user->socid) && $user->socid > 0) {
  33. $action = '';
  34. $socid = $user->socid;
  35. }
  36. $max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
  37. // Maximum elements of the tables
  38. $maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
  39. $maxLatestEditCount = 5;
  40. $maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
  41. // Security check
  42. restrictedArea($user, 'fournisseur', 0, '', 'facture');
  43. /*
  44. * Actions
  45. */
  46. // None
  47. /*
  48. * View
  49. */
  50. llxHeader("", $langs->trans("SupplierInvoicesArea"), 'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
  51. print load_fiche_titre($langs->trans("SupplierInvoicesArea"), '', 'supplier_invoice');
  52. print '<div class="fichecenter">';
  53. print '<div class="fichethirdleft">';
  54. $tmp = getNumberInvoicesPieChart('suppliers');
  55. if ($tmp) {
  56. print $tmp;
  57. print '<br>';
  58. }
  59. $tmp = getDraftSupplierTable($max, $socid);
  60. if ($tmp) {
  61. print $tmp;
  62. print '<br>';
  63. }
  64. print '</div>';
  65. print '<div class="fichetwothirdright">';
  66. $tmp = getPurchaseInvoiceLatestEditTable($maxLatestEditCount, $socid);
  67. if ($tmp) {
  68. print $tmp;
  69. print '<br>';
  70. }
  71. $tmp = getPurchaseInvoiceUnpaidOpenTable($max, $socid);
  72. if ($tmp) {
  73. print $tmp;
  74. print '<br>';
  75. }
  76. print '</div>';
  77. print '</div>';
  78. // End of page
  79. llxFooter();
  80. $db->close();