dolibarr 21.0.0-beta
bankconciliate.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2012 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
24if (!defined('NOTOKENRENEWAL')) {
25 define('NOTOKENRENEWAL', '1'); // Disables token renewal
26}
27if (!defined('NOREQUIREMENU')) {
28 define('NOREQUIREMENU', '1');
29}
30if (!defined('NOREQUIREHTML')) {
31 define('NOREQUIREHTML', '1');
32}
33if (!defined('NOREQUIREAJAX')) {
34 define('NOREQUIREAJAX', '1');
35}
36if (!defined('NOREQUIRESOC')) {
37 define('NOREQUIRESOC', '1');
38}
39//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Required to know date format for dol_print_date
40
41// Load Dolibarr environment
42require '../../main.inc.php';
43require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
44require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
45
54$action = GETPOST('action', 'aZ09');
55
56$format = GETPOST('format');
57
58// Security check
59// Checks are done later
60
61
62/*
63 * View
64 */
65
66//top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header.
68
69//print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
70
71if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'dvnext') {
72 // Increase date
73 $al = new AccountLine($db);
74 $al->datev_next(GETPOSTINT('rowid'));
75 $al->fetch(GETPOSTINT('rowid'));
76
77 print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($al->datev, ($format ? $format : "day")).'</span>';
78
79 exit;
80}
81
82if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'dvprev') {
83 // Decrease date
84 $al = new AccountLine($db);
85 $al->datev_previous(GETPOSTINT('rowid'));
86 $al->fetch(GETPOSTINT('rowid'));
87
88 print '<span class="spanforajaxedit" id="datevalue_'.$al->id.'">'.dol_print_date($al->datev, ($format ? $format : "day")).'</span>';
89
90 exit;
91}
92
93if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'donext') {
94 // Increase date
95 $al = new AccountLine($db);
96 $al->dateo_next(GETPOSTINT('rowid'));
97 $al->fetch(GETPOSTINT('rowid'));
98
99 print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($al->dateo, ($format ? $format : "day")).'</span>';
100
101 exit;
102}
103
104if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'doprev') {
105 // Decrease date
106 $al = new AccountLine($db);
107 $al->dateo_previous(GETPOSTINT('rowid'));
108 $al->fetch(GETPOSTINT('rowid'));
109
110 print '<span class="spanforajaxedit" id="dateoperation_'.$al->id.'">'.dol_print_date($al->dateo, ($format ? $format : "day")).'</span>';
111
112 exit;
113}
Class to manage bank transaction lines.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $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.