info.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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/compta/paiement/info.php
  21. * \ingroup facture
  22. * \brief Onglet info d'un paiement
  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.'/compta/paiement/class/paiement.class.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
  29. // Load translation files required by the page
  30. $langs->loadLangs(array('bills', 'companies'));
  31. $id = GETPOST('id', 'int');
  32. $ref = GETPOST('ref', 'alpha');
  33. $action = GETPOST('action', 'aZ09');
  34. $confirm = GETPOST('confirm', 'alpha');
  35. $object = new Paiement($db);
  36. // Load object
  37. include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
  38. $result = restrictedArea($user, $object->element, $object->id, 'paiement', '');
  39. // Security check
  40. if ($user->socid) {
  41. $socid = $user->socid;
  42. }
  43. // Now check also permission on thirdparty of invoices of payments. Thirdparty were loaded by the fetch_object before based on first invoice.
  44. // It should be enough because all payments are done on invoices of the same thirdparty.
  45. if ($socid && $socid != $object->thirdparty->id) {
  46. accessforbidden();
  47. }
  48. /*
  49. * Actions
  50. */
  51. // None
  52. /*
  53. * View
  54. */
  55. llxHeader('', $langs->trans("Payment"));
  56. $object->info($object->id);
  57. $head = payment_prepare_head($object);
  58. print dol_get_fiche_head($head, 'info', $langs->trans("PaymentCustomerInvoice"), -1, 'payment');
  59. $linkback = '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  60. dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '');
  61. print '<div class="fichecenter">';
  62. print '<div class="underbanner clearboth"></div>';
  63. print '<br>';
  64. print '<table width="100%"><tr><td>';
  65. dol_print_object_info($object);
  66. print '</td></tr></table>';
  67. print '</div>';
  68. print dol_get_fiche_end();
  69. // End of page
  70. llxFooter();
  71. $db->close();