dolibarr  16.0.5
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 require '../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
30 require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
31 
32 // Load translation files required by the page
33 $langs->loadLangs(array("compta", "bills", "other", "accountancy"));
34 
35 $validatemonth = GETPOST('validatemonth', 'int');
36 $validateyear = GETPOST('validateyear', 'int');
37 
38 $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
39 if (GETPOST("year", 'int')) {
40  $year_start = GETPOST("year", 'int');
41 } else {
42  $year_start = dol_print_date(dol_now(), '%Y');
43  if (dol_print_date(dol_now(), '%m') < $month_start) {
44  $year_start--; // If current month is lower that starting fiscal month, we start last year
45  }
46 }
47 $year_end = $year_start + 1;
48 $month_end = $month_start - 1;
49 if ($month_end < 1) {
50  $month_end = 12;
51  $year_end--;
52 }
53 $search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
54 $search_date_end = dol_get_last_day($year_end, $month_end);
55 $year_current = $year_start;
56 
57 // Validate History
58 $action = GETPOST('action', 'aZ09');
59 
60 // Security check
61 if (!isModEnabled('accounting')) {
63 }
64 if ($user->socid > 0) {
66 }
67 if (empty($user->rights->accounting->mouvements->lire)) {
69 }
70 
71 
72 /*
73  * Actions
74  */
75 
76 if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accounting->bind->write) {
77  // Clean database
78  $db->begin();
79  $sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd";
80  $sql1 .= " SET fk_code_ventilation = 0";
81  $sql1 .= ' WHERE erd.fk_code_ventilation NOT IN';
82  $sql1 .= ' (SELECT accnt.rowid ';
83  $sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt';
84  $sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst';
85  $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity).')';
86  $sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'expensereport WHERE entity = '.((int) $conf->entity).')';
87  $sql1 .= ' AND fk_code_ventilation <> 0';
88  dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
89  $resql1 = $db->query($sql1);
90  if (!$resql1) {
91  $error++;
92  $db->rollback();
93  setEventMessages($db->lasterror(), null, 'errors');
94  } else {
95  $db->commit();
96  }
97  // End clean database
98 }
99 
100 if ($action == 'validatehistory') {
101  $error = 0;
102  $nbbinddone = 0;
103  $notpossible = 0;
104 
105  $db->begin();
106 
107  // Now make the binding
108  $sql1 = "SELECT erd.rowid, accnt.rowid as suggestedid";
109  $sql1 .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
110  $sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_fees as t ON erd.fk_c_type_fees = t.id";
111  $sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as accnt ON t.accountancy_code = accnt.account_number AND accnt.active = 1 AND accnt.entity =".((int) $conf->entity);
112  $sql1 .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as syst ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".((int) $conf->global->CHARTOFACCOUNTS).' AND syst.active = 1,';
113  $sql1 .= " ".MAIN_DB_PREFIX."expensereport as er";
114  $sql1 .= " WHERE erd.fk_expensereport = er.rowid AND er.entity = ".((int) $conf->entity);
115  $sql1 .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <= 0";
116  if ($validatemonth && $validateyear) {
117  $sql1 .= dolSqlDateFilter('erd.date', 0, $validatemonth, $validateyear);
118  }
119 
120  dol_syslog('htdocs/accountancy/expensereport/index.php');
121 
122  $result = $db->query($sql1);
123  if (!$result) {
124  $error++;
125  setEventMessages($db->lasterror(), null, 'errors');
126  } else {
127  $num_lines = $db->num_rows($result);
128 
129  $i = 0;
130  while ($i < min($num_lines, 10000)) { // No more than 10000 at once
131  $objp = $db->fetch_object($result);
132 
133  $lineid = $objp->rowid;
134  $suggestedid = $objp->suggestedid;
135 
136  if ($suggestedid > 0) {
137  $sqlupdate = "UPDATE ".MAIN_DB_PREFIX."expensereport_det";
138  $sqlupdate .= " SET fk_code_ventilation = ".((int) $suggestedid);
139  $sqlupdate .= " WHERE fk_code_ventilation <= 0 AND rowid = ".((int) $lineid);
140 
141  $resqlupdate = $db->query($sqlupdate);
142  if (!$resqlupdate) {
143  $error++;
144  setEventMessages($db->lasterror(), null, 'errors');
145  break;
146  } else {
147  $nbbinddone++;
148  }
149  } else {
150  $notpossible++;
151  }
152 
153  $i++;
154  }
155  if ($num_lines > 10000) {
156  $notpossible += ($num_lines - 10000);
157  }
158  }
159 
160  if ($error) {
161  $db->rollback();
162  } else {
163  $db->commit();
164  setEventMessages($langs->trans('AutomaticBindingDone', $nbbinddone, $notpossible), null, 'mesgs');
165  }
166 }
167 
168 
169 /*
170  * View
171  */
172 
173 llxHeader('', $langs->trans("ExpenseReportsVentilation"));
174 
175 $textprevyear = '<a href="'.$_SERVER["PHP_SELF"].'?year='.($year_current - 1).'">'.img_previous().'</a>';
176 $textnextyear = '&nbsp;<a href="'.$_SERVER["PHP_SELF"].'?year='.($year_current + 1).'">'.img_next().'</a>';
177 
178 print load_fiche_titre($langs->trans("ExpenseReportsVentilation")."&nbsp;".$textprevyear."&nbsp;".$langs->trans("Year")."&nbsp;".$year_start."&nbsp;".$textnextyear, '', 'title_accountancy');
179 
180 print '<span class="opacitymedium">'.$langs->trans("DescVentilExpenseReport").'</span><br>';
181 print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("DescVentilExpenseReportMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")).'<br>';
182 print '</span><br>';
183 
184 
185 $y = $year_current;
186 
187 $buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=validatehistory&token='.newToken().'&year='.$year_current.'">'.$langs->trans("ValidateHistory").'</a>';
188 
189 
190 print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
191 //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
192 
193 print '<div class="div-table-responsive-no-min">';
194 print '<table class="noborder centpercent">';
195 print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
196 print '<td>'.$langs->trans("Label").'</td>';
197 for ($i = 1; $i <= 12; $i++) {
198  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
199  if ($j > 12) {
200  $j -= 12;
201  }
202  $cursormonth = $j;
203  if ($cursormonth > 12) {
204  $cursormonth -= 12;
205  }
206  $cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
207  $tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
208 
209  print '<td width="60" class="right">';
210  if (!empty($tmp['mday'])) {
211  $param = 'search_date_startday=1&search_date_startmonth='.$cursormonth.'&search_date_startyear='.$cursoryear;
212  $param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
213  $param .= '&search_month='.$tmp['mon'].'&search_year='.$tmp['year'];
214  print '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/list.php?'.$param.'">';
215  }
216  print $langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT));
217  if (!empty($tmp['mday'])) {
218  print '</a>';
219  }
220  print '</td>';
221 }
222 print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
223 
224 $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
225 $sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
226 for ($i = 1; $i <= 12; $i++) {
227  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
228  if ($j > 12) {
229  $j -= 12;
230  }
231  $sql .= " SUM(".$db->ifsql("MONTH(er.date_debut)=".$j, "erd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
232 }
233 $sql .= " SUM(erd.total_ht) as total";
234 $sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
235 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport as er ON er.rowid = erd.fk_expensereport";
236 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
237 $sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
238 $sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
239 // Define begin binding date
240 if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
241  $sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
242 }
243 $sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
244 $sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
245 $sql .= " AND aa.account_number IS NULL";
246 $sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
247 $sql .= ' ORDER BY aa.account_number';
248 
249 dol_syslog('/accountancy/expensereport/index.php:: sql='.$sql);
250 $resql = $db->query($sql);
251 if ($resql) {
252  $num = $db->num_rows($resql);
253 
254  while ($row = $db->fetch_row($resql)) {
255  print '<tr class="oddeven">';
256  print '<td>';
257  if ($row[0] == 'tobind') {
258  print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
259  } else {
260  print length_accountg($row[0]);
261  }
262  print '</td>';
263  print '<td>';
264  if ($row[0] == 'tobind') {
265  print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind"));
266  } else {
267  print $row[1];
268  }
269  print '</td>';
270  for ($i = 2; $i <= 13; $i++) {
271  print '<td class="right nowraponall amount">';
272  print price($row[$i]);
273  print '</td>';
274  }
275  print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
276  print '</tr>';
277  }
278  $db->free($resql);
279 } else {
280  print $db->lasterror(); // Show last sql error
281 }
282 print "</table>\n";
283 print '</div>';
284 
285 
286 print '<br>';
287 
288 
289 print_barre_liste(img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
290 //print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
291 
292 
293 print '<div class="div-table-responsive-no-min">';
294 print '<table class="noborder centpercent">';
295 print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
296 print '<td>'.$langs->trans("Label").'</td>';
297 for ($i = 1; $i <= 12; $i++) {
298  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
299  if ($j > 12) {
300  $j -= 12;
301  }
302  print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
303 }
304 print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
305 
306 $sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
307 $sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
308 for ($i = 1; $i <= 12; $i++) {
309  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
310  if ($j > 12) {
311  $j -= 12;
312  }
313  $sql .= " SUM(".$db->ifsql("MONTH(er.date_debut)=".$j, "erd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
314 }
315 $sql .= " ROUND(SUM(erd.total_ht),2) as total";
316 $sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
317 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport as er ON er.rowid = erd.fk_expensereport";
318 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
319 $sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
320 $sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
321 // Define begin binding date
322 if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
323  $sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
324 }
325 $sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
326 $sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
327 $sql .= " AND aa.account_number IS NOT NULL";
328 $sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
329 
330 dol_syslog('htdocs/accountancy/expensereport/index.php');
331 $resql = $db->query($sql);
332 if ($resql) {
333  $num = $db->num_rows($resql);
334 
335  while ($row = $db->fetch_row($resql)) {
336  print '<tr class="oddeven">';
337  print '<td>';
338  if ($row[0] == 'tobind') {
339  print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
340  } else {
341  print length_accountg($row[0]);
342  }
343  print '</td>';
344 
345  print '<td>';
346  if ($row[0] == 'tobind') {
347  print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind"));
348  } else {
349  print $row[1];
350  }
351  print '</td>';
352  for ($i = 2; $i <= 13; $i++) {
353  print '<td class="right nowraponall amount">';
354  print price($row[$i]);
355  print '</td>';
356  }
357  print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
358  print '</tr>';
359  }
360  $db->free($resql);
361 } else {
362  print $db->lasterror(); // Show last sql error
363 }
364 print "</table>\n";
365 print '</div>';
366 
367 
368 
369 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) ?
370  print '<br>';
371  print '<br>';
372 
373  print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
374  //print load_fiche_titre($langs->trans("OtherInfo"), '', '');
375 
376  print '<div class="div-table-responsive-no-min">';
377  print '<table class="noborder centpercent">';
378  print '<tr class="liste_titre"><td class="left">'.$langs->trans("Total").'</td>';
379  for ($i = 1; $i <= 12; $i++) {
380  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
381  if ($j > 12) {
382  $j -= 12;
383  }
384  print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
385  }
386  print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
387 
388  $sql = "SELECT '".$db->escape($langs->trans("TotalExpenseReport"))."' AS label,";
389  for ($i = 1; $i <= 12; $i++) {
390  $j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
391  if ($j > 12) {
392  $j -= 12;
393  }
394  $sql .= " SUM(".$db->ifsql("MONTH(er.date_create)=".$j, "erd.total_ht", "0").") AS month".str_pad($j, 2, "0", STR_PAD_LEFT).",";
395  }
396  $sql .= " SUM(erd.total_ht) as total";
397  $sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
398  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expensereport as er ON er.rowid = erd.fk_expensereport";
399  $sql .= " WHERE er.date_debut >= '".$db->idate($search_date_start)."'";
400  $sql .= " AND er.date_debut <= '".$db->idate($search_date_end)."'";
401  // Define begin binding date
402  if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
403  $sql .= " AND er.date_debut >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
404  }
405  $sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
406  $sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
407 
408  dol_syslog('htdocs/accountancy/expensereport/index.php');
409  $resql = $db->query($sql);
410  if ($resql) {
411  $num = $db->num_rows($resql);
412 
413  while ($row = $db->fetch_row($resql)) {
414  print '<tr><td>'.$row[0].'</td>';
415  for ($i = 1; $i <= 12; $i++) {
416  print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
417  }
418  print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
419  print '</tr>';
420  }
421 
422  $db->free($resql);
423  } else {
424  print $db->lasterror(); // Show last sql error
425  }
426  print "</table>\n";
427  print '</div>';
428 }
429 
430 // End of page
431 llxFooter();
432 $db->close();
dol_getdate
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
Definition: functions.lib.php:2713
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
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_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
llxFooter
llxFooter()
Footer empty.
Definition: index.php:71
img_next
img_next($titlealt='default', $moreatt='')
Show next logo.
Definition: functions.lib.php:4557
ExpenseReport\STATUS_CLOSED
const STATUS_CLOSED
Classified paid.
Definition: expensereport.class.php:165
length_accountg
length_accountg($account)
Return General accounting account with defined length (used for product and miscellaneous)
Definition: accounting.lib.php:94
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1603
print_barre_liste
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.
Definition: functions.lib.php:5257
llxHeader
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
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
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10878
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition: functions.lib.php:105
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2845
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->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->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
dolSqlDateFilter
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:334
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
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
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