info.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. /**
  20. * \file htdocs/fourn/paiement/info.php
  21. * \ingroup facture, fournisseur
  22. * \brief Tab for Supplier Payment Information
  23. */
  24. // Load Dolibarr environment
  25. require '../../main.inc.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
  28. require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
  29. // Load translation files required by the page
  30. $langs->loadLangs(array("bills", "suppliers", "companies"));
  31. // Get Parameters
  32. $id = GETPOST('id', 'int');
  33. // Initialize Objects
  34. $object = new PaiementFourn($db);
  35. // Load object
  36. include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
  37. $result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', '');
  38. // Security check
  39. if ($user->socid) {
  40. $socid = $user->socid;
  41. }
  42. // Now check also permission on thirdparty of invoices of payments. Thirdparty were loaded by the fetch_object before based on first invoice.
  43. // It should be enough because all payments are done on invoices of the same thirdparty.
  44. if ($socid && $socid != $object->thirdparty->id) {
  45. accessforbidden();
  46. }
  47. /*
  48. * Actions
  49. */
  50. // None
  51. /*
  52. * View
  53. */
  54. llxHeader();
  55. $object->info($id);
  56. $head = payment_supplier_prepare_head($object);
  57. print dol_get_fiche_head($head, 'info', $langs->trans("SupplierPayment"), 0, 'payment');
  58. $linkback = '<a href="'.DOL_URL_ROOT.'/fourn/paiement/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  59. dol_banner_tab($object, 'id', $linkback, -1, 'rowid', 'ref');
  60. print dol_get_fiche_end();
  61. print '<table width="100%"><tr><td>';
  62. dol_print_object_info($object);
  63. print '</td></tr></table>';
  64. // End of page
  65. llxFooter();
  66. $db->close();