dolibarr 19.0.4
cabyprodserv.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
3 * Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
5 * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
6 * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
27// Load Dolibarr environment
28require '../../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
33require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
34
35// Load translation files required by the page
36$langs->loadLangs(array("products", "categories", "errors", 'accountancy'));
37
38// Security pack (data & check)
39$socid = GETPOST('socid', 'int');
40
41if ($user->socid > 0) {
42 $socid = $user->socid;
43}
44if (isModEnabled('comptabilite')) {
45 $result = restrictedArea($user, 'compta', '', '', 'resultat');
46}
47if (isModEnabled('accounting')) {
48 $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
49}
50
51// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
52$modecompta = $conf->global->ACCOUNTING_MODE;
53if (GETPOST("modecompta")) {
54 $modecompta = GETPOST("modecompta");
55}
56
57$sortorder = GETPOST("sortorder", 'aZ09comma');
58$sortfield = GETPOST("sortfield", 'aZ09comma');
59if (!$sortorder) {
60 $sortorder = "asc";
61}
62if (!$sortfield) {
63 $sortfield = "ref";
64}
65
66// Category
67$selected_cat = (int) GETPOST('search_categ', 'int');
68$selected_soc = (int) GETPOST('search_soc', 'int');
69$subcat = false;
70if (GETPOST('subcat', 'alpha') === 'yes') {
71 $subcat = true;
72}
73$categorie = new Categorie($db);
74
75// product/service
76$selected_type = GETPOST('search_type', 'int');
77if ($selected_type == '') {
78 $selected_type = -1;
79}
80
81// Hook
82$hookmanager->initHooks(array('cabyprodservlist'));
83
84// Date range
85$year = GETPOST("year");
86$month = GETPOST("month");
87$date_startyear = GETPOST("date_startyear");
88$date_startmonth = GETPOST("date_startmonth");
89$date_startday = GETPOST("date_startday");
90$date_endyear = GETPOST("date_endyear");
91$date_endmonth = GETPOST("date_endmonth");
92$date_endday = GETPOST("date_endday");
93if (empty($year)) {
94 $year_current = dol_print_date(dol_now(), '%Y');
95 $month_current = dol_print_date(dol_now(), '%m');
96 $year_start = $year_current;
97} else {
98 $year_current = $year;
99 $month_current = dol_print_date(dol_now(), '%m');
100 $year_start = $year;
101}
102$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
103$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
104// Quarter
105if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
106 $q = GETPOST("q", "int");
107 if (empty($q)) {
108 // We define date_start and date_end
109 $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
110 $year_end = $year_start;
111 $month_end = $month_start;
112 if (!GETPOST("month")) { // If month not forced
113 if (!GETPOST('year') && $month_start > $month_current) {
114 $year_start--;
115 $year_end--;
116 }
117 $month_end = $month_start - 1;
118 if ($month_end < 1) {
119 $month_end = 12;
120 } else {
121 $year_end++;
122 }
123 }
124 $date_start = dol_get_first_day($year_start, $month_start, false);
125 $date_end = dol_get_last_day($year_end, $month_end, false);
126 } else {
127 if ($q == 1) {
128 $date_start = dol_get_first_day($year_start, 1, false);
129 $date_end = dol_get_last_day($year_start, 3, false);
130 }
131 if ($q == 2) {
132 $date_start = dol_get_first_day($year_start, 4, false);
133 $date_end = dol_get_last_day($year_start, 6, false);
134 }
135 if ($q == 3) {
136 $date_start = dol_get_first_day($year_start, 7, false);
137 $date_end = dol_get_last_day($year_start, 9, false);
138 }
139 if ($q == 4) {
140 $date_start = dol_get_first_day($year_start, 10, false);
141 $date_end = dol_get_last_day($year_start, 12, false);
142 }
143 }
144} else {
145 // TODO We define q
146}
147
148// $date_start and $date_end are defined. We force $year_start and $nbofyear
149$tmps = dol_getdate($date_start);
150$year_start = $tmps['year'];
151$tmpe = dol_getdate($date_end);
152$year_end = $tmpe['year'];
153$nbofyear = ($year_end - $year_start) + 1;
154
155$commonparams = array();
156if (!empty($modecompta)) {
157 $commonparams['modecompta'] = $modecompta;
158}
159if (!empty($sortorder)) {
160 $commonparams['sortorder'] = $sortorder;
161}
162if (!empty($sortfield)) {
163 $commonparams['sortfield'] = $sortfield;
164}
165
166$headerparams = array();
167if (!empty($date_startyear)) {
168 $headerparams['date_startyear'] = $date_startyear;
169}
170if (!empty($date_startmonth)) {
171 $headerparams['date_startmonth'] = $date_startmonth;
172}
173if (!empty($date_startday)) {
174 $headerparams['date_startday'] = $date_startday;
175}
176if (!empty($date_endyear)) {
177 $headerparams['date_endyear'] = $date_endyear;
178}
179if (!empty($date_endmonth)) {
180 $headerparams['date_endmonth'] = $date_endmonth;
181}
182if (!empty($date_endday)) {
183 $headerparams['date_endday'] = $date_endday;
184}
185if (!empty($year)) {
186 $headerparams['year'] = $year;
187}
188if (!empty($month)) {
189 $headerparams['month'] = $month;
190}
191if (!empty($q)) {
192 $headerparams['q'] = $q;
193}
194
195$tableparams = array();
196if (!empty($selected_cat)) {
197 $tableparams['search_categ'] = $selected_cat;
198}
199if (!empty($selected_soc)) {
200 $tableparams['search_soc'] = $selected_soc;
201}
202if (!empty($selected_type)) {
203 $tableparams['search_type'] = $selected_type;
204}
205$tableparams['subcat'] = ($subcat === true) ? 'yes' : '';
206
207// Adding common parameters
208$allparams = array_merge($commonparams, $headerparams, $tableparams);
209$headerparams = array_merge($commonparams, $headerparams);
210$tableparams = array_merge($commonparams, $tableparams);
211
212$paramslink="";
213foreach ($allparams as $key => $value) {
214 $paramslink .= '&'.$key.'='.$value;
215}
216
217
218/*
219 * View
220 */
221
222llxHeader();
223
224$form = new Form($db);
225$formother = new FormOther($db);
226
227// TODO Report from bookkeeping not yet available, so we switch on report on business events
228if ($modecompta == "BOOKKEEPING") {
229 $modecompta = "CREANCES-DETTES";
230}
231if ($modecompta == "BOOKKEEPINGCOLLECTED") {
232 $modecompta = "RECETTES-DEPENSES";
233}
234
235$exportlink="";
236$namelink="";
237
238// Show report header
239if ($modecompta == "CREANCES-DETTES") {
240 $name = $langs->trans("Turnover").', '.$langs->trans("ByProductsAndServices");
241 $calcmode = $langs->trans("CalcModeDebt");
242 //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
243
244 $description = $langs->trans("RulesCADue");
245 if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
246 $description .= $langs->trans("DepositsAreNotIncluded");
247 } else {
248 $description .= $langs->trans("DepositsAreIncluded");
249 }
250 $builddate = dol_now();
251} elseif ($modecompta == "RECETTES-DEPENSES") {
252 $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByProductsAndServices");
253 $calcmode = $langs->trans("CalcModeEngagement");
254 //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
255
256 $description = $langs->trans("RulesCAIn");
257 $description .= $langs->trans("DepositsAreIncluded");
258
259 $builddate = dol_now();
260} elseif ($modecompta == "BOOKKEEPING") {
261} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
262}
263
264$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
265$period .= ' - ';
266$period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
267if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
268 $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>';
269} else {
270 $periodlink = '';
271}
272
273report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode);
274
275if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
276 print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
277}
278
279
280
281$name = array();
282
283// SQL request
284$catotal = 0;
285$catotal_ht = 0;
286$qtytotal = 0;
287
288if ($modecompta == 'CREANCES-DETTES') {
289 $sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label, p.fk_product_type as product_type,";
290 $sql .= " SUM(l.total_ht) as amount, SUM(l.total_ttc) as amount_ttc,";
291 $sql .= " SUM(CASE WHEN f.type = 2 THEN -l.qty ELSE l.qty END) as qty";
292
293 $parameters = array();
294 $hookmanager->executeHooks('printFieldListSelect', $parameters);
295 $sql .= $hookmanager->resPrint;
296
297 $sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
298 if ($selected_soc > 0) {
299 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc ON (soc.rowid = f.fk_soc)";
300 }
301 $sql .= ",".MAIN_DB_PREFIX."facturedet as l";
302 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid";
303 if ($selected_cat === -2) { // Without any category
304 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";
305 }
306
307 $parameters = array();
308 $hookmanager->executeHooks('printFieldListFrom', $parameters);
309 $sql .= $hookmanager->resPrint;
310
311 $sql .= " WHERE l.fk_facture = f.rowid";
312 $sql .= " AND f.fk_statut in (1,2)";
313 $sql .= " AND l.product_type in (0,1)";
314 if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
315 $sql .= " AND f.type IN (0,1,2,5)";
316 } else {
317 $sql .= " AND f.type IN (0,1,2,3,5)";
318 }
319 if ($date_start && $date_end) {
320 $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
321 }
322 if ($selected_type >= 0) {
323 $sql .= " AND l.product_type = ".((int) $selected_type);
324 }
325 if ($selected_cat === -2) { // Without any category
326 $sql .= " AND cp.fk_product is null";
327 } elseif ($selected_cat > 0) { // Into a specific category
328 if ($subcat) {
329 $TListOfCats = $categorie->get_full_arbo('product', $selected_cat, 1);
330
331 $listofcatsql = "";
332 foreach ($TListOfCats as $key => $cat) {
333 if ($key !== 0) {
334 $listofcatsql .= ",";
335 }
336 $listofcatsql .= $cat['rowid'];
337 }
338 }
339
340 $sql .= " AND (p.rowid IN ";
341 $sql .= " (SELECT fk_product FROM ".MAIN_DB_PREFIX."categorie_product cp WHERE ";
342 if ($subcat) {
343 $sql .= "cp.fk_categorie IN (".$db->sanitize($listofcatsql).")";
344 } else {
345 $sql .= "cp.fk_categorie = ".((int) $selected_cat);
346 }
347 $sql .= "))";
348 }
349 if ($selected_soc > 0) {
350 $sql .= " AND soc.rowid=".((int) $selected_soc);
351 }
352 $sql .= " AND f.entity IN (".getEntity('invoice').")";
353
354 $parameters = array();
355 $hookmanager->executeHooks('printFieldListWhere', $parameters);
356 $sql .= $hookmanager->resPrint;
357
358 $sql .= " GROUP BY p.rowid, p.ref, p.label, p.fk_product_type";
359 $sql .= $db->order($sortfield, $sortorder);
360
361 dol_syslog("cabyprodserv", LOG_DEBUG);
362 $result = $db->query($sql);
363 if ($result) {
364 $num = $db->num_rows($result);
365 $i = 0;
366 while ($i < $num) {
367 $obj = $db->fetch_object($result);
368 $amount_ht[$obj->rowid] = $obj->amount;
369 $amount[$obj->rowid] = $obj->amount_ttc;
370 $qty[$obj->rowid] = $obj->qty;
371 $name[$obj->rowid] = $obj->ref.'&nbsp;-&nbsp;'.$obj->label;
372 $type[$obj->rowid] = $obj->product_type;
373 $catotal_ht += $obj->amount;
374 $catotal += $obj->amount_ttc;
375 $qtytotal += $obj->qty;
376 $i++;
377 }
378 } else {
379 dol_print_error($db);
380 }
381
382 // Show Array
383 $i = 0;
384 print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
385 print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
386 // Extra parameters management
387 foreach ($headerparams as $key => $value) {
388 print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
389 }
390
391 $moreforfilter = '';
392
393 print '<div class="div-table-responsive">';
394 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
395
396 // Category filter
397 print '<tr class="liste_titre">';
398 print '<td>';
399 print img_picto('', 'category', 'class="paddingrightonly"');
400 print $formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', 0, $langs->trans("Category"));
401 print ' ';
402 print $langs->trans("SubCats").'? ';
403 print '<input type="checkbox" name="subcat" value="yes"';
404 if ($subcat) {
405 print ' checked';
406 }
407 print '>';
408 // type filter (produit/service)
409 print ' ';
410 print $langs->trans("Type").': ';
411 $form->select_type_of_lines(isset($selected_type) ? $selected_type : -1, 'search_type', 1, 1, 1);
412
413 //select thirdparty
414 print '</br>';
415 print img_picto('', 'company', 'class="paddingrightonly"');
416 print $form->select_thirdparty_list($selected_soc, 'search_soc', '', $langs->trans("ThirdParty"));
417 print '</td>';
418
419 print '<td colspan="5" class="right">';
420 print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
421 print '</td>';
422
423 print '</tr>';
424
425 // Array header
426 print "<tr class=\"liste_titre\">";
428 $langs->trans("Product"),
429 $_SERVER["PHP_SELF"],
430 "ref",
431 "",
432 $paramslink,
433 "",
434 $sortfield,
435 $sortorder
436 );
438 $langs->trans('Quantity'),
439 $_SERVER["PHP_SELF"],
440 "qty",
441 "",
442 $paramslink,
443 'class="right"',
444 $sortfield,
445 $sortorder
446 );
448 $langs->trans("Percentage"),
449 $_SERVER["PHP_SELF"],
450 "qty",
451 "",
452 $paramslink,
453 'class="right"',
454 $sortfield,
455 $sortorder
456 );
458 $langs->trans('AmountHT'),
459 $_SERVER["PHP_SELF"],
460 "amount",
461 "",
462 $paramslink,
463 'class="right"',
464 $sortfield,
465 $sortorder
466 );
468 $langs->trans("AmountTTC"),
469 $_SERVER["PHP_SELF"],
470 "amount_ttc",
471 "",
472 $paramslink,
473 'class="right"',
474 $sortfield,
475 $sortorder
476 );
478 $langs->trans("Percentage"),
479 $_SERVER["PHP_SELF"],
480 "amount_ttc",
481 "",
482 $paramslink,
483 'class="right"',
484 $sortfield,
485 $sortorder
486 );
487 print "</tr>\n";
488
489 if (count($name)) {
490 foreach ($name as $key => $value) {
491 print '<tr class="oddeven">';
492
493 // Product
494 print "<td>";
495 $fullname = $name[$key];
496 if ($key > 0) {
497 $linkname = '<a href="'.DOL_URL_ROOT.'/product/card.php?id='.$key.'">'.img_object($langs->trans("ShowProduct"), $type[$key] == 0 ? 'product' : 'service').' '.$fullname.'</a>';
498 } else {
499 $linkname = $langs->trans("PaymentsNotLinkedToProduct");
500 }
501 print $linkname;
502 print "</td>\n";
503
504 // Quantity
505 print '<td class="right">';
506 print price($qty[$key], 1, $langs, 0, 0);
507 print '</td>';
508
509 // Percent;
510 print '<td class="right">'.($qtytotal > 0 ? round(100 * $qty[$key] / $qtytotal, 2).'%' : '&nbsp;').'</td>';
511
512 // Amount w/o VAT
513 print '<td class="right">';
514 /*if ($key > 0) {
515 print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?productid='.$key.'">';
516 } else {
517 print '<a href="#">';
518 }*/
519 print price($amount_ht[$key]);
520 //print '</a>';
521 print '</td>';
522
523 // Amount with VAT
524 print '<td class="right">';
525 /*if ($key > 0) {
526 print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?productid='.$key.'">';
527 } else {
528 print '<a href="#">';
529 }*/
530 print price($amount[$key]);
531 //print '</a>';
532 print '</td>';
533
534 // Percent;
535 print '<td class="right">'.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : '&nbsp;').'</td>';
536
537 // TODO: statistics?
538
539 print "</tr>\n";
540 $i++;
541 }
542
543 // Total
544 print '<tr class="liste_total">';
545 print '<td>'.$langs->trans("Total").'</td>';
546 print '<td class="right">'.$qtytotal.'</td>';
547 print '<td class="right">100%</td>';
548 print '<td class="right">'.price($catotal_ht).'</td>';
549 print '<td class="right">'.price($catotal).'</td>';
550 print '<td class="right">100%</td>';
551 print '</tr>';
552
553 $db->free($result);
554 }
555 print "</table>";
556 print '</div>';
557
558 print '</form>';
559} else {
560 // $modecompta != 'CREANCES-DETTES'
561 // "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an
562 // invoice with 2 product (product A for 10 euros and product B for 20 euros), what is part of paiment for product A and part of paiment for product B ?
563 // Because there is no way to know this, this report is not relevant.
564 print '<br>'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant").'<br>';
565}
566
567// End of page
568llxFooter();
569$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage categories.
Class to manage generation of HTML components Only common components must be here.
Classe permettant la generation de composants html autre Only common components are 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:594
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
Definition date.lib.php:125
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition date.lib.php:613
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
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.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
img_next($titlealt='default', $moreatt='')
Show next logo.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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.