dolibarr 21.0.0-alpha
supplier_turnover_by_prodserv.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2020 Maxime Kohlhaas <maxime@atm-consulting.fr>
3 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
4 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
25// Load Dolibarr environment
26require '../../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
28require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
31require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
32
33// Load translation files required by the page
34$langs->loadLangs(array("products", "categories", "errors", 'accountancy'));
35
36// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
37$modecompta = getDolGlobalString('ACCOUNTING_MODE');
38if (GETPOST("modecompta")) {
39 $modecompta = GETPOST("modecompta");
40}
41
42// Sort Order
43$sortorder = GETPOST("sortorder", 'aZ09comma');
44$sortfield = GETPOST("sortfield", 'aZ09comma');
45if (!$sortorder) {
46 $sortorder = "asc";
47}
48if (!$sortfield) {
49 $sortfield = "ref";
50}
51
52// Category
53$selected_cat = GETPOSTINT('search_categ');
54$selected_soc = GETPOSTINT('search_soc');
55$subcat = false;
56if (GETPOST('subcat', 'alpha') === 'yes') {
57 $subcat = true;
58}
59// product/service
60$selected_type = GETPOST('search_type', "intcomma");
61if ($selected_type == '') {
62 $selected_type = -1;
63}
64
65// Hook
66$hookmanager->initHooks(array('supplierturnoverbyprodservlist'));
67
68$date_startyear = GETPOSTINT("date_startyear");
69$date_startmonth = GETPOSTINT("date_startmonth");
70$date_startday = GETPOSTINT("date_startday");
71$date_endyear = GETPOSTINT("date_endyear");
72$date_endmonth = GETPOSTINT("date_endmonth");
73$date_endday = GETPOSTINT("date_endday");
74
75$nbofyear = 1;
76
77// Date range
78$year = GETPOSTINT("year");
79$month = GETPOSTINT("month");
80if (empty($year)) {
81 $year_current = (int) dol_print_date(dol_now(), "%Y");
82 $month_current = (int) dol_print_date(dol_now(), "%m");
83 $year_start = $year_current - ($nbofyear - 1);
84} else {
85 $year_current = $year;
86 $month_current = (int) dol_print_date(dol_now(), "%m");
87 $year_start = $year - $nbofyear + (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
88}
89$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear, 'tzserver'); // We use timezone of server so report is same from everywhere
90$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, 'tzserver'); // We use timezone of server so report is same from everywhere
91
92// We define date_start and date_end
93if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
94 $q = GETPOSTINT("q");
95 if (empty($q)) {
96 // We define date_start and date_end
97 $year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
98 $month_start = GETPOSTISSET("month") ? GETPOSTINT("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
99 if (!GETPOST("month")) { // If month not forced
100 if (!$year && $month_start > $month_current) {
101 $year_start--;
102 $year_end--;
103 }
104 $month_end = $month_start - 1;
105 if ($month_end < 1) {
106 $month_end = 12;
107 }
108 } else {
109 $month_end = $month_start;
110 }
111 $date_start = dol_get_first_day($year_start, $month_start, false);
112 $date_end = dol_get_last_day($year_end, $month_end, false);
113 }
114 if ($q == 1) {
115 $date_start = dol_get_first_day($year_start, 1, false);
116 $date_end = dol_get_last_day($year_start, 3, false);
117 }
118 if ($q == 2) {
119 $date_start = dol_get_first_day($year_start, 4, false);
120 $date_end = dol_get_last_day($year_start, 6, false);
121 }
122 if ($q == 3) {
123 $date_start = dol_get_first_day($year_start, 7, false);
124 $date_end = dol_get_last_day($year_start, 9, false);
125 }
126 if ($q == 4) {
127 $date_start = dol_get_first_day($year_start, 10, false);
128 $date_end = dol_get_last_day($year_start, 12, false);
129 }
130}
131
132// $date_start and $date_end are defined. We force $year_start and $nbofyear
133$tmps = dol_getdate($date_start);
134$year_start = $tmps['year'];
135$tmpe = dol_getdate($date_end);
136$year_end = $tmpe['year'];
137$nbofyear = ($year_end - $year_start) + 1;
138
139$commonparams = array();
140if (!empty($modecompta)) {
141 $commonparams['modecompta'] = $modecompta;
142}
143if (!empty($sortorder)) {
144 $commonparams['sortorder'] = $sortorder;
145}
146if (!empty($sortfield)) {
147 $commonparams['sortfield'] = $sortfield;
148}
149
150$headerparams = array();
151if (!empty($date_startyear)) {
152 $headerparams['date_startyear'] = $date_startyear;
153}
154if (!empty($date_startmonth)) {
155 $headerparams['date_startmonth'] = $date_startmonth;
156}
157if (!empty($date_startday)) {
158 $headerparams['date_startday'] = $date_startday;
159}
160if (!empty($date_endyear)) {
161 $headerparams['date_endyear'] = $date_endyear;
162}
163if (!empty($date_endmonth)) {
164 $headerparams['date_endmonth'] = $date_endmonth;
165}
166if (!empty($date_endday)) {
167 $headerparams['date_endday'] = $date_endday;
168}
169if (!empty($year)) {
170 $headerparams['year'] = $year;
171}
172if (!empty($month)) {
173 $headerparams['month'] = $month;
174}
175$headerparams['q'] = $q;
176
177$tableparams = array();
178if (!empty($selected_cat)) {
179 $tableparams['search_categ'] = $selected_cat;
180}
181if (!empty($selected_soc)) {
182 $tableparams['search_soc'] = $selected_soc;
183}
184if (!empty($selected_type)) {
185 $tableparams['search_type'] = $selected_type;
186}
187$tableparams['subcat'] = $subcat ? 'yes' : '';
188
189// Adding common parameters
190$allparams = array_merge($commonparams, $headerparams, $tableparams);
191$headerparams = array_merge($commonparams, $headerparams);
192$tableparams = array_merge($commonparams, $tableparams);
193
194$paramslink = '';
195foreach ($allparams as $key => $value) {
196 $paramslink .= '&'.$key.'='.$value;
197}
198
199// Security pack (data & check)
200$socid = GETPOSTINT('socid');
201
202if ($user->socid > 0) {
203 $socid = $user->socid;
204}
205if (isModEnabled('comptabilite')) {
206 $result = restrictedArea($user, 'compta', '', '', 'resultat');
207}
208if (isModEnabled('accounting')) {
209 $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
210}
211
212
213/*
214 * View
215 */
216
217llxHeader();
218
219$form = new Form($db);
220$formother = new FormOther($db);
221
222// TODO Report from bookkeeping not yet available, so we switch on report on business events
223if ($modecompta == "BOOKKEEPING") {
224 $modecompta = "CREANCES-DETTES";
225}
226if ($modecompta == "BOOKKEEPINGCOLLECTED") {
227 $modecompta = "RECETTES-DEPENSES";
228}
229
230// Show report header
231if ($modecompta == "CREANCES-DETTES") {
232 $name = $langs->trans("PurchaseTurnover").', '.$langs->trans("ByProductsAndServices");
233 $calcmode = $langs->trans("CalcModeDebt");
234 //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
235
236 $description = $langs->trans("RulesPurchaseTurnoverDue");
237} elseif ($modecompta == "RECETTES-DEPENSES") {
238 $name = $langs->trans("PurchaseTurnoverCollected").', '.$langs->trans("ByProductsAndServices");
239 $calcmode = $langs->trans("CalcModePayment");
240 //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
241 $description = $langs->trans("RulesPurchaseTurnoverIn");
242} elseif ($modecompta == "BOOKKEEPING") {
243 // TODO
244} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
245 // TODO
246}
247
248$builddate = dol_now();
249$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
250$period .= ' - ';
251$period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
252if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
253 $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>';
254} else {
255 $periodlink = '';
256}
257
258$exportlink = '';
259
260report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode);
261
262if (isModEnabled('accounting')) {
263 if ($modecompta != 'BOOKKEEPING') {
264 print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, '1');
265 } else {
266 // Test if there is at least one line in bookkeeping
267 $pcgverid = getDolGlobalInt('CHARTOFACCOUNTS');
268 $pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
269 if (empty($pcgvercode)) {
270 $pcgvercode = $pcgverid;
271 }
272
273 $sql = "SELECT b.rowid ";
274 $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b,";
275 $sql .= " ".MAIN_DB_PREFIX."accounting_account as aa";
276 $sql .= " WHERE b.entity = ".$conf->entity; // In module double party accounting, we never share entities
277 $sql .= " AND b.numero_compte = aa.account_number";
278 $sql .= " AND aa.entity = ".$conf->entity;
279 $sql .= " AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
280 $sql .= $db->plimit(1);
281
282 $resql = $db->query($sql);
283 $nb = $db->num_rows($resql);
284 if ($nb == 0) {
285 $langs->load("errors");
286 print info_admin($langs->trans("WarningNoDataTransferedInAccountancyYet"), 0, 0, '1');
287 }
288 }
289}
290
291
292
293$name = array();
294$amount = array();
295$amount_ht = array();
296$qty = array();
297
298// SQL request
299$catotal = 0;
300$catotal_ht = 0;
301$qtytotal = 0;
302
303if ($modecompta == 'CREANCES-DETTES') {
304 $sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label, p.fk_product_type as product_type,";
305 $sql .= " SUM(l.total_ht) as amount, SUM(l.total_ttc) as amount_ttc,";
306 $sql .= " SUM(CASE WHEN f.type = 2 THEN -l.qty ELSE l.qty END) as qty";
307 $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
308 if ($selected_soc > 0) {
309 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc ON (soc.rowid = f.fk_soc)";
310 }
311 $sql .= ",".MAIN_DB_PREFIX."facture_fourn_det as l";
312 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid";
313 if ($selected_cat === -2) { // Without any category
314 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";
315 } elseif ($selected_cat) { // Into a specific category
316 $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp";
317 }
318 $sql .= " WHERE l.fk_facture_fourn = f.rowid";
319 $sql .= " AND f.fk_statut in (1,2)";
320 $sql .= " AND f.type IN (0,2)";
321
322 if ($date_start && $date_end) {
323 $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
324 }
325 if ($selected_type >= 0) {
326 $sql .= " AND l.product_type = ".((int) $selected_type);
327 }
328 if ($selected_cat === -2) { // Without any category
329 $sql .= " AND cp.fk_product is null";
330 } elseif ($selected_cat) { // Into a specific category
331 $sql .= " AND (c.rowid = ".((int) $selected_cat);
332 if ($subcat) {
333 $sql .= " OR c.fk_parent = ".((int) $selected_cat);
334 }
335 $sql .= ")";
336 $sql .= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid";
337 }
338 if ($selected_soc > 0) {
339 $sql .= " AND soc.rowid=".((int) $selected_soc);
340 }
341 $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")";
342 $sql .= " GROUP BY p.rowid, p.ref, p.label, p.fk_product_type";
343 $sql .= $db->order($sortfield, $sortorder);
344
345 dol_syslog("supplier_turnover_by_prodserv", LOG_DEBUG);
346 $resql = $db->query($sql);
347 if ($resql) {
348 $num = $db->num_rows($resql);
349 $i = 0;
350 while ($i < $num) {
351 $obj = $db->fetch_object($resql);
352
353 $amount_ht[$obj->rowid] = $obj->amount;
354 $amount[$obj->rowid] = $obj->amount_ttc;
355 $qty[$obj->rowid] = $obj->qty;
356 $name[$obj->rowid] = $obj->ref.'&nbsp;-&nbsp;'.$obj->label;
357 $type[$obj->rowid] = $obj->product_type;
358
359 $catotal_ht += $obj->amount;
360 $catotal += $obj->amount_ttc;
361 $qtytotal += $obj->qty;
362
363 $i++;
364 }
365 } else {
366 dol_print_error($db);
367 }
368
369 // Show array
370 $i = 0;
371 print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
372 print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
373 // Extra parameters management
374 foreach ($headerparams as $key => $value) {
375 print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
376 }
377
378 $moreforfilter = '';
379
380 print '<div class="div-table-responsive">';
381 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
382
383 // Category filter
384 print '<tr class="liste_titre">';
385 print '<td>';
386 print img_picto('', 'category', 'class="paddingrightonly"');
387 print $formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', 0, $langs->trans("Category"), 'maxwidth300');
388 print ' ';
389 print '<label for="subcat" class="marginleftonly">'.$langs->trans("SubCats").'?</label> ';
390 print '<input type="checkbox" id="subcat" name="subcat" value="yes"';
391 if ($subcat) {
392 print ' checked';
393 }
394 print '>';
395 // type filter (produit/service)
396 print ' &nbsp; ';
397 $form->select_type_of_lines(isset($selected_type) ? $selected_type : -1, 'search_type', $langs->trans("Type"), 1, 1);
398
399 //select thirdparty
400 print '<br>';
401 print img_picto('', 'company', 'class="paddingrightonly"');
402 print $form->select_thirdparty_list($selected_soc, 'search_soc', '', $langs->trans("ThirdParty"), 0, 0, [], '', 0, 0, 'maxwidth250');
403 print '</td>';
404
405 print '<td colspan="5" class="right">';
406 print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"), 'search.png', '', 0, 1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
407 print '</td></tr>';
408
409 // Array header
410 print '<tr class="liste_titre">';
412 $langs->trans("Product"),
413 $_SERVER["PHP_SELF"],
414 "ref",
415 "",
416 $paramslink,
417 "",
418 $sortfield,
419 $sortorder
420 );
422 $langs->trans('Quantity'),
423 $_SERVER["PHP_SELF"],
424 "qty",
425 "",
426 $paramslink,
427 'class="right"',
428 $sortfield,
429 $sortorder
430 );
432 $langs->trans("Percentage"),
433 $_SERVER["PHP_SELF"],
434 "qty",
435 "",
436 $paramslink,
437 'class="right"',
438 $sortfield,
439 $sortorder
440 );
442 $langs->trans('AmountHT'),
443 $_SERVER["PHP_SELF"],
444 "amount",
445 "",
446 $paramslink,
447 'class="right"',
448 $sortfield,
449 $sortorder
450 );
452 $langs->trans("AmountTTC"),
453 $_SERVER["PHP_SELF"],
454 "amount_ttc",
455 "",
456 $paramslink,
457 'class="right"',
458 $sortfield,
459 $sortorder
460 );
462 $langs->trans("Percentage"),
463 $_SERVER["PHP_SELF"],
464 "amount_ttc",
465 "",
466 $paramslink,
467 'class="right"',
468 $sortfield,
469 $sortorder
470 );
471 print "</tr>\n";
472
473 if (count($name)) {
474 foreach ($name as $key => $value) {
475 print '<tr class="oddeven">';
476
477 // Product
478 print "<td>";
479 $fullname = $name[$key];
480 if ($key > 0) {
481 $linkname = '<a href="'.DOL_URL_ROOT.'/product/card.php?id='.$key.'">'.img_object($langs->trans("ShowProduct"), $type[$key] == 0 ? 'product' : 'service').' '.$fullname.'</a>';
482 } else {
483 $linkname = $langs->trans("PaymentsNotLinkedToProduct");
484 }
485 print $linkname;
486 print "</td>\n";
487
488 // Quantity
489 print '<td class="right">';
490 print $qty[$key];
491 print '</td>';
492
493 // Percent;
494 print '<td class="right">'.($qtytotal > 0 ? round(100 * $qty[$key] / $qtytotal, 2).'%' : '&nbsp;').'</td>';
495
496 // Amount w/o VAT
497 print '<td class="right">';
498 print price($amount_ht[$key]);
499 print '</td>';
500
501 // Amount with VAT
502 print '<td class="right">';
503 print price($amount[$key]);
504 print '</td>';
505
506 // Percent;
507 print '<td class="right">'.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : '&nbsp;').'</td>';
508
509 // TODO: statistics?
510
511 print "</tr>\n";
512 $i++;
513 }
514
515 // Total
516 print '<tr class="liste_total">';
517 print '<td>'.$langs->trans("Total").'</td>';
518 print '<td class="right">'.$qtytotal.'</td>';
519 print '<td class="right">100%</td>';
520 print '<td class="right">'.price($catotal_ht).'</td>';
521 print '<td class="right">'.price($catotal).'</td>';
522 print '<td class="right">100%</td>';
523 print '</tr>';
524
525 $db->free($result);
526 } else {
527 print '<tr><td colspan="6"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
528 }
529 print "</table>";
530 print "</div>";
531
532 print '</form>';
533} else {
534 // $modecompta != 'CREANCES-DETTES'
535 // "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
536 // 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 ?
537 // Because there is no way to know this, this report is not relevant.
538 print '<br>'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant").'<br>';
539}
540
541// End of page
542llxFooter();
543$db->close();
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:70
Class to manage generation of HTML components Only common components must be here.
Class 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:596
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:615
llxFooter()
Footer empty.
Definition document.php:107
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...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
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.
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_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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.
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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
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.