dolibarr  19.0.0-dev
bankconciliate.php
Go to the documentation of this file.
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 
23 if (!defined('NOTOKENRENEWAL')) {
24  define('NOTOKENRENEWAL', '1'); // Disables token renewal
25 }
26 if (!defined('NOREQUIREMENU')) {
27  define('NOREQUIREMENU', '1');
28 }
29 if (!defined('NOREQUIREHTML')) {
30  define('NOREQUIREHTML', '1');
31 }
32 if (!defined('NOREQUIREAJAX')) {
33  define('NOREQUIREAJAX', '1');
34 }
35 if (!defined('NOREQUIRESOC')) {
36  define('NOREQUIRESOC', '1');
37 }
38 //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Required to know date format for dol_print_date
39 
40 // Load Dolibarr environment
41 require '../../main.inc.php';
42 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
43 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
44 
45 $action = GETPOST('action', 'aZ09');
46 
47 // Security check
48 // Checks are done later
49 
50 
51 /*
52  * View
53  */
54 
55 //top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header.
56 top_httphead();
57 
58 //print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
59 
60 if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvnext') {
61  // Increase date
62  $al = new AccountLine($db);
63  $al->datev_next(GETPOST('rowid', 'int'));
64  $al->fetch(GETPOST('rowid', 'int'));
65 
66  print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($db->jdate($al->datev), "day").'</span>';
67 
68  exit;
69 }
70 
71 if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvprev') {
72  // Decrease date
73  $al = new AccountLine($db);
74  $al->datev_previous(GETPOST('rowid', 'int'));
75  $al->fetch(GETPOST('rowid', 'int'));
76 
77  print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($db->jdate($al->datev), "day").'</span>';
78 
79  exit;
80 }
81 
82 if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext') {
83  // Increase date
84  $al = new AccountLine($db);
85  $al->dateo_next(GETPOST('rowid', 'int'));
86  $al->fetch(GETPOST('rowid', 'int'));
87 
88  print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
89 
90  exit;
91 }
92 
93 if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev') {
94  // Decrease date
95  $al = new AccountLine($db);
96  $al->dateo_previous(GETPOST('rowid', 'int'));
97  $al->fetch(GETPOST('rowid', 'int'));
98 
99  print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
100 
101  exit;
102 }
Class to manage bank transaction lines.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!defined('NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
Definition: main.inc.php:1494