dolibarr  17.0.4
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 
48 /*
49  * View
50  */
51 
52 //top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header.
53 top_httphead();
54 
55 //print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
56 
57 if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvnext') {
58  // Increase date
59  $al = new AccountLine($db);
60  $al->datev_next(GETPOST('rowid', 'int'));
61  $al->fetch(GETPOST('rowid', 'int'));
62 
63  print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($db->jdate($al->datev), "day").'</span>';
64 
65  exit;
66 }
67 
68 if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvprev') {
69  // Decrease date
70  $al = new AccountLine($db);
71  $al->datev_previous(GETPOST('rowid', 'int'));
72  $al->fetch(GETPOST('rowid', 'int'));
73 
74  print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($db->jdate($al->datev), "day").'</span>';
75 
76  exit;
77 }
78 
79 if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext') {
80  // Increase date
81  $al = new AccountLine($db);
82  $al->dateo_next(GETPOST('rowid', 'int'));
83  $al->fetch(GETPOST('rowid', 'int'));
84 
85  print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
86 
87  exit;
88 }
89 
90 if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev') {
91  // Decrease date
92  $al = new AccountLine($db);
93  $al->dateo_previous(GETPOST('rowid', 'int'));
94  $al->fetch(GETPOST('rowid', 'int'));
95 
96  print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
97 
98  exit;
99 }
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(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
Definition: main.inc.php:1440