dolibarr 21.0.0-beta
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
41// Load translation files required by the page
42$langs->loadLangs(array("products", "categories", "errors", 'accountancy'));
43
44// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
45$modecompta = getDolGlobalString('ACCOUNTING_MODE');
46if (GETPOST("modecompta")) {
47 $modecompta = GETPOST("modecompta");
48}
49
50// Sort Order
51$sortorder = GETPOST("sortorder", 'aZ09comma');
52$sortfield = GETPOST("sortfield", 'aZ09comma');
53if (!$sortorder) {
54 $sortorder = "asc";
55}
56if (!$sortfield) {
57 $sortfield = "ref";
58}
59
60// Category
61$selected_cat = GETPOSTINT('search_categ');
62$selected_soc = GETPOSTINT('search_soc');
63$subcat = false;
64if (GETPOST('subcat', 'alpha') === 'yes') {
65 $subcat = true;
66}
67// product/service
68$selected_type = GETPOST('search_type', "intcomma");
69if ($selected_type == '') {
70 $selected_type = -1;
71}
72
73// Hook
74$hookmanager->initHooks(array('supplierturnoverbyprodservlist'));
75
76$date_startyear = GETPOSTINT("date_startyear");
77$date_startmonth = GETPOSTINT("date_startmonth");
78$date_startday = GETPOSTINT("date_startday");
79$date_endyear = GETPOSTINT("date_endyear");
80$date_endmonth = GETPOSTINT("date_endmonth");
81$date_endday = GETPOSTINT("date_endday");
82
83$nbofyear = 1;
84
85// Date range
86$year = GETPOSTINT("year");
87$month = GETPOSTINT("month");
88if (empty($year)) {
89 $year_current = (int) dol_print_date(dol_now(), "%Y");
90 $month_current = (int) dol_print_date(dol_now(), "%m");
91 $year_start = $year_current - ($nbofyear - 1);
92} else {
93 $year_current = $year;
94 $month_current = (int) dol_print_date(dol_now(), "%m");
95 $year_start = $year - $nbofyear + (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
96}
97$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
98$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
99
100// We define date_start and date_end
101$q = 0;
102if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
103 $q = GETPOSTINT("q");
104 if (empty($q)) {
105 // We define date_start and date_end
106 $year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1);
107 $month_start = GETPOSTISSET("month") ? GETPOSTINT("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
108 if (!GETPOST("month")) { // If month not forced
109 if (!$year && $month_start > $month_current) {
110 $year_start--;
111 $year_end--;
112 }
113 $month_end = $month_start - 1;
114 if ($month_end < 1) {
115 $month_end = 12;
116 }
117 } else {
118 $month_end = $month_start;
119 }
120 $date_start = dol_get_first_day($year_start, $month_start, false);
121 $date_end = dol_get_last_day($year_end, $month_end, false);
122 }
123 if ($q == 1) {
124 $date_start = dol_get_first_day($year_start, 1, false);
125 $date_end = dol_get_last_day($year_start, 3, false);
126 }
127 if ($q == 2) {
128 $date_start = dol_get_first_day($year_start, 4, false);
129 $date_end = dol_get_last_day($year_start, 6, false);
130 }
131 if ($q == 3) {
132 $date_start = dol_get_first_day($year_start, 7, false);
133 $date_end = dol_get_last_day($year_start, 9, false);
134 }
135 if ($q == 4) {
136 $date_start = dol_get_first_day($year_start, 10, false);
137 $date_end = dol_get_last_day($year_start, 12, false);
138 }
139}
140
141// $date_start and $date_end are defined. We force $year_start and $nbofyear
142$tmps = dol_getdate($date_start);
143$year_start = $tmps['year'];
144$tmpe = dol_getdate($date_end);
145$year_end = $tmpe['year'];
146$nbofyear = ($year_end - $year_start) + 1;
147
148$commonparams = array();
149if (!empty($modecompta)) {
150 $commonparams['modecompta'] = $modecompta;
151}
152if (!empty($sortorder)) {
153 $commonparams['sortorder'] = $sortorder;
154}
155if (!empty($sortfield)) {
156 $commonparams['sortfield'] = $sortfield;
157}
158
159$headerparams = array();
160if (!empty($date_startyear)) {
161 $headerparams['date_startyear'] = $date_startyear;
162}
163if (!empty($date_startmonth)) {
164 $headerparams['date_startmonth'] = $date_startmonth;
165}
166if (!empty($date_startday)) {
167 $headerparams['date_startday'] = $date_startday;
168}
169if (!empty($date_endyear)) {
170 $headerparams['date_endyear'] = $date_endyear;
171}
172if (!empty($date_endmonth)) {
173 $headerparams['date_endmonth'] = $date_endmonth;
174}
175if (!empty($date_endday)) {
176 $headerparams['date_endday'] = $date_endday;
177}
178if (!empty($year)) {
179 $headerparams['year'] = $year;
180}
181if (!empty($month)) {
182 $headerparams['month'] = $month;
183}
184$headerparams['q'] = $q;
185
186$tableparams = array();
187if (!empty($selected_cat)) {
188 $tableparams['search_categ'] = $selected_cat;
189}
190if (!empty($selected_soc)) {
191 $tableparams['search_soc'] = $selected_soc;
192}
193if ($selected_type > 0) {
194 $tableparams['search_type'] = $selected_type;
195}
196$tableparams['subcat'] = $subcat ? 'yes' : '';
197
198// Adding common parameters
199$allparams = array_merge($commonparams, $headerparams, $tableparams);
200$headerparams = array_merge($commonparams, $headerparams);
201$tableparams = array_merge($commonparams, $tableparams);
202
203$paramslink = '';
204foreach ($allparams as $key => $value) {
205 $paramslink .= '&'.$key.'='.$value;
206}
207
208// Security pack (data & check)
209$socid = GETPOSTINT('socid');
210
211if ($user->socid > 0) {
212 $socid = $user->socid;
213}
214if (isModEnabled('comptabilite')) {
215 $result = restrictedArea($user, 'compta', '', '', 'resultat');
216}
217if (isModEnabled('accounting')) {
218 $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
219}
220
221
222/*
223 * View
224 */
225
226llxHeader();
227
228$form = new Form($db);
229$formother = new FormOther($db);
230
231// TODO Report from bookkeeping not yet available, so we switch on report on business events
232if ($modecompta == "BOOKKEEPING") {
233 $modecompta = "CREANCES-DETTES";
234}
235if ($modecompta == "BOOKKEEPINGCOLLECTED") {
236 $modecompta = "RECETTES-DEPENSES";
237}
238
239$builddate = dol_now();
240$periodlink = '';
241$name = '';
242$calcmode = '';
243
244// Show report header
245if ($modecompta == "CREANCES-DETTES") {
246 $name = $langs->trans("PurchaseTurnover").', '.$langs->trans("ByProductsAndServices");
247 $calcmode = $langs->trans("CalcModeDebt");
248 //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
249
250 $description = $langs->trans("RulesPurchaseTurnoverDue");
251} elseif ($modecompta == "RECETTES-DEPENSES") {
252 $name = $langs->trans("PurchaseTurnoverCollected").', '.$langs->trans("ByProductsAndServices");
253 $calcmode = $langs->trans("CalcModePayment");
254 //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
255 $description = $langs->trans("RulesPurchaseTurnoverIn");
256} elseif ($modecompta == "BOOKKEEPING") {
257 // TODO
258} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
259 // TODO
260}
261
262
263$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
264$period .= ' - ';
265$period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
266if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
267 $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>';
268} else {
269 $periodlink = '';
270}
271
272$exportlink = '';
273
274report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode);
275
276if (isModEnabled('accounting')) {
277 if ($modecompta != 'BOOKKEEPING') {
278 print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, '1');
279 } else {
280 // Test if there is at least one line in bookkeeping
281 $pcgverid = getDolGlobalInt('CHARTOFACCOUNTS');
282 $pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
283 if (empty($pcgvercode)) {
284 $pcgvercode = $pcgverid;
285 }
286
287 $sql = "SELECT b.rowid ";
288 $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b,";
289 $sql .= " ".MAIN_DB_PREFIX."accounting_account as aa";
290 $sql .= " WHERE b.entity = ".$conf->entity; // In module double party accounting, we never share entities
291 $sql .= " AND b.numero_compte = aa.account_number";
292 $sql .= " AND aa.entity = ".$conf->entity;
293 $sql .= " AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
294 $sql .= $db->plimit(1);
295
296 $resql = $db->query($sql);
297 $nb = $db->num_rows($resql);
298 if ($nb == 0) {
299 $langs->load("errors");
300 print info_admin($langs->trans("WarningNoDataTransferedInAccountancyYet"), 0, 0, '1');
301 }
302 }
303}
304
305
306
307$name = array();
308$amount = array();
309$amount_ht = array();
310$qty = array();
311
312// SQL request
313$catotal = 0;
314$catotal_ht = 0;
315$qtytotal = 0;
316
317if ($modecompta == 'CREANCES-DETTES') {
318 $sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label, p.fk_product_type as product_type,";
319 $sql .= " SUM(l.total_ht) as amount, SUM(l.total_ttc) as amount_ttc,";
320 $sql .= " SUM(CASE WHEN f.type = 2 THEN -l.qty ELSE l.qty END) as qty";
321 $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
322 if ($selected_soc > 0) {
323 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc ON (soc.rowid = f.fk_soc)";
324 }
325 $sql .= ",".MAIN_DB_PREFIX."facture_fourn_det as l";
326 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid";
327 if ($selected_cat === -2) { // Without any category
328 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";
329 } elseif ($selected_cat) { // Into a specific category
330 $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp";
331 }
332 $sql .= " WHERE l.fk_facture_fourn = f.rowid";
333 $sql .= " AND f.fk_statut in (1,2)";
334 $sql .= " AND f.type IN (0,2)";
335
336 if ($date_start && $date_end) {
337 $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
338 }
339 if ($selected_type >= 0) {
340 $sql .= " AND l.product_type = ".((int) $selected_type);
341 }
342 if ($selected_cat === -2) { // Without any category
343 $sql .= " AND cp.fk_product is null";
344 } elseif ($selected_cat) { // Into a specific category
345 $sql .= " AND (c.rowid = ".((int) $selected_cat);
346 if ($subcat) {
347 $sql .= " OR c.fk_parent = ".((int) $selected_cat);
348 }
349 $sql .= ")";
350 $sql .= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid";
351 }
352 if ($selected_soc > 0) {
353 $sql .= " AND soc.rowid=".((int) $selected_soc);
354 }
355 $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")";
356 $sql .= " GROUP BY p.rowid, p.ref, p.label, p.fk_product_type";
357 $sql .= $db->order($sortfield, $sortorder);
358
359 dol_syslog("supplier_turnover_by_prodserv", LOG_DEBUG);
360 $resql = $db->query($sql);
361 if ($resql) {
362 $num = $db->num_rows($resql);
363 $i = 0;
364 while ($i < $num) {
365 $obj = $db->fetch_object($resql);
366
367 $amount_ht[$obj->rowid] = $obj->amount;
368 $amount[$obj->rowid] = $obj->amount_ttc;
369 $qty[$obj->rowid] = $obj->qty;
370 $name[$obj->rowid] = $obj->ref.'&nbsp;-&nbsp;'.$obj->label;
371 $type[$obj->rowid] = $obj->product_type;
372
373 $catotal_ht += $obj->amount;
374 $catotal += $obj->amount_ttc;
375 $qtytotal += $obj->qty;
376
377 $i++;
378 }
379 } else {
380 dol_print_error($db);
381 }
382
383 // Show array
384 $i = 0;
385 print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
386 print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
387 // Extra parameters management
388 foreach ($headerparams as $key => $value) {
389 print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
390 }
391
392 $moreforfilter = '';
393
394 print '<div class="div-table-responsive">';
395 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
396
397 // Category filter
398 print '<tr class="liste_titre">';
399 print '<td>';
400 print img_picto('', 'category', 'class="paddingrightonly"');
401 print $formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', 0, $langs->trans("Category"), 'maxwidth300');
402 print ' ';
403 print '<label for="subcat" class="marginleftonly">'.$langs->trans("SubCats").'?</label> ';
404 print '<input type="checkbox" id="subcat" name="subcat" value="yes"';
405 if ($subcat) {
406 print ' checked';
407 }
408 print '>';
409 // type filter (produit/service)
410 print ' &nbsp; ';
411 $form->select_type_of_lines($selected_type, 'search_type', $langs->trans("Type"), 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"), 0, 0, [], '', 0, 0, 'maxwidth250');
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', '', 0, 1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
421 print '</td></tr>';
422
423 // Array header
424 print '<tr class="liste_titre">';
426 $langs->trans("Product"),
427 $_SERVER["PHP_SELF"],
428 "ref",
429 "",
430 $paramslink,
431 "",
432 $sortfield,
433 $sortorder
434 );
436 $langs->trans('Quantity'),
437 $_SERVER["PHP_SELF"],
438 "qty",
439 "",
440 $paramslink,
441 'class="right"',
442 $sortfield,
443 $sortorder
444 );
446 $langs->trans("Percentage"),
447 $_SERVER["PHP_SELF"],
448 "qty",
449 "",
450 $paramslink,
451 'class="right"',
452 $sortfield,
453 $sortorder
454 );
456 $langs->trans('AmountHT'),
457 $_SERVER["PHP_SELF"],
458 "amount",
459 "",
460 $paramslink,
461 'class="right"',
462 $sortfield,
463 $sortorder
464 );
466 $langs->trans("AmountTTC"),
467 $_SERVER["PHP_SELF"],
468 "amount_ttc",
469 "",
470 $paramslink,
471 'class="right"',
472 $sortfield,
473 $sortorder
474 );
476 $langs->trans("Percentage"),
477 $_SERVER["PHP_SELF"],
478 "amount_ttc",
479 "",
480 $paramslink,
481 'class="right"',
482 $sortfield,
483 $sortorder
484 );
485 print "</tr>\n";
486
487 if (count($name)) {
488 foreach ($name as $key => $value) {
489 print '<tr class="oddeven">';
490
491 // Product
492 print "<td>";
493 $fullname = $name[$key];
494 if ($key > 0) {
495 $linkname = '<a href="'.DOL_URL_ROOT.'/product/card.php?id='.$key.'">'.img_object($langs->trans("ShowProduct"), $type[$key] == 0 ? 'product' : 'service').' '.$fullname.'</a>';
496 } else {
497 $linkname = $langs->trans("PaymentsNotLinkedToProduct");
498 }
499 print $linkname;
500 print "</td>\n";
501
502 // Quantity
503 print '<td class="right">';
504 print $qty[$key];
505 print '</td>';
506
507 // Percent;
508 print '<td class="right">'.($qtytotal > 0 ? round(100 * $qty[$key] / $qtytotal, 2).'%' : '&nbsp;').'</td>';
509
510 // Amount w/o VAT
511 print '<td class="right">';
512 print price($amount_ht[$key]);
513 print '</td>';
514
515 // Amount with VAT
516 print '<td class="right">';
517 print price($amount[$key]);
518 print '</td>';
519
520 // Percent;
521 print '<td class="right">'.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : '&nbsp;').'</td>';
522
523 // TODO: statistics?
524
525 print "</tr>\n";
526 $i++;
527 }
528
529 // Total
530 print '<tr class="liste_total">';
531 print '<td>'.$langs->trans("Total").'</td>';
532 print '<td class="right">'.$qtytotal.'</td>';
533 print '<td class="right">100%</td>';
534 print '<td class="right">'.price($catotal_ht).'</td>';
535 print '<td class="right">'.price($catotal).'</td>';
536 print '<td class="right">100%</td>';
537 print '</tr>';
538
539 $db->free($result);
540 } else {
541 print '<tr><td colspan="6"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
542 }
543 print "</table>";
544 print "</div>";
545
546 print '</form>';
547} else {
548 // $modecompta != 'CREANCES-DETTES'
549 // "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
550 // 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 ?
551 // Because there is no way to know this, this report is not relevant.
552 print '<br>'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant").'<br>';
553}
554
555// End of page
556llxFooter();
557$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:71
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:600
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:619
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.