dolibarr 24.0.0-beta
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 = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
67$sortorder = 'ASC';
68$sortfield = 'b.datev,b.dateo,b.rowid';
69
70$arrayfields = array(
71 'b.rowid' => array('label' => $langs->trans("Ref"), 'checked' => 1),
72 'b.dateo' => array('label' => $langs->trans("DateOperationShort"), 'checked' => 1),
73 'b.num_chq' => array('label' => $langs->trans("Number"), 'checked' => 1),
74 'ba.ref' => array('label' => $langs->trans("BankAccount"), 'checked' => 1),
75 'cp.code' => array('label' => $langs->trans("PaymentMode"), 'checked' => 1),
76 'b.debit' => array('label' => $langs->trans("Debit"), 'checked' => 1, 'position' => 600),
77 'b.credit' => array('label' => $langs->trans("Credit"), 'checked' => 1, 'position' => 605),
78);
79
80$syear = $object->year_close;
81$smonth = $object->month_close;
82$sday = $object->day_close;
83
84$posmodule = $object->posmodule;
85$terminalid = $object->posnumber;
86
87// Security check
88if ($user->socid > 0) { // Protection if external user
89 //$socid = $user->socid;
91}
92if (!$user->hasRight('cashdesk', 'run') && !$user->hasRight('takepos', 'run')) {
94}
95
96
97/*
98 * View
99 */
100
101$title = $langs->trans("CashControl");
102$param = '';
103
104$conf->dol_hide_topmenu = 1;
105$conf->dol_hide_leftmenu = 1;
106
107llxHeader('', $title, '', '', 0, 0, array(), array(), $param);
108
109print '<!-- Begin div id-container --><div id="id-container" class="id-container centpercent">';
110
111$dates = $datee = 0;
112
113if ($syear && !$smonth) {
114 $dates = dol_get_first_day($syear, 1); $datee = dol_get_last_day($syear, 12);
115} elseif ($syear && $smonth && !$sday) {
116 $dates = dol_get_first_day($syear, $smonth); $datee = dol_get_last_day($syear, $smonth);
117} elseif ($syear && $smonth && $sday) {
118 $dates = dol_mktime(0, 0, 0, $smonth, $sday, $syear); $datee = dol_mktime(23, 59, 59, $smonth, $sday, $syear);
119} else {
120 dol_print_error(null, 'Year not defined');
121}
122$datefilter = 'p.datep';
123$modulesourcefilter = 'f.module_source';
124$amountfield = 'pf.amount';
125$possource = 'f.pos_source';
126$fieldentity = 'p.entity';
127$joinleft = 'LEFT ';
128if (isALNERunningVersion() && $mysoc->country_code == 'FR') {
129 $datefilter = 'bl.date_creation'; // By using this as a filter, it is like the LEFT JOIN is an INNER JOIN
130 $modulesourcefilter = 'bl.module_source';
131 $amountfield = 'bl.amounts';
132 $possource = 'bl.pos_source';
133 $fieldentity = 'bl.entity';
134 $joinleft = '';
135}
136
137// NOTE: This request must use similar fields and filters to the one into cashcontrol_card to count and sum amount
138$sql = "SELECT p.rowid, p.ref as pref, p.datep as datep, cp.code,";
139$sql .= " f.rowid as facid, f.ref, f.datef as datef, ".$db->sanitize($amountfield)." as amount,";
140$sql .= " b.fk_account as bankid,";
141$sql .= " bl.signature";
142$sql .= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf, ".MAIN_DB_PREFIX."facture as f,";
143$sql .= " ".MAIN_DB_PREFIX."paiement as p";
144$sql .= " ".$db->sanitize($joinleft)." JOIN ".MAIN_DB_PREFIX."blockedlog as bl ON bl.action = 'PAYMENT_CUSTOMER_CREATE'";
145$sql .= " AND bl.element = 'payment' AND bl.fk_object = p.rowid AND bl.entity = ".((int) $conf->entity);
146$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank = b.rowid,";
147$sql .= " ".MAIN_DB_PREFIX."c_paiement as cp";
148$sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id = p.fk_paiement";
149$sql .= " AND ".$db->sanitize($modulesourcefilter)." = '".$db->escape($posmodule)."'";
150$sql .= " AND ".$db->sanitize($possource)." = '".$db->escape($terminalid)."'";
151$sql .= " AND ".$db->sanitize($datefilter)." BETWEEN '".$db->idate($dates)."' AND '".$db->idate($datee)."'";
152$sql .= " AND ".$db->sanitize($fieldentity)." = ".((int) $conf->entity); // Never share entities for features related to accountancy
153$sql .= " ORDER BY ".$db->sanitize($datefilter)." ASC, rowid ASC"; // Required so later we can use the parameter $previoushash of checkSignature()
154
155$resql = $db->query($sql);
156if ($resql) {
157 $num = $db->num_rows($resql);
158 $i = 0;
159
160 print "<!-- title of cash control -->\n";
161 print '<!-- We will use this request to find payments: '.dolPrintHTML($sql).' -->';
162 print '<center>';
163 print '<h2>';
164
165 $nameterminal = getDolGlobalString("TAKEPOS_TERMINAL_NAME_".$object->posnumber);
166 print $langs->trans("CashControl")." #".$object->id.(($nameterminal != "TAKEPOS_TERMINAL_NAME_".$object->posnumber) ? '<br>'.$nameterminal : '');
167 if ($object->status == $object::STATUS_DRAFT) {
168 print '<br><span class="opacitymedium small">('.$langs->trans("Draft")." - ".$langs->trans("TheoricalView").")</span>";
169 }
170 print "</h2>";
171 print $mysoc->name;
172 print '<br>'.$langs->trans("DateCreationShort").": ".dol_print_date($object->date_creation, 'dayhour');
173 $userauthor = $object->fk_user_valid;
174 if (empty($userauthor)) {
175 $userauthor = $object->fk_user_creat;
176 }
177
178 $uservalid = new User($db);
179 if ($userauthor > 0) {
180 $uservalid->fetch($userauthor);
181 print ' - '.$langs->trans("Author").': '.$uservalid->getFullName($langs);
182 }
183 print '<br>'.$langs->trans("Period").': '.$object->year_close.($object->month_close ? '-'.sprintf("%02d", $object->month_close) : '').($object->day_close ? '-'.sprintf("%02d", $object->day_close) : '');
184 print '</center>';
185
186 $invoicetmp = new Facture($db);
187
188 if (!$summaryonly) {
189 print "<div style='text-align: right'><h2>";
190 print $langs->trans("InitialBankBalance").' - '.$langs->trans("Cash").' : <div class="inline-block amount width100">'.price($object->opening).'</div>';
191 print "</h2></div>";
192 } else {
193 print '<br>';
194 }
195
196 $param = '';
197
198 if (!$summaryonly) {
199 print '<div class="div-table-responsive">';
200 print '<table class="tagtable liste">'."\n";
201
202 // Fields title
203 print '<tr class="liste_titre">';
204 print_liste_field_titre($arrayfields['b.rowid']['label'], $_SERVER['PHP_SELF'], 'b.rowid', '', $param, '', $sortfield, $sortorder);
205 print_liste_field_titre($arrayfields['b.dateo']['label'], $_SERVER['PHP_SELF'], 'b.dateo', '', $param, '"', $sortfield, $sortorder, 'center ');
206 print_liste_field_titre($arrayfields['ba.ref']['label'], $_SERVER['PHP_SELF'], 'ba.ref', '', $param, '', $sortfield, $sortorder, '');
207 print_liste_field_titre($arrayfields['cp.code']['label'], $_SERVER['PHP_SELF'], 'cp.code', '', $param, '', $sortfield, $sortorder, 'right ');
208 print_liste_field_titre($arrayfields['b.debit']['label'], $_SERVER['PHP_SELF'], 'b.amount', '', $param, '', $sortfield, $sortorder, 'right ');
209 print_liste_field_titre($arrayfields['b.credit']['label'], $_SERVER['PHP_SELF'], 'b.amount', '', $param, '', $sortfield, $sortorder, 'right ');
210 print "</tr>\n";
211 }
212
213 // Loop on each record
214 $cash = $bank = $cheque = $other = 0;
215
216 $totalqty = 0;
217 $totalvat = 0;
218 $totalvatperrate = array();
219 $totalhtperrate = array();
220 $totallocaltax1 = 0;
221 $totallocaltax2 = 0;
222 $cachebankaccount = array();
223 $cacheinvoiceid = array();
224 $transactionspertype = array();
225 $amountpertype = array();
226
227 $totalarray = array('nbfield' => 0, 'pos' => array(), 'val' => array('totaldebfield' => 0, 'totalcredfield' => 0));
228 while ($i < $num) {
229 $objp = $db->fetch_object($resql);
230
231 // Load bankaccount
232 if (empty($cachebankaccount[$objp->bankid])) {
233 $bankaccounttmp = new Account($db);
234 $bankaccounttmp->fetch($objp->bankid);
235 $cachebankaccount[$objp->bankid] = $bankaccounttmp;
236 $bankaccount = $bankaccounttmp;
237 } else {
238 $bankaccount = $cachebankaccount[$objp->bankid];
239 }
240
241 $invoicetmp->fetch($objp->facid);
242
243 if (empty($cacheinvoiceid[$objp->facid])) {
244 $cacheinvoiceid[$objp->facid] = $objp->facid; // First time this invoice is found into list of invoice x payments
245 foreach ($invoicetmp->lines as $line) {
246 $totalqty += $line->qty;
247 $totalvat += $line->total_tva;
248 if ($line->tva_tx) {
249 if (empty($totalvatperrate[$line->tva_tx])) {
250 $totalvatperrate[$line->tva_tx] = 0;
251 $totalhtperrate[$line->tva_tx] = 0;
252 }
253 $totalvatperrate[$line->tva_tx] += $line->total_tva;
254 $totalhtperrate[$line->tva_tx] += $line->total_ht;
255 }
256 $totallocaltax1 += $line->total_localtax1;
257 $totallocaltax2 += $line->total_localtax2;
258 }
259 }
260
261 if ($object->posmodule == "takepos") {
262 $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH'.$object->posnumber;
263 } else {
264 $var1 = 'CASHDESK_ID_BANKACCOUNT_CASH';
265 }
266
267 if ($objp->code == 'CHQ') {
268 $cheque += $objp->amount;
269 if (empty($transactionspertype[$objp->code])) {
270 $transactionspertype[$objp->code] = 0;
271 }
272 $transactionspertype[$objp->code] += 1;
273 } elseif ($objp->code == 'CB') {
274 $bank += $objp->amount;
275 if (empty($transactionspertype[$objp->code])) {
276 $transactionspertype[$objp->code] = 0;
277 }
278 $transactionspertype[$objp->code] += 1;
279 } elseif ($objp->code == 'LIQ') {
280 $cash += $objp->amount;
281 // } elseif (getDolGlobalString($var2) == $bankaccount->id) $bank+=$objp->amount;
282 //elseif (getDolGlobalString($var3) == $bankaccount->id) $cheque+=$objp->amount;
283 if (empty($transactionspertype['CASH'])) {
284 $transactionspertype['CASH'] = 0;
285 }
286 $transactionspertype['CASH'] += 1;
287 } else {
288 if (getDolGlobalString($var1) == $bankaccount->id) {
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 $other += $objp->amount;
298 if (empty($transactionspertype['OTHER'])) {
299 $transactionspertype['OTHER'] = 0;
300 }
301 $transactionspertype['OTHER'] += 1;
302 }
303 }
304
305 if (empty($amountpertype[$objp->code])) {
306 $amountpertype[$objp->code] = 0;
307 }
308
309 if ($objp->amount < 0) {
310 $amountpertype[$objp->code] += $objp->amount;
311 }
312 if ($objp->amount > 0) {
313 $amountpertype[$objp->code] -= $objp->amount;
314 }
315
316 // List of all invoices
317 if (!$summaryonly) {
318 print '<tr class="oddeven">';
319
320 // Ref
321 print '<td class="nowrap left smallheight">';
322 print $invoicetmp->getNomUrl(1);
323 print '<br><span class="small opacitymedium" title="'.$langs->trans("FingerprintInBlockedLog").': '.$objp->signature.'">'.dol_trunc($objp->signature, 16).'</span>';
324 print '</td>';
325 if (!$i) {
326 $totalarray['nbfield']++;
327 }
328
329 // Date ope
330 print '<td class="nowrap center">';
331 print '<span id="dateoperation_'.$objp->facid.'">'.dol_print_date($db->jdate($objp->datep), "day")."</span>";
332 print "</td>\n";
333 if (!$i) {
334 $totalarray['nbfield']++;
335 }
336
337 // Bank account
338 print '<td class="nowrap left">';
339 print $bankaccount->getNomUrl(1);
340 print "</td>\n";
341 if (!$i) {
342 $totalarray['nbfield']++;
343 }
344
345 // Type
346 print '<td class="right">';
347 print $objp->code;
348 print "</td>\n";
349 if (!$i) {
350 $totalarray['nbfield']++;
351 }
352
353 // Debit
354 print '<td class="right">';
355 if ($objp->amount < 0) {
356 print '<span class="amount">'.price($objp->amount * -1).'</span>';
357 $totalarray['val']['totaldebfield'] += $objp->amount;
358 }
359 print "</td>\n";
360 if (!$i) {
361 $totalarray['nbfield']++;
362 }
363 if (!$i) {
364 $totalarray['pos'][$totalarray['nbfield']] = 'totaldebfield';
365 }
366
367 // Credit
368 print '<td class="right">';
369 if ($objp->amount > 0) {
370 print '<span class="amount">'.price($objp->amount).'</span>';
371 $totalarray['val']['totalcredfield'] += $objp->amount;
372 }
373 print "</td>\n";
374 if (!$i) {
375 $totalarray['nbfield']++;
376 }
377 if (!$i) {
378 $totalarray['pos'][$totalarray['nbfield']] = 'totalcredfield';
379 }
380
381 print "</tr>";
382 }
383
384 $i++;
385 }
386
387 if (!$summaryonly) {
388 // Show total line
389 $moreinfoontotal = ' ('.$num.' '.$langs->trans($num > 1 ? "Invoices" : "Invoice").')'; // Used in the .tpl
390 include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
391
392 print "</table>";
393 print "</div>";
394 }
395
396 //$cash = $amountpertype['LIQ'] + $object->opening;
397 $newcash = price2num($cash + (float) $object->opening, 'MT');
398
399 print '<div style="text-align: right">';
400 print '<h2>';
401
402 print $langs->trans("Cash").(!empty($transactionspertype['CASH']) ? ' ('.$transactionspertype['CASH'].' '.$langs->trans("Payments").')' : '').' : ';
403 if (!$summaryonly) {
404 print '<div class="inline-block amount width100">'.($cash >= 0 ? '+' : '').price($cash).'</div>';
405 print '<div class="inline-block amount width100">'.price($newcash).'</div>';
406 } else {
407 print '<div class="inline-block amount width100"></div>';
408 print '<div class="inline-block amount width100">'.price($cash).'</div>';
409 }
410 if (!$summaryonly && $object->status == $object::STATUS_CLOSED && price2num($newcash) != price2num((float) $object->cash_declared)) {
411 //$s = '<div class="inline-block amountremaintopay fontsizeunset small">';
412 $s = $langs->trans("Declared").': '.price($object->cash_declared);
413 print img_picto($s, 'warning');
414 }
415 print "<br>";
416
417 //print '<br>';
418 print $langs->trans("PaymentTypeCHQ").(!empty($transactionspertype['CHQ']) ? ' ('.$transactionspertype['CHQ'].' '.$langs->trans("Payments").')' : '').' : ';
419 print '<div class="inline-block amount width100"></div>';
420 print '<div class="inline-block amount width100">'.price($cheque).'</div>';
421 if (!$summaryonly && $object->status == $object::STATUS_CLOSED && price2num($cheque) != price2num((float) $object->cheque_declared)) {
422 //print ' <div class="inline-block amountremaintopay fontsizeunset small"><> '.$langs->trans("Declared").' : '.price($object->cheque_declared).'</div>';
423 $s = $langs->trans("Declared").': '.price($object->cheque_declared);
424 }
425 print "<br>";
426
427 //print '<br>';
428 print $langs->trans("PaymentTypeCB").(!empty($transactionspertype['CB']) ? ' ('.$transactionspertype['CB'].' '.$langs->trans("Payments").')' : '').' : ';
429 print '<div class="inline-block amount width100"></div>';
430 print '<div class="inline-block amount width100">'.price($bank).'</div>';
431 if (!$summaryonly && $object->status == $object::STATUS_CLOSED && price2num($bank) != price2num((float) $object->card_declared)) {
432 //print ' <div class="inline-block amountremaintopay fontsizeunset small"><> '.$langs->trans("Declared").': '.price($object->card_declared).'</div>';
433 $s = $langs->trans("Declared").': '.price($object->card_declared);
434 }
435 print "<br>";
436
437 // print '<br>';
438 if ($other) {
439 print ''.$langs->trans("Other").(!empty($transactionspertype['OTHER']) ? ' ('.$transactionspertype['OTHER'].' '.$langs->trans("Payments").')' : '').' : ';
440 print '<div class="inline-block amount width100"></div>';
441 print '<div class="inline-block amount width100">'.price($other)."</div>";
442 print '<br>';
443 }
444
445
446 print "<br>";
447
448 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>';
449
450 print '<br>'.$langs->trans("TotalVAT").' : <div class="inline-block amount width100"></div><div class="inline-block amount width100">'.price($totalvat).'</div>';
451
452 if ($mysoc->useLocalTax(1)) {
453 print '<br>'.$langs->trans("TotalLT1").' : <div class="inline-block amount width100"></div><div class="inline-block amount width100">'.price($totallocaltax1).'</div>';
454 }
455 if ($mysoc->useLocalTax(1)) {
456 print '<br>'.$langs->trans("TotalLT2").' : <div class="inline-block amount width100"></div><div class="inline-block amount width100">'.price($totallocaltax2).'</div>';
457 }
458
459 if (!empty($totalvatperrate) && is_array($totalvatperrate)) {
460 print '<br><br><div class="small inline-block width100">'.$langs->trans("TotalHT").'</div><div class="small inline-block width100">'.$langs->trans("TotalVAT").'</div>';
461 if (getDolGlobalInt('TAKEPOS_CASHCONTROL_REPORT_SHOW_TOTAL_INCLUDING_TAXES_COLUMN', 0) != 0) {
462 print '<div class="small inline-block width100">'.$langs->trans("TotalTTC").'</div>';
463 }
464 foreach ($totalvatperrate as $keyrate => $valuerate) {
465 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>';
466 if (getDolGlobalInt('TAKEPOS_CASHCONTROL_REPORT_SHOW_TOTAL_INCLUDING_TAXES_COLUMN', 0) != 0) {
467 print '<div class="inline-block amount width100">'.price(($totalhtperrate[$keyrate] ?? 0) + $valuerate).'</div>';
468 }
469 print '</div>';
470 }
471 }
472
473 print '</h2>';
474 print '</div>';
475
476 print '</form>';
477
478 $db->free($resql);
479} else {
481}
482
483print '</div>';
484
485llxFooter();
486
487$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:497
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:604
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition date.lib.php:623
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)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
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.