info.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. /* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
  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/bank/info.php
  19. * \ingroup compta/bank
  20. * \brief Info tab of bank statement
  21. */
  22. // Load Dolibarr environment
  23. require '../../main.inc.php';
  24. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  25. require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
  26. require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
  27. // Load translation files required by the page
  28. $langs->loadLangs(array('banks', 'categories', 'companies'));
  29. // Get Parameters
  30. $id = GETPOST("rowid", 'int');
  31. $accountid = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('account', 'int'));
  32. $ref = GETPOST('ref', 'alpha');
  33. // Security check
  34. $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
  35. $fieldtype = (!empty($ref) ? 'ref' : 'rowid');
  36. if ($user->socid) {
  37. $socid = $user->socid;
  38. }
  39. $result = restrictedArea($user, 'banque', $accountid, 'bank_account');
  40. if (empty($user->rights->banque->lire) && empty($user->rights->banque->consolidate)) {
  41. accessforbidden();
  42. }
  43. /*
  44. * View
  45. */
  46. llxHeader();
  47. $object = new AccountLine($db);
  48. $object->fetch($id);
  49. $object->info($id);
  50. $h = 0;
  51. $head[$h][0] = DOL_URL_ROOT.'/compta/bank/line.php?rowid='.$id;
  52. $head[$h][1] = $langs->trans("BankTransaction");
  53. $h++;
  54. $head[$h][0] = DOL_URL_ROOT.'/compta/bank/info.php?rowid='.$id;
  55. $head[$h][1] = $langs->trans("Info");
  56. $hselected = $h;
  57. $h++;
  58. print dol_get_fiche_head($head, $hselected, $langs->trans("LineRecord"), -1, 'accountline');
  59. $linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  60. dol_banner_tab($object, 'rowid', $linkback);
  61. print '<div class="underbanner clearboth"></div>';
  62. print '<br>';
  63. print '<table width="100%"><tr><td>';
  64. dol_print_object_info($object);
  65. print '</td></tr></table>';
  66. print '</div>';
  67. // End of page
  68. llxFooter();
  69. $db->close();