dolibarr 24.0.3
report.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
5 * Copyright (C) 2012 Vinícius Nogueira <viniciusvgn@gmail.com>
6 * Copyright (C) 2014 Florian Henry <florian.henry@open-cooncept.pro>
7 * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
8 * Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
9 * Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
10 * Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com>
11 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
12 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program. If not, see <https://www.gnu.org/licenses/>.
26 */
27
34if (!defined('NOREQUIREMENU')) {
35 define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
36}
37if (!defined('NOBROWSERNOTIF')) {
38 define('NOBROWSERNOTIF', '1'); // Disable browser notification
39}
40
41// Load Dolibarr environment
42require '../../main.inc.php';
51require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php';
52require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
53require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
54require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php';
55require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
56require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php';
57
58$langs->loadLangs(array("bills", "banks", "cashdesk", "blockedlog"));
59
60$id = GETPOSTINT('id');
61$summaryonly = GETPOSTINT('summaryonly'); // May be used for ticket Z
62
64$object->fetch($id);
65
66//$limit = GETPOST('limit')?GETPOST('limit', 'int'):$conf->liste_limit;
67// The SQL request always reads the lines by date then rowid (see below), the sort only applies to the display.
68$sortfields = array('f.ref', 'p.datep', 'ba.ref', 'cp.code', 'amount');
69$sortfield = GETPOST('sortfield', 'aZ09comma');
70$sortorder = (strtolower(GETPOST('sortorder', 'aZ09comma')) == 'desc' ? 'DESC' : 'ASC');
71if (!in_array($sortfield, $sortfields)) {
72 $sortfield = 'p.datep';
73}
74
75$arrayfields = array(
76 'b.rowid' => array('label' => $langs->trans("Ref"), 'checked' => 1),
77 'b.dateo' => array('label' => $langs->trans("DateOperationShort"), 'checked' => 1),
78 'b.num_chq' => array('label' => $langs->trans("Number"), 'checked' => 1),
79 'ba.ref' => array('label' => $langs->trans("BankAccount"), 'checked' => 1),
80 'cp.code' => array('label' => $langs->trans("PaymentMode"), 'checked' => 1),
81 'b.debit' => array('label' => $langs->trans("Debit"), 'checked' => 1, 'position' => 600),
82 'b.credit' => array('label' => $langs->trans("Credit"), 'checked' => 1, 'position' => 605),
83);
84
85$syear = $object->year_close;
86$smonth = $object->month_close;
87$sday = $object->day_close;
88
89$posmodule = $object->posmodule;
90$terminalid = $object->posnumber;
91
92// Security check
93if ($user->socid > 0) { // Protection if external user
94 //$socid = $user->socid;
96}
97if (!$user->hasRight('cashdesk', 'run') && !$user->hasRight('takepos', 'run')) {
99}
100
101
102/*
103 * View
104 */
105
106$title = $langs->trans("CashControl");
107$param = '';
108
109$conf->dol_hide_topmenu = 1;
110$conf->dol_hide_leftmenu = 1;
111
112llxHeader('', $title, '', '', 0, 0, array(), array(), $param);
113
114print '<!-- Begin div id-container --><div id="id-container" class="id-container centpercent">';
115
116$dates = $datee = 0;
117
118if ($syear && !$smonth) {
119 $dates = dol_get_first_day($syear, 1); $datee = dol_get_last_day($syear, 12);
120} elseif ($syear && $smonth && !$sday) {
121 $dates = dol_get_first_day($syear, $smonth); $datee = dol_get_last_day($syear, $smonth);
122} elseif ($syear && $smonth && $sday) {
123 $dates = dol_mktime(0, 0, 0, $smonth, $sday, $syear); $datee = dol_mktime(23, 59, 59, $smonth, $sday, $syear);
124} else {
125 dol_print_error(null, 'Year not defined');
126}
127$datefilter = 'p.datep';
128$modulesourcefilter = 'f.module_source';
129$amountfield = 'pf.amount';
130$possource = 'f.pos_source';
131$fieldentity = 'p.entity';
132$joinleft = 'LEFT ';
133if (isALNERunningVersion() && $mysoc->country_code == 'FR') {
134 $datefilter = 'bl.date_creation'; // By using this as a filter, it is like the LEFT JOIN is an INNER JOIN
135 $modulesourcefilter = 'bl.module_source';
136 $amountfield = 'bl.amounts';
137 $possource = 'bl.pos_source';
138 $fieldentity = 'bl.entity';
139 $joinleft = '';
140}
141
142// NOTE: This request must use similar fields and filters to the one into cashcontrol_card to count and sum amount
143$sql = "SELECT p.rowid, p.ref as pref, p.datep as datep, cp.code,";
144$sql .= " f.rowid as facid, f.ref, f.datef as datef, ".$db->sanitize($amountfield)." as amount,";
145$sql .= " b.fk_account as bankid,";
146$sql .= " bl.signature";
147$sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f,";
148$sql .= " ".MAIN_DB_PREFIX."paiement as p";
149$sql .= " ".$db->sanitize($joinleft)." JOIN ".MAIN_DB_PREFIX."blockedlog as bl ON bl.action = 'PAYMENT_CUSTOMER_CREATE'";
150$sql .= " AND bl.element = 'payment' AND bl.fk_object = p.rowid AND bl.entity = ".((int) $conf->entity);
151$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank = b.rowid,";
152$sql .= " ".MAIN_DB_PREFIX."c_paiement as cp";
153$sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement";
154$sql .= " AND ".$db->sanitize($modulesourcefilter)." = '".$db->escape($posmodule)."'";
155$sql .= " AND ".$db->sanitize($possource)." = '".$db->escape($terminalid)."'";
156$sql .= " AND ".$db->sanitize($datefilter)." BETWEEN '".$db->idate($dates)."' AND '".$db->idate($datee)."'";
157$sql .= " AND ".$db->sanitize($fieldentity)." = ".((int) $conf->entity); // Never share entities for features related to accountancy
158$sql .= " ORDER BY ".$db->sanitize($datefilter)." ASC, rowid ASC"; // Required so later we can use the parameter $previoushash of checkSignature()
159
160$resql = $db->query($sql);
161if ($resql) {
162 $num = $db->num_rows($resql);
163 $i = 0;
164
165 print "<!-- title of cash control -->\n";
166 print '<!-- We will use this request to find payments: '.dolPrintHTML($sql).' -->';
167 print '<center>';
168 print '<h2>';
169
170 $nameterminal = getDolGlobalString("TAKEPOS_TERMINAL_NAME_".$object->posnumber);
171 print $langs->trans("CashControl")." #".$object->id.(($nameterminal != "TAKEPOS_TERMINAL_NAME_".$object->posnumber) ? '<br>'.$nameterminal : '');
172 if ($object->status == $object::STATUS_DRAFT) {
173 print '<br><span class="opacitymedium small">('.$langs->trans("Draft")." - ".$langs->trans("TheoricalView").")</span>";
174 }
175 print "</h2>";
176 print $mysoc->name;
177 print '<br>'.$langs->trans("DateCreationShort").": ".dol_print_date($object->date_creation, 'dayhour');
178 $userauthor = $object->fk_user_valid;
179 if (empty($userauthor)) {
180 $userauthor = $object->fk_user_creat;
181 }
182
183 $uservalid = new User($db);
184 if ($userauthor > 0) {
185 $uservalid->fetch($userauthor);
186 print ' - '.$langs->trans("Author").': '.$uservalid->getFullName($langs);
187 }
188 print '<br>'.$langs->trans("Period").': '.$object->year_close.($object->month_close ? '-'.sprintf("%02d", $object->month_close) : '').($object->day_close ? '-'.sprintf("%02d", $object->day_close) : '');
189 print '</center>';
190
191 $invoicetmp = new Facture($db);
192
193 if (!$summaryonly) {
194 print "<div style='text-align: right'><h2>";
195 print $langs->trans("InitialBankBalance").' - '.$langs->trans("Cash").' : <div class="inline-block amount width100">'.price($object->opening).'</div>';
196 print "</h2></div>";
197 } else {
198 print '<br>';
199 }
200
201 $param = '&id='.((int) $id);
202 if (GETPOST('contextpage', 'aZ09')) {
203 $param .= '&contextpage='.urlencode(GETPOST('contextpage', 'aZ09'));
204 }
205
206 if (!$summaryonly) {
207 print '<div class="div-table-responsive">';
208 print '<table class="tagtable liste">'."\n";
209
210 // Fields title
211 print '<tr class="liste_titre">';
212 print_liste_field_titre($arrayfields['b.rowid']['label'], $_SERVER['PHP_SELF'], 'f.ref', '', $param, '', $sortfield, $sortorder);
213 print_liste_field_titre($arrayfields['b.dateo']['label'], $_SERVER['PHP_SELF'], 'p.datep', '', $param, '"', $sortfield, $sortorder, 'center ');
214 print_liste_field_titre($arrayfields['ba.ref']['label'], $_SERVER['PHP_SELF'], 'ba.ref', '', $param, '', $sortfield, $sortorder, '');
215 print_liste_field_titre($arrayfields['cp.code']['label'], $_SERVER['PHP_SELF'], 'cp.code', '', $param, '', $sortfield, $sortorder, 'right ');
216 print_liste_field_titre($arrayfields['b.debit']['label'], $_SERVER['PHP_SELF'], 'amount', '', $param, '', $sortfield, $sortorder, 'right ');
217 print_liste_field_titre($arrayfields['b.credit']['label'], $_SERVER['PHP_SELF'], 'amount', '', $param, '', $sortfield, $sortorder, 'right ');
218 print "</tr>\n";
219 }
220
221 // Loop on each record
222 $cash = $bank = $cheque = $other = 0;
223
224 $totalqty = 0;
225 $totalvat = 0;
226 $totalvatperrate = array();
227 $totalhtperrate = array();
228 $totallocaltax1 = 0;
229 $totallocaltax2 = 0;
230 $cachebankaccount = array();
231 $cacheinvoiceid = array();
232 $transactionspertype = array();
233 $amountpertype = array();
234
235 $totalarray = array('nbfield' => 0, 'pos' => array(), 'val' => array('totaldebfield' => 0, 'totalcredfield' => 0));
236 $rowstoprint = array();
237 while ($i < $num) {
238 $objp = $db->fetch_object($resql);
239
240 // Load bankaccount
241 if (empty($cachebankaccount[$objp->bankid])) {
242 $bankaccounttmp = new Account($db);
243 $bankaccounttmp->fetch($objp->bankid);
244 $cachebankaccount[$objp->bankid] = $bankaccounttmp;
245 $bankaccount = $bankaccounttmp;
246 } else {
247 $bankaccount = $cachebankaccount[$objp->bankid];
248 }
249
250 $invoicetmp->fetch($objp->facid);
251
252 if (empty($cacheinvoiceid[$objp->facid])) {
253 $cacheinvoiceid[$objp->facid] = $objp->facid; // First time this invoice is found into list of invoice x payments
254 foreach ($invoicetmp->lines as $line) {
255 $totalqty += $line->qty;
256 $totalvat += $line->total_tva;
257 if ($line->tva_tx) {
258 if (empty($totalvatperrate[$line->tva_tx])) {
259 $totalvatperrate[$line->tva_tx] = 0;
260 $totalhtperrate[$line->tva_tx] = 0;
261 }
262 $totalvatperrate[$line->tva_tx] += $line->total_tva;
263 $totalhtperrate[$line->tva_tx] += $line->total_ht;
264 }
265 $totallocaltax1 += $line->total_localtax1;
266 $totallocaltax2 += $line->total_localtax2;
267 }
268 }
269
270 if ($object->posmodule == "takepos") {
271 $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH'.$object->posnumber;
272 } else {
273 $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH';
274 }
275
276 if ($objp->code == 'CHQ') {
277 $cheque += $objp->amount;
278 if (empty($transactionspertype[$objp->code])) {
279 $transactionspertype[$objp->code] = 0;
280 }
281 $transactionspertype[$objp->code] += 1;
282 } elseif ($objp->code == 'CB') {
283 $bank += $objp->amount;
284 if (empty($transactionspertype[$objp->code])) {
285 $transactionspertype[$objp->code] = 0;
286 }
287 $transactionspertype[$objp->code] += 1;
288 } elseif ($objp->code == 'LIQ') {
289 $cash += $objp->amount;
290 // } elseif (getDolGlobalString($var2) == $bankaccount->id) $bank+=$objp->amount;
291 //elseif (getDolGlobalString($var3) == $bankaccount->id) $cheque+=$objp->amount;
292 if (empty($transactionspertype['CASH'])) {
293 $transactionspertype['CASH'] = 0;
294 }
295 $transactionspertype['CASH'] += 1;
296 } else {
297 if (getDolGlobalString($var1) == $bankaccount->id) {
298 $cash += $objp->amount;
299 // } elseif (getDolGlobalString($var2) == $bankaccount->id) $bank+=$objp->amount;
300 //elseif (getDolGlobalString($var3) == $bankaccount->id) $cheque+=$objp->amount;
301 if (empty($transactionspertype['CASH'])) {
302 $transactionspertype['CASH'] = 0;
303 }
304 $transactionspertype['CASH'] += 1;
305 } else {
306 $other += $objp->amount;
307 if (empty($transactionspertype['OTHER'])) {
308 $transactionspertype['OTHER'] = 0;
309 }
310 $transactionspertype['OTHER'] += 1;
311 }
312 }
313
314 if (empty($amountpertype[$objp->code])) {
315 $amountpertype[$objp->code] = 0;
316 }
317
318 if ($objp->amount < 0) {
319 $amountpertype[$objp->code] += $objp->amount;
320 }
321 if ($objp->amount > 0) {
322 $amountpertype[$objp->code] -= $objp->amount;
323 }
324
325 // List of all invoices
326 if (!$summaryonly) {
327 ob_start();
328 print '<tr class="oddeven">';
329
330 // Ref
331 print '<td class="nowrap left smallheight">';
332 print $invoicetmp->getNomUrl(1);
333 print '<br><span class="small opacitymedium" title="'.$langs->trans("FingerprintInBlockedLog").': '.$objp->signature.'">'.dol_trunc($objp->signature, 16).'</span>';
334 print '</td>';
335 if (!$i) {
336 $totalarray['nbfield']++;
337 }
338
339 // Date ope
340 print '<td class="nowrap center">';
341 print '<span id="dateoperation_'.$objp->facid.'">'.dol_print_date($db->jdate($objp->datep), "day")."</span>";
342 print "</td>\n";
343 if (!$i) {
344 $totalarray['nbfield']++;
345 }
346
347 // Bank account
348 print '<td class="nowrap left">';
349 print $bankaccount->getNomUrl(1);
350 print "</td>\n";
351 if (!$i) {
352 $totalarray['nbfield']++;
353 }
354
355 // Type
356 print '<td class="right">';
357 print $objp->code;
358 print "</td>\n";
359 if (!$i) {
360 $totalarray['nbfield']++;
361 }
362
363 // Debit
364 print '<td class="right">';
365 if ($objp->amount < 0) {
366 print '<span class="amount">'.price($objp->amount * -1).'</span>';
367 $totalarray['val']['totaldebfield'] += $objp->amount;
368 }
369 print "</td>\n";
370 if (!$i) {
371 $totalarray['nbfield']++;
372 }
373 if (!$i) {
374 $totalarray['pos'][$totalarray['nbfield']] = 'totaldebfield';
375 }
376
377 // Credit
378 print '<td class="right">';
379 if ($objp->amount > 0) {
380 print '<span class="amount">'.price($objp->amount).'</span>';
381 $totalarray['val']['totalcredfield'] += $objp->amount;
382 }
383 print "</td>\n";
384 if (!$i) {
385 $totalarray['nbfield']++;
386 }
387 if (!$i) {
388 $totalarray['pos'][$totalarray['nbfield']] = 'totalcredfield';
389 }
390
391 print "</tr>";
392 $rowstoprint[] = array('html' => ob_get_clean(), 'pos' => $i, 'f.ref' => (string) $invoicetmp->ref, 'p.datep' => (int) $db->jdate($objp->datep),
393 'ba.ref' => (string) $bankaccount->ref, 'cp.code' => (string) $objp->code, 'amount' => (float) $objp->amount);
394 }
395
396 $i++;
397 }
398
399 if (!$summaryonly) {
400 // Lines sorted for the display only. Equal values keep the order of the request (chronological).
401 usort(
402 $rowstoprint,
410 function (array $a, array $b) use ($sortfield, $sortorder): int {
411 $cmp = is_string($a[$sortfield]) ? strnatcasecmp($a[$sortfield], $b[$sortfield]) : ($a[$sortfield] <=> $b[$sortfield]);
412 if ($sortorder == 'DESC') {
413 $cmp = -$cmp;
414 }
415 return $cmp ? $cmp : ($a['pos'] <=> $b['pos']);
416 }
417 );
418 foreach ($rowstoprint as $rowtoprint) {
419 print $rowtoprint['html'];
420 }
421
422 // Show total line
423 $moreinfoontotal = ' ('.$num.' '.$langs->trans($num > 1 ? "Invoices" : "Invoice").')'; // Used in the .tpl
424 include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
425
426 print "</table>";
427 print "</div>";
428 }
429
430 //$cash = $amountpertype['LIQ'] + $object->opening;
431 $newcash = price2num($cash + (float) $object->opening, 'MT');
432
433 print '<div style="text-align: right">';
434 print '<h2>';
435
436 print $langs->trans("Cash").(!empty($transactionspertype['CASH']) ? ' ('.$transactionspertype['CASH'].' '.$langs->trans("Payments").')' : '').' : ';
437 if (!$summaryonly) {
438 // Cash is the only row where both boxes carry a value. width100 is set inside a min-width media
439 // query, so below that breakpoint the boxes shrink to their content and the two amounts touch.
440 print '<div class="inline-block amount width100 marginrightonly">'.($cash >= 0 ? '+' : '').price($cash).'</div>';
441 print '<div class="inline-block amount width100">'.price($newcash).'</div>';
442 } else {
443 print '<div class="inline-block amount width100"></div>';
444 print '<div class="inline-block amount width100">'.price($cash).'</div>';
445 }
446 if (!$summaryonly && $object->status == $object::STATUS_CLOSED && price2num($newcash) != price2num((float) $object->cash_declared)) {
447 //$s = '<div class="inline-block amountremaintopay fontsizeunset small">';
448 $s = $langs->trans("Declared").': '.price($object->cash_declared);
449 print img_picto($s, 'warning');
450 }
451 print "<br>";
452
453 //print '<br>';
454 print $langs->trans("PaymentTypeCHQ").(!empty($transactionspertype['CHQ']) ? ' ('.$transactionspertype['CHQ'].' '.$langs->trans("Payments").')' : '').' : ';
455 print '<div class="inline-block amount width100"></div>';
456 print '<div class="inline-block amount width100">'.price($cheque).'</div>';
457 if (!$summaryonly && $object->status == $object::STATUS_CLOSED && price2num($cheque) != price2num((float) $object->cheque_declared)) {
458 //print ' <div class="inline-block amountremaintopay fontsizeunset small"><> '.$langs->trans("Declared").' : '.price($object->cheque_declared).'</div>';
459 $s = $langs->trans("Declared").': '.price($object->cheque_declared);
460 }
461 print "<br>";
462
463 //print '<br>';
464 print $langs->trans("PaymentTypeCB").(!empty($transactionspertype['CB']) ? ' ('.$transactionspertype['CB'].' '.$langs->trans("Payments").')' : '').' : ';
465 print '<div class="inline-block amount width100"></div>';
466 print '<div class="inline-block amount width100">'.price($bank).'</div>';
467 if (!$summaryonly && $object->status == $object::STATUS_CLOSED && price2num($bank) != price2num((float) $object->card_declared)) {
468 //print ' <div class="inline-block amountremaintopay fontsizeunset small"><> '.$langs->trans("Declared").': '.price($object->card_declared).'</div>';
469 $s = $langs->trans("Declared").': '.price($object->card_declared);
470 }
471 print "<br>";
472
473 // print '<br>';
474 if ($other) {
475 print ''.$langs->trans("Other").(!empty($transactionspertype['OTHER']) ? ' ('.$transactionspertype['OTHER'].' '.$langs->trans("Payments").')' : '').' : ';
476 print '<div class="inline-block amount width100"></div>';
477 print '<div class="inline-block amount width100">'.price($other)."</div>";
478 print '<br>';
479 }
480
481
482 print "<br>";
483
484 print $langs->trans("Total").' ('.$totalqty.' '.$langs->trans("Articles").') : <div class="inline-block amount width100"></div><div class="inline-block amount width100">'.price((float) $cash + (float) $cheque + (float) $bank + (float) $other).'</div>';
485
486 print '<br>'.$langs->trans("TotalVAT").' : <div class="inline-block amount width100"></div><div class="inline-block amount width100">'.price($totalvat).'</div>';
487
488 if ($mysoc->useLocalTax(1)) {
489 print '<br>'.$langs->trans("TotalLT1").' : <div class="inline-block amount width100"></div><div class="inline-block amount width100">'.price($totallocaltax1).'</div>';
490 }
491 if ($mysoc->useLocalTax(1)) {
492 print '<br>'.$langs->trans("TotalLT2").' : <div class="inline-block amount width100"></div><div class="inline-block amount width100">'.price($totallocaltax2).'</div>';
493 }
494
495 if (!empty($totalvatperrate) && is_array($totalvatperrate)) {
496 print '<br><br><div class="small inline-block width100">'.$langs->trans("TotalHT").'</div><div class="small inline-block width100">'.$langs->trans("TotalVAT").'</div>';
497 if (getDolGlobalInt('TAKEPOS_CASHCONTROL_REPORT_SHOW_TOTAL_INCLUDING_TAXES_COLUMN', 0) != 0) {
498 print '<div class="small inline-block width100">'.$langs->trans("TotalTTC").'</div>';
499 }
500 foreach ($totalvatperrate as $keyrate => $valuerate) {
501 print '<br><div class="small">'.$langs->trans("VATRate").' '.vatrate($keyrate, true).' : <div class="inline-block amount width100">'.price($totalhtperrate[$keyrate] ?? 0).'</div><div class="inline-block amount width100">'.price($valuerate).'</div>';
502 if (getDolGlobalInt('TAKEPOS_CASHCONTROL_REPORT_SHOW_TOTAL_INCLUDING_TAXES_COLUMN', 0) != 0) {
503 print '<div class="inline-block amount width100">'.price(($totalhtperrate[$keyrate] ?? 0) + $valuerate).'</div>';
504 }
505 print '</div>';
506 }
507 }
508
509 print '</h2>';
510 print '</div>';
511
512 print '</form>';
513
514 $db->free($resql);
515} else {
517}
518
519print '</div>';
520
521llxFooter();
522
523$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
$totalarray
Definition list.php:501
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
isALNERunningVersion($blockedlogtestalreadydone=0, $blockedlogmodulealreadydone=0)
Return if the application is executed with the LNE requirements on.
Class to manage bank accounts.
Class to manage cash fence.
Class to manage invoices.
Class to manage Dolibarr users.
global $mysoc
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition date.lib.php:620
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition date.lib.php:639
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0, $html=0)
Return a string with VAT rate label formatted for view output Used into pdf and HTML pages.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '...' if string larger than length.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.