dolibarr  16.0.5
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 require '../../main.inc.php';
41 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
42 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
43 
44 $action = GETPOST('action', 'aZ09');
45 
46 
47 /*
48  * View
49  */
50 
51 //top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header.
52 top_httphead();
53 
54 //print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
55 
56 if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvnext') {
57  // Increase date
58  $al = new AccountLine($db);
59  $al->datev_next(GETPOST('rowid', 'int'));
60  $al->fetch(GETPOST('rowid', 'int'));
61 
62  print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($db->jdate($al->datev), "day").'</span>';
63 
64  exit;
65 }
66 
67 if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvprev') {
68  // Decrease date
69  $al = new AccountLine($db);
70  $al->datev_previous(GETPOST('rowid', 'int'));
71  $al->fetch(GETPOST('rowid', 'int'));
72 
73  print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($db->jdate($al->datev), "day").'</span>';
74 
75  exit;
76 }
77 
78 if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext') {
79  // Increase date
80  $al = new AccountLine($db);
81  $al->dateo_next(GETPOST('rowid', 'int'));
82  $al->fetch(GETPOST('rowid', 'int'));
83 
84  print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
85 
86  exit;
87 }
88 
89 if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev') {
90  // Decrease date
91  $al = new AccountLine($db);
92  $al->dateo_previous(GETPOST('rowid', 'int'));
93  $al->fetch(GETPOST('rowid', 'int'));
94 
95  print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($db->jdate($al->dateo), "day").'</span>';
96 
97  exit;
98 }
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
top_httphead
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
Definition: main.inc.php:1407
dol_print_date
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Definition: functions.lib.php:2500
AccountLine
Class to manage bank transaction lines.
Definition: account.class.php:1757