fiscalyear_info.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. /* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
  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/accountancy/admin/fiscalyear_info.php
  19. * \ingroup Accountancy (Double entries)
  20. * \brief Page to show info of a fiscal year
  21. */
  22. // Load Dolibarr environment
  23. require '../../main.inc.php';
  24. require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
  25. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
  27. // Load translation files required by the page
  28. $langs->loadLangs(array("admin", "compta"));
  29. // Security check
  30. if ($user->socid > 0) {
  31. accessforbidden();
  32. }
  33. if (!$user->hasRight('accounting', 'fiscalyear', 'write')) {
  34. accessforbidden();
  35. }
  36. $id = GETPOST('id', 'int');
  37. // View
  38. $title = $langs->trans("Fiscalyear")." - ".$langs->trans("Info");
  39. $help_url = "EN:Module_Double_Entry_Accounting";
  40. llxHeader('', $title, $help_url);
  41. if ($id) {
  42. $object = new Fiscalyear($db);
  43. $object->fetch($id);
  44. $object->info($id);
  45. $head = fiscalyear_prepare_head($object);
  46. print dol_get_fiche_head($head, 'info', $langs->trans("Fiscalyear"), 0, 'cron');
  47. print '<table width="100%"><tr><td>';
  48. dol_print_object_info($object);
  49. print '</td></tr></table>';
  50. print '</div>';
  51. }
  52. // End of page
  53. llxFooter();
  54. $db->close();