dolibarr  16.0.5
cabyuser.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2013 Antoine Iauch <aiauch@gpcsolutions.fr>
6  * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
7  * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  */
22 
28 require '../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
32 
33 // Load translation files required by the page
34 $langs->load("accountancy");
35 
36 $socid = GETPOST('socid', 'int');
37 
38 // Security check
39 if ($user->socid > 0) {
40  $socid = $user->socid;
41 }
42 if (isModEnabled('comptabilite')) {
43  $result = restrictedArea($user, 'compta', '', '', 'resultat');
44 }
45 if (isModEnabled('accounting')) {
46  $result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
47 }
48 
49 // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
50 $modecompta = $conf->global->ACCOUNTING_MODE;
51 if (GETPOST("modecompta")) {
52  $modecompta = GETPOST("modecompta");
53 }
54 
55 $sortorder = GETPOST("sortorder", 'aZ09comma');
56 $sortfield = GETPOST("sortfield", 'aZ09comma');
57 if (!$sortorder) {
58  $sortorder = "asc";
59 }
60 if (!$sortfield) {
61  $sortfield = "name";
62 }
63 
64 // Date range
65 $year = GETPOST("year", 'int');
66 $month = GETPOST("month", 'int');
67 $date_startyear = GETPOST("date_startyear", 'int');
68 $date_startmonth = GETPOST("date_startmonth", 'int');
69 $date_startday = GETPOST("date_startday", 'int');
70 $date_endyear = GETPOST("date_endyear", 'int');
71 $date_endmonth = GETPOST("date_endmonth", 'int');
72 $date_endday = GETPOST("date_endday", 'int');
73 if (empty($year)) {
74  $year_current = dol_print_date(dol_now(), '%Y');
75  $month_current = dol_print_date(dol_now(), '%m');
76  $year_start = $year_current;
77 } else {
78  $year_current = $year;
79  $month_current = dol_print_date(dol_now(), '%m');
80  $year_start = $year;
81 }
82 $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
83 $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
84 // Quarter
85 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
86  $q = GETPOST("q") ?GETPOST("q") : 0;
87  if ($q == 0) {
88  // We define date_start and date_end
89  $month_start = GETPOST("month") ?GETPOST("month") : ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
90  $year_end = $year_start;
91  $month_end = $month_start;
92  if (!GETPOST("month")) { // If month not forced
93  if (!GETPOST('year') && $month_start > $month_current) {
94  $year_start--;
95  $year_end--;
96  }
97  $month_end = $month_start - 1;
98  if ($month_end < 1) {
99  $month_end = 12;
100  } else {
101  $year_end++;
102  }
103  }
104  $date_start = dol_get_first_day($year_start, $month_start, false);
105  $date_end = dol_get_last_day($year_end, $month_end, false);
106  }
107  if ($q == 1) {
108  $date_start = dol_get_first_day($year_start, 1, false);
109  $date_end = dol_get_last_day($year_start, 3, false);
110  }
111  if ($q == 2) {
112  $date_start = dol_get_first_day($year_start, 4, false);
113  $date_end = dol_get_last_day($year_start, 6, false);
114  }
115  if ($q == 3) {
116  $date_start = dol_get_first_day($year_start, 7, false);
117  $date_end = dol_get_last_day($year_start, 9, false);
118  }
119  if ($q == 4) {
120  $date_start = dol_get_first_day($year_start, 10, false);
121  $date_end = dol_get_last_day($year_start, 12, false);
122  }
123 } else {
124  // TODO We define q
125 }
126 // $date_start and $date_end are defined. We force $year_start and $nbofyear
127 $tmps = dol_getdate($date_start);
128 $year_start = $tmps['year'];
129 $tmpe = dol_getdate($date_end);
130 $year_end = $tmpe['year'];
131 $nbofyear = ($year_end - $year_start) + 1;
132 
133 $commonparams = array();
134 $commonparams['modecompta'] = $modecompta;
135 $commonparams['sortorder'] = $sortorder;
136 $commonparams['sortfield'] = $sortfield;
137 
138 $headerparams = array();
139 if (!empty($date_startyear)) {
140  $headerparams['date_startyear'] = $date_startyear;
141 }
142 if (!empty($date_startmonth)) {
143  $headerparams['date_startmonth'] = $date_startmonth;
144 }
145 if (!empty($date_startday)) {
146  $headerparams['date_startday'] = $date_startday;
147 }
148 if (!empty($date_endyear)) {
149  $headerparams['date_endyear'] = $date_endyear;
150 }
151 if (!empty($date_endmonth)) {
152  $headerparams['date_endmonth'] = $date_endmonth;
153 }
154 if (!empty($date_endday)) {
155  $headerparams['date_endday'] = $date_endday;
156 }
157 if (!empty($q)) {
158  $headerparams['q'] = $q;
159 }
160 
161 $tableparams = array();
162 
163 // Adding common parameters
164 $allparams = array_merge($commonparams, $headerparams, $tableparams);
165 $headerparams = array_merge($commonparams, $headerparams);
166 $tableparams = array_merge($commonparams, $tableparams);
167 
168 $paramslink="";
169 foreach ($allparams as $key => $value) {
170  $paramslink .= '&'.$key.'='.$value;
171 }
172 
173 /*
174  * View
175  */
176 
177 llxHeader();
178 
179 $form = new Form($db);
180 
181 // TODO Report from bookkeeping not yet available, so we switch on report on business events
182 if ($modecompta == "BOOKKEEPING") {
183  $modecompta = "CREANCES-DETTES";
184 }
185 if ($modecompta == "BOOKKEEPINGCOLLECTED") {
186  $modecompta = "RECETTES-DEPENSES";
187 }
188 
189 $exportlink="";
190 $namelink="";
191 
192 // Show report header
193 if ($modecompta == "CREANCES-DETTES") {
194  $name = $langs->trans("Turnover").', '.$langs->trans("ByUserAuthorOfInvoice");
195  $calcmode = $langs->trans("CalcModeDebt");
196  //$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
197  $description = $langs->trans("RulesCADue");
198  if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
199  $description .= $langs->trans("DepositsAreNotIncluded");
200  } else {
201  $description .= $langs->trans("DepositsAreIncluded");
202  }
203  $builddate = dol_now();
204  //$exportlink=$langs->trans("NotYetAvailable");
205 } elseif ($modecompta == "RECETTES-DEPENSES") {
206  $name = $langs->trans("TurnoverCollected").', '.$langs->trans("ByUserAuthorOfInvoice");
207  $calcmode = $langs->trans("CalcModeEngagement");
208  //$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modecompta=CREANCES-DETTES">','</a>').')';
209  $description = $langs->trans("RulesCAIn");
210  $description .= $langs->trans("DepositsAreIncluded");
211  $builddate = dol_now();
212  //$exportlink=$langs->trans("NotYetAvailable");
213 } elseif ($modecompta == "BOOKKEEPING") {
214  // TODO
215 } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
216  // TODO
217 }
218 $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
219 $period .= ' - ';
220 $period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
221 if ($date_end == dol_time_plus_duree($date_start, 1, 'y') - 1) {
222  $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>';
223 } else {
224  $periodlink = '';
225 }
226 
227 $moreparam = array();
228 if (!empty($modecompta)) {
229  $moreparam['modecompta'] = $modecompta;
230 }
231 
232 report_header($name, $namelink, $period, $periodlink, $description, $builddate, $exportlink, $moreparam, $calcmode);
233 
234 if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') {
235  print info_admin($langs->trans("WarningReportNotReliable"), 0, 0, 1);
236 }
237 
238 
239 $name = array();
240 
241 // Show array
242 print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
243 print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
244 // Extra parameters management
245 foreach ($headerparams as $key => $value) {
246  print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
247 }
248 
249 $catotal = 0;
250 $catotal_ht = 0;
251 
252 if ($modecompta == 'CREANCES-DETTES') {
253  $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(f.total_ht) as amount, sum(f.total_ttc) as amount_ttc";
254  $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
255  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid";
256  $sql .= " WHERE f.fk_statut in (1,2)";
257  if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
258  $sql .= " AND f.type IN (0,1,2,5)";
259  } else {
260  $sql .= " AND f.type IN (0,1,2,3,5)";
261  }
262  if ($date_start && $date_end) {
263  $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
264  }
265 } elseif ($modecompta == "RECETTES-DEPENSES") {
266  /*
267  * List of payments (old payments are not seen by this query because on older versions,
268  * they were not linked via the table llx_paiement_facture. They are added later)
269  */
270  $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(pf.amount) as amount_ttc";
271  $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
272  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid ";
273  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON pf.fk_facture = f.rowid";
274  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement as p ON p.rowid = pf.fk_paiement";
275  $sql .= " WHERE 1=1";
276  if ($date_start && $date_end) {
277  $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
278  }
279 } elseif ($modecompta == "BOOKKEEPING") {
280 } elseif ($modecompta == "BOOKKEEPINGCOLLECTED") {
281 }
282 $sql .= " AND f.entity IN (".getEntity('invoice').")";
283 if ($socid) {
284  $sql .= " AND f.fk_soc = ".((int) $socid);
285 }
286 $sql .= " GROUP BY u.rowid, u.lastname, u.firstname";
287 $sql .= " ORDER BY u.rowid";
288 
289 $amount = array();
290 
291 dol_syslog("cabyuser", LOG_DEBUG);
292 $result = $db->query($sql);
293 if ($result) {
294  $num = $db->num_rows($result);
295  $i = 0;
296  while ($i < $num) {
297  $obj = $db->fetch_object($result);
298  $amount_ht[$obj->rowid] = $obj->amount;
299  $amount[$obj->rowid] = $obj->amount_ttc;
300  $name[$obj->rowid] = $obj->name.' '.$obj->firstname;
301  $catotal_ht += $obj->amount;
302  $catotal += $obj->amount_ttc;
303  $i++;
304  }
305 } else {
306  dol_print_error($db);
307 }
308 
309 // Adding old-version payments, non-bound by table llx_paiement_facture then without User
310 if ($modecompta == 'RECETTES-DEPENSES') {
311  $sql = "SELECT -1 as rowidx, '' as name, '' as firstname, sum(DISTINCT p.amount) as amount_ttc";
312  $sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
313  $sql .= ", ".MAIN_DB_PREFIX."bank_account as ba";
314  $sql .= ", ".MAIN_DB_PREFIX."paiement as p";
315  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement";
316  $sql .= " WHERE pf.rowid IS NULL";
317  $sql .= " AND p.fk_bank = b.rowid";
318  $sql .= " AND b.fk_account = ba.rowid";
319  $sql .= " AND ba.entity IN (".getEntity('bank_account').")";
320  if ($date_start && $date_end) {
321  $sql .= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
322  }
323  $sql .= " GROUP BY rowidx, name, firstname";
324  $sql .= " ORDER BY rowidx";
325 
326  $result = $db->query($sql);
327  if ($result) {
328  $num = $db->num_rows($result);
329  $i = 0;
330  while ($i < $num) {
331  $obj = $db->fetch_object($result);
332  $amount[$obj->rowidx] = $obj->amount_ttc;
333  $name[$obj->rowidx] = $obj->name.' '.$obj->firstname;
334  $catotal += $obj->amount_ttc;
335  $i++;
336  }
337  } else {
338  dol_print_error($db);
339  }
340 }
341 
342 $moreforfilter = '';
343 
344 print '<div class="div-table-responsive">';
345 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
346 
347 print "<tr class=\"liste_titre\">";
349  $langs->trans("User"),
350  $_SERVER["PHP_SELF"],
351  "name",
352  "",
353  $paramslink,
354  "",
355  $sortfield,
356  $sortorder
357 );
358 if ($modecompta == 'CREANCES-DETTES') {
360  $langs->trans('AmountHT'),
361  $_SERVER["PHP_SELF"],
362  "amount_ht",
363  "",
364  $paramslink,
365  'class="right"',
366  $sortfield,
367  $sortorder
368  );
369 } else {
371 }
373  $langs->trans("AmountTTC"),
374  $_SERVER["PHP_SELF"],
375  "amount_ttc",
376  "",
377  $paramslink,
378  'class="right"',
379  $sortfield,
380  $sortorder
381 );
383  $langs->trans("Percentage"),
384  $_SERVER["PHP_SELF"],
385  "amount_ttc",
386  "",
387  $paramslink,
388  'class="right"',
389  $sortfield,
390  $sortorder
391 );
393  $langs->trans("OtherStatistics"),
394  $_SERVER["PHP_SELF"],
395  "",
396  "",
397  "",
398  'align="center" width="20%"'
399 );
400 print "</tr>\n";
401 
402 if (count($amount)) {
403  $arrayforsort = $name;
404 
405  // We define arrayforsort
406  if ($sortfield == 'name' && $sortorder == 'asc') {
407  asort($name);
408  $arrayforsort = $name;
409  }
410  if ($sortfield == 'name' && $sortorder == 'desc') {
411  arsort($name);
412  $arrayforsort = $name;
413  }
414  if ($sortfield == 'amount_ht' && $sortorder == 'asc') {
415  asort($amount_ht);
416  $arrayforsort = $amount_ht;
417  }
418  if ($sortfield == 'amount_ht' && $sortorder == 'desc') {
419  arsort($amount_ht);
420  $arrayforsort = $amount_ht;
421  }
422  if ($sortfield == 'amount_ttc' && $sortorder == 'asc') {
423  asort($amount);
424  $arrayforsort = $amount;
425  }
426  if ($sortfield == 'amount_ttc' && $sortorder == 'desc') {
427  arsort($amount);
428  $arrayforsort = $amount;
429  }
430 
431  $i = 0;
432 
433  foreach ($arrayforsort as $key => $value) {
434  print '<tr class="oddeven">';
435 
436  // Third party
437  $fullname = $name[$key];
438  if ($key >= 0) {
439  $linkname = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$key.'">'.img_object($langs->trans("ShowUser"), 'user').' '.$fullname.'</a>';
440  } else {
441  $linkname = $langs->trans("PaymentsNotLinkedToUser");
442  }
443  print "<td>".$linkname."</td>\n";
444 
445  // Amount w/o VAT
446  print '<td class="right">';
447  if ($modecompta == 'RECETTES-DEPENSES') {
448  if ($key > 0) {
449  //print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid='.$key.'">';
450  } else {
451  //print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid=-1">';
452  }
453  } elseif ($modecompta == 'CREANCES-DETTES') {
454  if ($key > 0) {
455  print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?userid='.$key.'">';
456  } else {
457  //print '<a href="#">';
458  }
459  print price($amount_ht[$key]);
460  if ($key > 0) {
461  print '</a>';
462  }
463  }
464  print '</td>';
465 
466  // Amount with VAT
467  print '<td class="right">';
468  if ($modecompta == 'RECETTES-DEPENSES') {
469  if ($key > 0) {
470  //print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid='.$key.'">';
471  } else {
472  //print '<a href="'.DOL_URL_ROOT.'/compta/paiement/list.php?userid=-1">';
473  }
474  } elseif ($modecompta == 'CREANCES-DETTES') {
475  if ($key > 0) {
476  print '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?userid='.$key.'">';
477  } else {
478  //print '<a href="#">';
479  }
480  }
481  print price($amount[$key]);
482  if ($modecompta == 'RECETTES-DEPENSES') {
483  if ($key > 0) {
484  //print '</a>';
485  } else {
486  //print '</a>';
487  }
488  } elseif ($modecompta == 'CREANCES-DETTES') {
489  if ($key > 0) {
490  print '</a>';
491  }
492  }
493  print '</td>';
494 
495  // Percent
496  print '<td class="right">'.($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2).'%' : '&nbsp;').'</td>';
497 
498  // Other stats
499  print '<td class="center">';
500  if (isModEnabled('propal') && $key > 0) {
501  print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"), "stats").'</a>&nbsp;';
502  }
503  if (isModEnabled('commande') && $key > 0) {
504  print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"), "stats").'</a>&nbsp;';
505  }
506  if (isModEnabled('facture') && $key > 0) {
507  print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"), "stats").'</a>&nbsp;';
508  }
509  print '</td>';
510  print "</tr>\n";
511  $i++;
512  }
513 
514  // Total
515  print '<tr class="liste_total">';
516  print '<td>'.$langs->trans("Total").'</td>';
517  if ($modecompta != 'CREANCES-DETTES') {
518  print '<td></td>';
519  } else {
520  print '<td class="right">'.price($catotal_ht).'</td>';
521  }
522  print '<td class="right">'.price($catotal).'</td>';
523  print '<td>&nbsp;</td>';
524  print '<td>&nbsp;</td>';
525  print '</tr>';
526 
527  $db->free($result);
528 }
529 
530 print "</table>";
531 print '</div>';
532 print '</form>';
533 
534 // End of page
535 llxFooter();
536 $db->close();
dol_getdate
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
Definition: functions.lib.php:2713
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
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