dolibarr 24.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-2025 MDW <mdeweerd@users.noreply.github.com>
4 * Copyright (C) 2024-2026 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';
35require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
37require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
38require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
39require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
40
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$description = '';
244
245// Show report header
246if ($modecompta == "CREANCES-DETTES") {
247 $name = $langs->trans("PurchaseTurnover").', '.$langs->trans("ByProductsAndServices");
248 $calcmode = $langs->trans("CalcModeDebt");
249 //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
250
251 $description = $langs->trans("RulesPurchaseTurnoverDue");
252} elseif ($modecompta == "RECETTES-DEPENSES") {
253 $name = $langs->trans("PurchaseTurnoverCollected").', '.$langs->trans("ByProductsAndServices");
254 $calcmode = $langs->trans("CalcModePayment");
255 //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
256 $description = $langs->trans("RulesPurchaseTurnoverIn");
257} elseif ($modecompta == "BOOKKEEPING") {
258 // TODO
259} elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
260 // TODO
261}
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
273$exportlink = '';
274
275report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, $tableparams, $calcmode);
276
277if (isModEnabled('accounting')) {
278 if ($modecompta != 'BOOKKEEPING') {
279 print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, '1');
280 } else {
281 // Test if there is at least one line in bookkeeping
282 $pcgverid = getDolGlobalInt('CHARTOFACCOUNTS');
283 $pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
284 if (empty($pcgvercode)) {
285 $pcgvercode = $pcgverid;
286 }
287
288 $sql = "SELECT b.rowid ";
289 $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b,";
290 $sql .= " ".MAIN_DB_PREFIX."accounting_account as aa";
291 $sql .= " WHERE b.entity = ".$conf->entity; // In module double party accounting, we never share entities
292 $sql .= " AND b.numero_compte = aa.account_number";
293 $sql .= " AND aa.entity = ".$conf->entity;
294 $sql .= " AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
295 $sql .= $db->plimit(1);
296
297 $resql = $db->query($sql);
298 $nb = $db->num_rows($resql);
299 if ($nb == 0) {
300 $langs->load("errors");
301 print info_admin($langs->trans("WarningNoDataTransferedInAccountancyYet"), 0, 0, '1');
302 }
303 }
304}
305
306
307
308$name = array();
309$amount = array();
310$amount_ht = array();
311$qty = array();
312$type = [];
313
314// SQL request
315$catotal = 0;
316$catotal_ht = 0;
317$qtytotal = 0;
318
319if ($modecompta == 'CREANCES-DETTES') {
320 $sql = "SELECT DISTINCT p.rowid as rowid, p.ref as ref, p.label as label, p.fk_product_type as product_type,";
321 $sql .= " SUM(l.total_ht) as amount, SUM(l.total_ttc) as amount_ttc,";
322 $sql .= " SUM(CASE WHEN f.type = 2 THEN -l.qty ELSE l.qty END) as qty";
323 $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
324 if ($selected_soc > 0) {
325 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc ON (soc.rowid = f.fk_soc)";
326 }
327 $sql .= ",".MAIN_DB_PREFIX."facture_fourn_det as l";
328 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid";
329 if ($selected_cat === -2) { // Without any category
330 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product";
331 } elseif ($selected_cat) { // Into a specific category
332 $sql .= ", ".MAIN_DB_PREFIX."categorie as c, ".MAIN_DB_PREFIX."categorie_product as cp";
333 }
334 $sql .= " WHERE l.fk_facture_fourn = f.rowid";
335 $sql .= " AND f.fk_statut in (1,2)";
336 $sql .= " AND f.type IN (0,2)";
337
338 if ($date_start && $date_end) {
339 $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
340 }
341 if ($selected_type >= 0) {
342 $sql .= " AND l.product_type = ".((int) $selected_type);
343 }
344 if ($selected_cat === -2) { // Without any category
345 $sql .= " AND cp.fk_product is null";
346 } elseif ($selected_cat) { // Into a specific category
347 $sql .= " AND (c.rowid = ".((int) $selected_cat);
348 if ($subcat) {
349 $sql .= " OR c.fk_parent = ".((int) $selected_cat);
350 }
351 $sql .= ")";
352 $sql .= " AND cp.fk_categorie = c.rowid AND cp.fk_product = p.rowid";
353 }
354 if ($selected_soc > 0) {
355 $sql .= " AND soc.rowid=".((int) $selected_soc);
356 }
357 $sql .= " AND f.entity IN (".getEntity('supplier_invoice').")";
358 $sql .= " GROUP BY p.rowid, p.ref, p.label, p.fk_product_type";
359 $sql .= $db->order((string) $sortfield, (string) $sortorder);
360
361 dol_syslog("supplier_turnover_by_prodserv", LOG_DEBUG);
362 $resql = $db->query($sql);
363 if ($resql) {
364 $num = $db->num_rows($resql);
365 $i = 0;
366 while ($i < $num) {
367 $obj = $db->fetch_object($resql);
368
369 $amount_ht[$obj->rowid] = $obj->amount;
370 $amount[$obj->rowid] = $obj->amount_ttc;
371 $qty[$obj->rowid] = $obj->qty;
372 $name[$obj->rowid] = $obj->ref.'&nbsp;-&nbsp;'.$obj->label;
373 $type[$obj->rowid] = $obj->product_type;
374
375 $catotal_ht += $obj->amount;
376 $catotal += $obj->amount_ttc;
377 $qtytotal += $obj->qty;
378
379 $i++;
380 }
381 } else {
383 }
384
385 // Show array
386 $i = 0;
387 print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
388 print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
389 // Extra parameters management
390 foreach ($headerparams as $key => $value) {
391 print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
392 }
393
394 $moreforfilter = '';
395
396 print '<div class="div-table-responsive">';
397 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
398
399 // Category filter
400 print '<tr class="liste_titre">';
401 print '<td>';
402 print img_picto('', 'category', 'class="paddingrightonly"');
403 print $formother->select_categories(Categorie::TYPE_PRODUCT, $selected_cat, 'search_categ', 0, $langs->trans("Category"), 'maxwidth300');
404 print ' ';
405 print '<label for="subcat" class="marginleftonly">'.$langs->trans("SubCats").'?</label> ';
406 print '<input type="checkbox" id="subcat" name="subcat" value="yes"';
407 if ($subcat) {
408 print ' checked';
409 }
410 print '>';
411 // type filter (produit/service)
412 print ' &nbsp; ';
413 $form->select_type_of_lines($selected_type, 'search_type', $langs->trans("Type"), 1, 1);
414
415 //select thirdparty
416 print '<br>';
417 print img_picto('', 'company', 'class="paddingrightonly"');
418 print $form->select_thirdparty_list((string) $selected_soc, 'search_soc', '', $langs->trans("ThirdParty"), 0, 0, [], '', 0, 0, 'maxwidth250');
419 print '</td>';
420
421 print '<td colspan="5" class="right">';
422 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")).'">';
423 print '</td></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 $qty[$key];
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 print price($amount_ht[$key]);
515 print '</td>';
516
517 // Amount with VAT
518 print '<td class="right">';
519 print price($amount[$key]);
520 print '</td>';
521
522 // Percent;
523 print '<td class="right">'.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : '&nbsp;').'</td>';
524
525 // TODO: statistics?
526
527 print "</tr>\n";
528 $i++;
529 }
530
531 // Total
532 print '<tr class="liste_total">';
533 print '<td>'.$langs->trans("Total").'</td>';
534 print '<td class="right">'.$qtytotal.'</td>';
535 print '<td class="right">100%</td>';
536 print '<td class="right">'.price($catotal_ht).'</td>';
537 print '<td class="right">'.price($catotal).'</td>';
538 print '<td class="right">100%</td>';
539 print '</tr>';
540
541 $db->free($resql);
542 } else {
543 print '<tr><td colspan="6"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
544 }
545 print "</table>";
546 print "</div>";
547
548 print '</form>';
549} else {
550 // $modecompta != 'CREANCES-DETTES'
551 // "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
552 // 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 ?
553 // Because there is no way to know this, this report is not relevant.
554 print '<br>'.$langs->trans("TurnoverPerProductInCommitmentAccountingNotRelevant").'<br>';
555}
556
557// End of page
558llxFooter();
559$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.
Class to help generate other html components 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: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...
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='', $useCache=true)
Return an id or code from a code or id.
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.
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.