dolibarr  17.0.4
index.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
3  * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
4  * Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
5  * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
27 // Load Dolibarr environment
28 require '../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
31 require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
32 
33 // Load translation files required by the page
34 $langs->loadLangs(array("compta", "bills", "other", "accountancy"));
35 
36 $validatemonth = GETPOST('validatemonth', 'int');
37 $validateyear = GETPOST('validateyear', 'int');
38 
39 $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
40 if (GETPOST("year", 'int')) {
41  $year_start = GETPOST("year", 'int');
42 } else {
43  $year_start = dol_print_date(dol_now(), '%Y');
44  if (dol_print_date(dol_now(), '%m') < $month_start) {
45  $year_start--; // If current month is lower that starting fiscal month, we start last year
46  }
47 }
48 $year_end = $year_start + 1;
49 $month_end = $month_start - 1;
50 if ($month_end < 1) {
51  $month_end = 12;
52  $year_end--;
53 }
54 $search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
55 $search_date_end = dol_get_last_day($year_end, $month_end);
56 $year_current = $year_start;
57 
58 // Validate History
59 $action = GETPOST('action', 'aZ09');
60 
61 $chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
62 
63 // Security check
64 if (!isModEnabled('accounting')) {
66 }
67 if ($user->socid > 0) {
69 }
70 if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
72 }
73 
74 
75 /*
76  * Actions
77  */
78 
79 if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('accounting', 'bind', 'write')) {
80  // Clean database
81  $db->begin();
82  $sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd";
83  $sql1 .= " SET fk_code_ventilation = 0";
84  $sql1 .= ' WHERE erd.fk_code_ventilation NOT IN';
85  $sql1 .= ' (SELECT accnt.rowid ';
86  $sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt';
87  $sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst';
88  $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity).')';
89  $sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'expensereport WHERE entity = '.((int) $conf->entity).')';
90  $sql1 .= ' AND fk_code_ventilation <> 0';
91  dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
92  $resql1 = $db->query($sql1);
93  if (!$resql1) {
94  $error++;
95  $db->rollback();
96  setEventMessages($db->lasterror(), null, 'errors');
97  } else {
98  $db->commit();
99  }
100  // End clean database
101 }
102 
103 if ($action == 'validatehistory') {
104  $error = 0;
105  $nbbinddone = 0;
106  $notpossible = 0;
107 
108  $db->begin();
109 
110  // Now make the binding
111  $sql1 = "SELECT erd.rowid, accnt.rowid as suggestedid";
112  $sql1 .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
113  $sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_fees as t ON erd.fk_c_type_fees = t.id";
114  $sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as accnt ON t.accountancy_code = accnt.account_number AND accnt.active = 1 AND accnt.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND accnt.entity =".((int) $conf->entity).",";
115  $sql1 .= " ".MAIN_DB_PREFIX."expensereport as er";
116  $sql1 .= " WHERE erd.fk_expensereport = er.rowid AND er.entity = ".((int) $conf->entity);
117  $sql1 .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <= 0";
118  if ($validatemonth && $validateyear) {
119  $sql1 .= dolSqlDateFilter('erd.date', 0, $validatemonth, $validateyear);
120  }
121 
122  dol_syslog('htdocs/accountancy/expensereport/index.php');
123 
124  $result = $db->query($sql1);
125  if (!$result) {
126  $error++;
127  setEventMessages($db->lasterror(), null, 'errors');
128  } else {
129  $num_lines = $db->num_rows($result);
130 
131  $i = 0;
132  while ($i < min($num_lines, 10000)) { // No more than 10000 at once
133  $objp = $db->fetch_object($result);
134 
135  $lineid = $objp->rowid;
136  $suggestedid = $objp->suggestedid;
137 
138  if ($suggestedid > 0) {
139  $sqlupdate = "UPDATE ".MAIN_DB_PREFIX."expensereport_det";
140  $sqlupdate .= " SET fk_code_ventilation = ".((int) $suggestedid);
141  $sqlupdate .= " WHERE fk_code_ventilation <= 0 AND rowid = ".((int) $lineid);
142 
143  $resqlupdate = $db->query($sqlupdate);
144  if (!$resqlupdate) {
145  $error++;
146  setEventMessages($db->lasterror(), null, 'errors');
147  break;
148  } else {
149  $nbbinddone++;
150  }
151  } else {
152  $notpossible++;
153  }
154 
155  $i++;
156  }
157  if ($num_lines > 10000) {
158  $notpossible += ($num_lines - 10000);
159  }
160  }
161 
162  if ($error) {
163  $db->rollback();
164  } else {
165  $db->commit();
166  setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, 'mesgs');
167  }
168 }
169 
170 
171 /*
172  * View
173  */
174 
175 llxHeader('', $langs->trans("ExpenseReportsVentilation"));
176 
177 $textprevyear = '<a href="'.$_SERVER["PHP_SELF"].'?year='.($year_current - 1).'">'.img_previous().'</a>';
178 $textnextyear = '&nbsp;<a href="'.$_SERVER["PHP_SELF"].'?year='.($year_current + 1).'">'.img_next().'</a>';
179 
180 
181 print load_fiche_titre($langs->trans("ExpenseReportsVentilation")."&nbsp;".$textprevyear."&nbsp;".$langs->trans("Year")."&nbsp;".$year_start."&nbsp;".$textnextyear, '', 'title_accountancy');
182 
183 print '<span class="opacitymedium">'.$langs->trans("DescVentilExpenseReport").'</span><br>';
184 print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("DescVentilExpenseReportMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")).'<br>';
185 print '</span><br>';
186 
187 
188 $y = $year_current;
189 
190 $buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=validatehistory&token='.newToken().'&year='.$year_current.'">'.$langs->trans("ValidateHistory").'</a>';
191 
192 
193 print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
194 //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
195 
196 print '<div class="div-table-responsive-no-min">';
197 print '<table class="noborder centpercent">';
198 print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
199 print '<td>'.$langs->trans("Label").'</td>';
200 for ($i = 1; $i <= 12; $i++) {
201  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
202  if ($j > 12) {
203  $j -= 12;
204  }
205  $cursormonth = $j;
206  if ($cursormonth > 12) {
207  $cursormonth -= 12;
208  }
209  $cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
210  $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
211 
212  print '<td width="60" class="right">';
213  if (!empty($tmp['mday'])) {
214  $param = 'search_date_startday=1&search_date_startmonth='.$cursormonth.'&search_date_startyear='.$cursoryear;
215  $param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
216  $param .= '&search_month='.$tmp['mon'].'&search_year='.$tmp['year'];
217  print '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/list.php?'.$param.'">';
218  }
219  print $langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT));
220  if (!empty($tmp['mday'])) {
221  print '</a>';
222  }
223  print '</td>';
224 }
225 print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
226 
227 $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
228 $sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
229 for ($i = 1; $i <= 12; $i++) {
230  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
231  if ($j > 12) {
232  $j -= 12;
233  }
234  $sql .= " SUM(".$db->ifsql("MONTH(er.date_debut)=".$j, "erd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
235 }
236 $sql .= " SUM(erd.total_ht) as total";
237 $sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
238 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport as er ON er.rowid = erd.fk_expensereport";
239 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
240 $sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
241 $sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
242 // Define begin binding date
243 if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
244  $sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
245 }
246 $sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
247 $sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
248 $sql .= " AND aa.account_number IS NULL";
249 $sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
250 $sql .= ' ORDER BY aa.account_number';
251 
252 dol_syslog('/accountancy/expensereport/index.php', LOG_DEBUG);
253 $resql = $db->query($sql);
254 if ($resql) {
255  $num = $db->num_rows($resql);
256 
257  while ($row = $db->fetch_row($resql)) {
258  print '<tr class="oddeven">';
259  print '<td>';
260  if ($row[0] == 'tobind') {
261  print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
262  } else {
263  print length_accountg($row[0]);
264  }
265  print '</td>';
266  print '<td>';
267  if ($row[0] == 'tobind') {
268  print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind"));
269  } else {
270  print $row[1];
271  }
272  print '</td>';
273  for ($i = 2; $i <= 13; $i++) {
274  print '<td class="right nowraponall amount">';
275  print price($row[$i]);
276  print '</td>';
277  }
278  print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
279  print '</tr>';
280  }
281  $db->free($resql);
282 
283  if ($num == 0) {
284  print '<tr class="oddeven"><td colspan="16">';
285  print '<span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span>';
286  print '</td></tr>';
287  }
288 } else {
289  print $db->lasterror(); // Show last sql error
290 }
291 print "</table>\n";
292 print '</div>';
293 
294 
295 print '<br>';
296 
297 
298 print_barre_liste(img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
299 //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
300 
301 
302 print '<div class="div-table-responsive-no-min">';
303 print '<table class="noborder centpercent">';
304 print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
305 print '<td>'.$langs->trans("Label").'</td>';
306 for ($i = 1; $i <= 12; $i++) {
307  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
308  if ($j > 12) {
309  $j -= 12;
310  }
311  print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
312 }
313 print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
314 
315 $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
316 $sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
317 for ($i = 1; $i <= 12; $i++) {
318  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
319  if ($j > 12) {
320  $j -= 12;
321  }
322  $sql .= " SUM(".$db->ifsql("MONTH(er.date_debut)=".$j, "erd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
323 }
324 $sql .= " ROUND(SUM(erd.total_ht),2) as total";
325 $sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
326 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport as er ON er.rowid = erd.fk_expensereport";
327 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
328 $sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
329 $sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
330 // Define begin binding date
331 if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
332  $sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
333 }
334 $sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
335 $sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
336 $sql .= " AND aa.account_number IS NOT NULL";
337 $sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
338 
339 dol_syslog('htdocs/accountancy/expensereport/index.php');
340 $resql = $db->query($sql);
341 if ($resql) {
342  $num = $db->num_rows($resql);
343 
344  while ($row = $db->fetch_row($resql)) {
345  print '<tr class="oddeven">';
346  print '<td>';
347  if ($row[0] == 'tobind') {
348  print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
349  } else {
350  print length_accountg($row[0]);
351  }
352  print '</td>';
353 
354  print '<td>';
355  if ($row[0] == 'tobind') {
356  print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind"));
357  } else {
358  print $row[1];
359  }
360  print '</td>';
361  for ($i = 2; $i <= 13; $i++) {
362  print '<td class="right nowraponall amount">';
363  print price($row[$i]);
364  print '</td>';
365  }
366  print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
367  print '</tr>';
368  }
369  $db->free($resql);
370 } else {
371  print $db->lasterror(); // Show last sql error
372 }
373 print "</table>\n";
374 print '</div>';
375 
376 
377 
378 if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange. Why showing a report where results depends on next step (so not yet available) ?
379  print '<br>';
380  print '<br>';
381 
382  print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
383  //print load_fiche_titre($langs->trans("OtherInfo"), '', '');
384 
385  print '<div class="div-table-responsive-no-min">';
386  print '<table class="noborder centpercent">';
387  print '<tr class="liste_titre"><td class="left">'.$langs->trans("Total").'</td>';
388  for ($i = 1; $i <= 12; $i++) {
389  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
390  if ($j > 12) {
391  $j -= 12;
392  }
393  print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
394  }
395  print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
396 
397  $sql = "SELECT '".$db->escape($langs->trans("TotalExpenseReport"))."' AS label,";
398  for ($i = 1; $i <= 12; $i++) {
399  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
400  if ($j > 12) {
401  $j -= 12;
402  }
403  $sql .= " SUM(".$db->ifsql("MONTH(er.date_create)=".$j, "erd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
404  }
405  $sql .= " SUM(erd.total_ht) as total";
406  $sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
407  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport as er ON er.rowid = erd.fk_expensereport";
408  $sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
409  $sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
410  // Define begin binding date
411  if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
412  $sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
413  }
414  $sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
415  $sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
416 
417  dol_syslog('htdocs/accountancy/expensereport/index.php');
418  $resql = $db->query($sql);
419  if ($resql) {
420  $num = $db->num_rows($resql);
421 
422  while ($row = $db->fetch_row($resql)) {
423  print '<tr><td>'.$row[0].'</td>';
424  for ($i = 1; $i <= 12; $i++) {
425  print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
426  }
427  print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
428  print '</tr>';
429  }
430 
431  $db->free($resql);
432  } else {
433  print $db->lasterror(); // Show last sql error
434  }
435  print "</table>\n";
436  print '</div>';
437 }
438 
439 // End of page
440 llxFooter();
441 $db->close();
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous)
const STATUS_CLOSED
Classified paid.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:745
dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand=0, $gm=false)
Generate a SQL string to make a filter into a range (for second of date until last second of date).
Definition: date.lib.php:358
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition: date.lib.php:594
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...
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_getIdFromCode($db, $key, $tablename, $fieldkey='code', $fieldid='id', $entityfilter=0, $filters='')
Return an id or code from a code or id.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_next($titlealt='default', $moreatt='')
Show next logo.
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.
llxFooter()
Footer empty.
Definition: index.php:71
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
Definition: index.php:63
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.