dolibarr 24.0.0-beta
cabyuser.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
6 * Copyright (C) 2018-2026 Frédéric France <frederic.france@free.fr>
7 * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
8 * Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
29// Load Dolibarr environment
30require '../../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
40require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
41require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
42
43// Load translation files required by the page
44$langs->load("accountancy");
45
46$socid = GETPOSTINT('socid');
47
48// Security check
49if ($user->socid > 0) {
50 $socid = $user->socid;
51}
52$hookmanager->initHooks(['cabyuserreportlist']);
53if (isModEnabled('comptabilite')) {
54 $result = restrictedArea($user, 'compta', '', '', 'resultat');
55}
56if (isModEnabled('accounting')) {
57 $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
58}
59// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
60$modecompta = getDolGlobalString('ACCOUNTING_MODE');
61if (GETPOST("modecompta")) {
62 $modecompta = GETPOST("modecompta");
63}
64
65$sortorder = GETPOST("sortorder", 'aZ09comma');
66$sortfield = GETPOST("sortfield", 'aZ09comma');
67if (!$sortorder) {
68 $sortorder = "asc";
69}
70if (!$sortfield) {
71 $sortfield = "name";
72}
73
74// Date range
75$year = GETPOSTINT("year");
76$month = GETPOSTINT("month");
77$date_startyear = GETPOSTINT("date_startyear");
78$date_startmonth = GETPOSTINT("date_startmonth");
79$date_startday = GETPOSTINT("date_startday");
80$date_endyear = GETPOSTINT("date_endyear");
81$date_endmonth = GETPOSTINT("date_endmonth");
82$date_endday = GETPOSTINT("date_endday");
83if (empty($year)) {
84 $year_current = dol_print_date(dol_now(), '%Y');
85 $month_current = dol_print_date(dol_now(), '%m');
86 $year_start = $year_current;
87} else {
88 $year_current = $year;
89 $month_current = dol_print_date(dol_now(), '%m');
90 $year_start = $year;
91}
92$date_start = dol_mktime(0, 0, 0, GETPOSTINT("date_startmonth"), GETPOSTINT("date_startday"), GETPOSTINT("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
93$date_end = dol_mktime(23, 59, 59, GETPOSTINT("date_endmonth"), GETPOSTINT("date_endday"), GETPOSTINT("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
94// Quarter
95if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
96 $q = GETPOST("q") ? GETPOST("q") : 0;
97 if ($q == 0) {
98 // We define date_start and date_end
99 $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
100 $year_end = $year_start;
101 $month_end = $month_start;
102 if (!GETPOST("month")) { // If month not forced
103 if (!GETPOST('year') && $month_start > $month_current) {
104 $year_start--;
105 $year_end--;
106 }
107 $month_end = $month_start - 1;
108 if ($month_end < 1) {
109 $month_end = 12;
110 } else {
111 $year_end++;
112 }
113 }
114 $date_start = dol_get_first_day($year_start, $month_start, false);
115 $date_end = dol_get_last_day($year_end, $month_end, false);
116 }
117 if ($q == 1) {
118 $date_start = dol_get_first_day($year_start, 1, false);
119 $date_end = dol_get_last_day($year_start, 3, false);
120 }
121 if ($q == 2) {
122 $date_start = dol_get_first_day($year_start, 4, false);
123 $date_end = dol_get_last_day($year_start, 6, false);
124 }
125 if ($q == 3) {
126 $date_start = dol_get_first_day($year_start, 7, false);
127 $date_end = dol_get_last_day($year_start, 9, false);
128 }
129 if ($q == 4) {
130 $date_start = dol_get_first_day($year_start, 10, false);
131 $date_end = dol_get_last_day($year_start, 12, false);
132 }
133} else {
134 // TODO We define q
135}
136// $date_start and $date_end are defined. We force $year_start and $nbofyear
137$tmps = dol_getdate($date_start);
138$year_start = $tmps['year'];
139$tmpe = dol_getdate($date_end);
140$year_end = $tmpe['year'];
141$nbofyear = ($year_end - $year_start) + 1;
142
143$commonparams = array();
144$commonparams['modecompta'] = $modecompta;
145$commonparams['sortorder'] = $sortorder;
146$commonparams['sortfield'] = $sortfield;
147
148$headerparams = array();
149if (!empty($date_startyear)) {
150 $headerparams['date_startyear'] = $date_startyear;
151}
152if (!empty($date_startmonth)) {
153 $headerparams['date_startmonth'] = $date_startmonth;
154}
155if (!empty($date_startday)) {
156 $headerparams['date_startday'] = $date_startday;
157}
158if (!empty($date_endyear)) {
159 $headerparams['date_endyear'] = $date_endyear;
160}
161if (!empty($date_endmonth)) {
162 $headerparams['date_endmonth'] = $date_endmonth;
163}
164if (!empty($date_endday)) {
165 $headerparams['date_endday'] = $date_endday;
166}
167if (!empty($q)) {
168 $headerparams['q'] = $q;
169}
170
171$tableparams = array();
172
173// Adding common parameters
174$allparams = array_merge($commonparams, $headerparams, $tableparams);
175$headerparams = array_merge($commonparams, $headerparams);
176$tableparams = array_merge($commonparams, $tableparams);
177
178$paramslink = "";
179foreach ($allparams as $key => $value) {
180 $paramslink .= '&'.$key.'='.$value;
181}
182
183/*
184 * View
185 */
186
187llxHeader();
188
189$form = new Form($db);
190
191// TODO Report from bookkeeping not yet available, so we switch on report on business events
192if ($modecompta == "BOOKKEEPING") {
193 $modecompta = "CREANCES-DETTES";
194}
195if ($modecompta == "BOOKKEEPINGCOLLECTED") {
196 $modecompta = "RECETTES-DEPENSES";
197}
198
199$exportlink = "";
200$namelink = "";
201$builddate = 0;
202$calcmode = '';
203$name = '';
204$description = '';
205
206// Show report header
207if ($modecompta == "CREANCES-DETTES") {
208 $name = $langs->trans("Turnover").', '.$langs->trans("ByUserAuthorOfInvoice");
209 $calcmode = $langs->trans("CalcModeDebt");
210 //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
211 $description = $langs->trans("RulesCADue");
212 if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
213 $description .= $langs->trans("DepositsAreNotIncluded");
214 } else {
215 $description .= $langs->trans("DepositsAreIncluded");
216 }
217 $builddate = dol_now();
218 //$exportlink=$langs->trans("NotYetAvailable");
219} elseif ($modecompta == "RECETTES-DEPENSES") {
220 $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByUserAuthorOfInvoice");
221 $calcmode = $langs->trans("CalcModePayment");
222 //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
223 $description = $langs->trans("RulesCAIn");
224 $description .= $langs->trans("DepositsAreIncluded");
225 $builddate = dol_now();
226 //$exportlink=$langs->trans("NotYetAvailable");
227} elseif ($modecompta == "BOOKKEEPING") {
228 // TODO
229} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
230 // TODO
231}
232$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
233$period .= ' - ';
234$period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
235if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
236 $periodlink = '<a href="'.$_SERVER["PHP_SELF"].'?year='.($year_start - 1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year_start + 1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
237} else {
238 $periodlink = '';
239}
240
241$moreparam = array();
242if (!empty($modecompta)) {
243 $moreparam['modecompta'] = $modecompta;
244}
245
246report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
247
248if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
249 print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, '1');
250}
251
252
253$name = array();
254
255// Show array
256print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
257print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
258// Extra parameters management
259foreach ($headerparams as $key => $value) {
260 print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
261}
262
263$catotal = 0;
264$catotal_ht = 0;
265$sql = '';
266
267if ($modecompta == 'CREANCES-DETTES') {
268 $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc";
269 $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
270 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid";
271 $sql .= " WHERE f.fk_statut in (1,2)";
272 if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
273 $sql .= " AND f.type IN (0,1,2,5)";
274 } else {
275 $sql .= " AND f.type IN (0,1,2,3,5)";
276 }
277 if ($date_start && $date_end) {
278 $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
279 }
280} elseif ($modecompta == "RECETTES-DEPENSES") {
281 /*
282 * List of payments (old payments are not seen by this query because on older versions,
283 * they were not linked via the table llx_paiement_facture. They are added later)
284 */
285 $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(pf.amount) as amount_ttc";
286 $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
287 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid ";
288 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON pf.fk_facture = f.rowid";
289 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement";
290 $sql .= " WHERE 1=1";
291 if ($date_start && $date_end) {
292 $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
293 }
294} // elseif ($modecompta == "BOOKKEEPING") {
295// } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
296// }
297$sql .= " AND f.entity IN (".getEntity('invoice').")";
298if ($socid) {
299 $sql .= " AND f.fk_soc = ".((int) $socid);
300}
301$sql .= " GROUP BY u.rowid, u.lastname, u.firstname";
302$sql .= " ORDER BY u.rowid";
303
304$amount = array();
305$amount_ht = array();
306
307dol_syslog("cabyuser", LOG_DEBUG);
308$result = $db->query($sql);
309if ($result) {
310 $num = $db->num_rows($result);
311 $i = 0;
312 while ($i < $num) {
313 $obj = $db->fetch_object($result);
314
315 $amount_ht[$obj->rowid] = (empty($obj->amount) ? 0 : $obj->amount);
316 $amount[$obj->rowid] = $obj->amount_ttc;
317 $name[$obj->rowid] = $obj->name.' '.$obj->firstname;
318
319 $catotal_ht += (empty($obj->amount) ? 0 : $obj->amount);
320 $catotal += $obj->amount_ttc;
321 $i++;
322 }
323} else {
325}
326
327// Adding old-version payments, non-bound by table llx_paiement_facture then without User
328if ($modecompta == 'RECETTES-DEPENSES') {
329 $sql = "SELECT -1 as rowidx, '' as name, '' as firstname, sum(DISTINCT p.amount) as amount_ttc";
330 $sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
331 $sql .= ", ".MAIN_DB_PREFIX."bank_account as ba";
332 $sql .= ", ".MAIN_DB_PREFIX."paiement as p";
333 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement";
334 $sql .= " WHERE pf.rowid IS NULL";
335 $sql .= " AND p.fk_bank = b.rowid";
336 $sql .= " AND b.fk_account = ba.rowid";
337 $sql .= " AND ba.entity IN (".getEntity('bank_account').")";
338 if ($date_start && $date_end) {
339 $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
340 }
341 $sql .= " GROUP BY rowidx, name, firstname";
342 $sql .= " ORDER BY rowidx";
343
344 $result = $db->query($sql);
345 if ($result) {
346 $num = $db->num_rows($result);
347 $i = 0;
348 while ($i < $num) {
349 $obj = $db->fetch_object($result);
350 $amount[$obj->rowidx] = $obj->amount_ttc;
351 $name[$obj->rowidx] = $obj->name.' '.$obj->firstname;
352 $catotal += $obj->amount_ttc;
353 $i++;
354 }
355 } else {
357 }
358}
359
360$moreforfilter = '';
361
362print '<div class="div-table-responsive">';
363print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
364
365print "<tr class=\"liste_titre\">";
367 $langs->trans("User"),
368 $_SERVER["PHP_SELF"],
369 "name",
370 "",
371 $paramslink,
372 "",
373 $sortfield,
374 $sortorder
375);
376if ($modecompta == 'CREANCES-DETTES') {
378 $langs->trans('AmountHT'),
379 $_SERVER["PHP_SELF"],
380 "amount_ht",
381 "",
382 $paramslink,
383 'class="right"',
384 $sortfield,
385 $sortorder
386 );
387} else {
389}
391 $langs->trans("AmountTTC"),
392 $_SERVER["PHP_SELF"],
393 "amount_ttc",
394 "",
395 $paramslink,
396 'class="right"',
397 $sortfield,
398 $sortorder
399);
401 $langs->trans("Percentage"),
402 $_SERVER["PHP_SELF"],
403 "amount_ttc",
404 "",
405 $paramslink,
406 'class="right"',
407 $sortfield,
408 $sortorder
409);
411 $langs->trans("OtherStatistics"),
412 $_SERVER["PHP_SELF"],
413 "",
414 "",
415 "",
416 'align="center" width="20%"'
417);
418print "</tr>\n";
419
420if (count($amount)) {
421 $arrayforsort = $name;
422
423 // We define arrayforsort
424 if ($sortfield == 'name' && $sortorder == 'asc') {
425 asort($name);
426 $arrayforsort = $name;
427 }
428 if ($sortfield == 'name' && $sortorder == 'desc') {
429 arsort($name);
430 $arrayforsort = $name;
431 }
432 if ($sortfield == 'amount_ht' && $sortorder == 'asc') {
433 asort($amount_ht);
434 $arrayforsort = $amount_ht;
435 }
436 if ($sortfield == 'amount_ht' && $sortorder == 'desc') {
437 arsort($amount_ht);
438 $arrayforsort = $amount_ht;
439 }
440 if ($sortfield == 'amount_ttc' && $sortorder == 'asc') {
441 asort($amount);
442 $arrayforsort = $amount;
443 }
444 if ($sortfield == 'amount_ttc' && $sortorder == 'desc') {
445 arsort($amount);
446 $arrayforsort = $amount;
447 }
448
449 $i = 0;
450
451 foreach ($arrayforsort as $key => $value) {
452 print '<tr class="oddeven">';
453
454 // Third party
455 $fullname = $name[$key];
456 if ($key >= 0) {
457 $linkname = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$key.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$fullname.'</a>';
458 } else {
459 $linkname = $langs->trans("PaymentsNotLinkedToUser");
460 }
461 print "<td>".$linkname."</td>\n";
462
463 // Amount w/o VAT
464 print '<td class="right">';
465 if ($modecompta == 'RECETTES-DEPENSES') {
466 if ($key > 0) {
467 //print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid='.$key.'">';
468 } else {
469 //print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid=-1">';
470 }
471 } elseif ($modecompta == 'CREANCES-DETTES') {
472 if ($key > 0) {
473 print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?userid='.$key.'">';
474 } else {
475 //print '<a href="#">';
476 }
477 print price($amount_ht[$key]);
478 if ($key > 0) {
479 print '</a>';
480 }
481 }
482 print '</td>';
483
484 // Amount with VAT
485 print '<td class="right">';
486 if ($modecompta == 'RECETTES-DEPENSES') {
487 if ($key > 0) {
488 //print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid='.$key.'">';
489 } else {
490 //print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid=-1">';
491 }
492 } elseif ($modecompta == 'CREANCES-DETTES') {
493 if ($key > 0) {
494 print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?userid='.$key.'">';
495 } else {
496 //print '<a href="#">';
497 }
498 }
499 print price($amount[$key]);
500 if ($modecompta == 'RECETTES-DEPENSES') {
501 if ($key > 0) {
502 //print '</a>';
503 } else {
504 //print '</a>';
505 }
506 } elseif ($modecompta == 'CREANCES-DETTES') {
507 if ($key > 0) {
508 print '</a>';
509 }
510 }
511 print '</td>';
512
513 // Percent
514 print '<td class="right">'.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : '&nbsp;').'</td>';
515
516 // Other stats
517 print '<td class="center">';
518 if (isModEnabled("propal") && $key > 0) {
519 print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
520 }
521 if (isModEnabled('order') && $key > 0) {
522 print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a>&nbsp;';
523 }
524 if (isModEnabled('invoice') && $key > 0) {
525 print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a>&nbsp;';
526 }
527 print '</td>';
528 print "</tr>\n";
529 $i++;
530 }
531
532 // Total
533 print '<tr class="liste_total">';
534 print '<td>'.$langs->trans("Total").'</td>';
535 if ($modecompta != 'CREANCES-DETTES') {
536 print '<td></td>';
537 } else {
538 print '<td class="right">'.price($catotal_ht).'</td>';
539 }
540 print '<td class="right">'.price($catotal).'</td>';
541 print '<td>&nbsp;</td>';
542 print '<td>&nbsp;</td>';
543 print '</tr>';
544
545 $db->free($result);
546}
547
548print "</table>";
549print '</div>';
550print '</form>';
551
552// End of page
553llxFooter();
554$db->close();
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
Class to manage generation of HTML components Only common components must be here.
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_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
Definition date.lib.php:126
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 $db
API class for accounts.
$date_start
Variables from include:
dol_now($mode='gmt')
Return date for now.
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...
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)
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='')
Show information in HTML for admin users or standard users.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
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.
img_previous($titlealt='default', $moreatt='')
Show previous logo.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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...
img_next($titlealt='default', $moreatt='')
Show next logo.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='')
Show header of a report.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.