bankconciliate.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. /* Copyright (C) 2012 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/core/ajax/bankconciliate.php
  19. * \brief File to set data for bank concilation
  20. */
  21. if (!defined('NOTOKENRENEWAL')) {
  22. define('NOTOKENRENEWAL', '1'); // Disables token renewal
  23. }
  24. if (!defined('NOREQUIREMENU')) {
  25. define('NOREQUIREMENU', '1');
  26. }
  27. if (!defined('NOREQUIREHTML')) {
  28. define('NOREQUIREHTML', '1');
  29. }
  30. if (!defined('NOREQUIREAJAX')) {
  31. define('NOREQUIREAJAX', '1');
  32. }
  33. if (!defined('NOREQUIRESOC')) {
  34. define('NOREQUIRESOC', '1');
  35. }
  36. //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Required to know date format for dol_print_date
  37. // Load Dolibarr environment
  38. require '../../main.inc.php';
  39. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  40. require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
  41. $action = GETPOST('action', 'aZ09');
  42. /*
  43. * View
  44. */
  45. //top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header.
  46. top_httphead();
  47. //print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
  48. if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvnext') {
  49. // Increase date
  50. $al = new AccountLine($db);
  51. $al->datev_next(GETPOST('rowid', 'int'));
  52. $al->fetch(GETPOST('rowid', 'int'));
  53. print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($db->jdate($al->datev), "day").'</span>';
  54. exit;
  55. }
  56. if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvprev') {
  57. // Decrease date
  58. $al = new AccountLine($db);
  59. $al->datev_previous(GETPOST('rowid', 'int'));
  60. $al->fetch(GETPOST('rowid', 'int'));
  61. print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($db->jdate($al->datev), "day").'</span>';
  62. exit;
  63. }
  64. if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext') {
  65. // Increase date
  66. $al = new AccountLine($db);
  67. $al->dateo_next(GETPOST('rowid', 'int'));
  68. $al->fetch(GETPOST('rowid', 'int'));
  69. print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
  70. exit;
  71. }
  72. if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev') {
  73. // Decrease date
  74. $al = new AccountLine($db);
  75. $al->dateo_previous(GETPOST('rowid', 'int'));
  76. $al->fetch(GETPOST('rowid', 'int'));
  77. print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
  78. exit;
  79. }