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