dolibarr  16.0.5
list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
5  * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
6  * Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
7  * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
8  * Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
9  * Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
10  * Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <https://www.gnu.org/licenses/>.
24  */
25 
32 require '../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
37 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
38 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formexpensereport.class.php';
39 require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
40 require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php';
41 
42 // Load translation files required by the page
43 $langs->loadLangs(array('companies', 'users', 'trips'));
44 
45 $action = GETPOST('action', 'aZ09');
46 $massaction = GETPOST('massaction', 'alpha');
47 $show_files = GETPOST('show_files', 'int');
48 $confirm = GETPOST('confirm', 'alpha');
49 $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
50 $toselect = GETPOST('toselect', 'array');
51 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'expensereportlist';
52 
53 $childids = $user->getAllChildIds(1);
54 
55 // Security check
56 $socid = GETPOST('socid', 'int');
57 if ($user->socid) {
58  $socid = $user->socid;
59 }
60 $result = restrictedArea($user, 'expensereport', '', '');
61 $id = GETPOST('id', 'int');
62 // If we are on the view of a specific user
63 if ($id > 0) {
64  $canread = 0;
65  if ($id == $user->id) {
66  $canread = 1;
67  }
68  if (!empty($user->rights->expensereport->readall)) {
69  $canread = 1;
70  }
71  if (!empty($user->rights->expensereport->lire) && in_array($id, $childids)) {
72  $canread = 1;
73  }
74  if (!$canread) {
76  }
77 }
78 
79 $diroutputmassaction = $conf->expensereport->dir_output.'/temp/massgeneration/'.$user->id;
80 
81 
82 // Load variable for pagination
83 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
84 $sortfield = GETPOST('sortfield', 'aZ09comma');
85 $sortorder = GETPOST('sortorder', 'aZ09comma');
86 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
87 if (empty($page) || $page == -1) {
88  $page = 0;
89 } // If $page is not defined, or '' or -1
90 $offset = $limit * $page;
91 $pageprev = $page - 1;
92 $pagenext = $page + 1;
93 if (!$sortorder) {
94  $sortorder = "DESC";
95 }
96 if (!$sortfield) {
97  $sortfield = "d.date_debut";
98 }
99 
100 
101 $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
102 
103 $search_ref = GETPOST('search_ref', 'alpha');
104 $search_user = GETPOST('search_user', 'int');
105 $search_amount_ht = GETPOST('search_amount_ht', 'alpha');
106 $search_amount_vat = GETPOST('search_amount_vat', 'alpha');
107 $search_amount_ttc = GETPOST('search_amount_ttc', 'alpha');
108 $search_status = (GETPOST('search_status', 'intcomma') != '' ?GETPOST('search_status', 'intcomma') : GETPOST('statut', 'intcomma'));
109 
110 $search_date_startday = GETPOST('search_date_startday', 'int');
111 $search_date_startmonth = GETPOST('search_date_startmonth', 'int');
112 $search_date_startyear = GETPOST('search_date_startyear', 'int');
113 $search_date_startendday = GETPOST('search_date_startendday', 'int');
114 $search_date_startendmonth = GETPOST('search_date_startendmonth', 'int');
115 $search_date_startendyear = GETPOST('search_date_startendyear', 'int');
116 $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
117 $search_date_startend = dol_mktime(23, 59, 59, $search_date_startendmonth, $search_date_startendday, $search_date_startendyear);
118 
119 $search_date_endday = GETPOST('search_date_endday', 'int');
120 $search_date_endmonth = GETPOST('search_date_endmonth', 'int');
121 $search_date_endyear = GETPOST('search_date_endyear', 'int');
122 $search_date_endendday = GETPOST('search_date_endendday', 'int');
123 $search_date_endendmonth = GETPOST('search_date_endendmonth', 'int');
124 $search_date_endendyear = GETPOST('search_date_endendyear', 'int');
125 $search_date_end = dol_mktime(0, 0, 0, $search_date_endmonth, $search_date_endday, $search_date_endyear); // Use tzserver
126 $search_date_endend = dol_mktime(23, 59, 59, $search_date_endendmonth, $search_date_endendday, $search_date_endendyear);
127 
128 $optioncss = GETPOST('optioncss', 'alpha');
129 
130 if ($search_status == '') {
131  $search_status = -1;
132 }
133 if ($search_user == '') {
134  $search_user = -1;
135 }
136 
137 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
138 $object = new ExpenseReport($db);
139 $hookmanager->initHooks(array('expensereportlist'));
140 $extrafields = new ExtraFields($db);
141 
142 // fetch optionals attributes and labels
143 $extrafields->fetch_name_optionals_label($object->table_element);
144 
145 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
146 
147 
148 // List of fields to search into when doing a "search in all"
149 $fieldstosearchall = array(
150  'd.ref'=>'Ref',
151  'd.note_public'=>"NotePublic",
152  'u.lastname'=>'EmployeeLastname',
153  'u.firstname'=>"EmployeeFirstname",
154  'u.login'=>"Login",
155 );
156 if (empty($user->socid)) {
157  $fieldstosearchall["d.note_private"] = "NotePrivate";
158 }
159 
160 $arrayfields = array(
161  'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
162  'user'=>array('label'=>$langs->trans("User"), 'checked'=>1),
163  'd.date_debut'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1),
164  'd.date_fin'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1),
165  'd.date_valid'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
166  'd.date_approve'=>array('label'=>$langs->trans("DateApprove"), 'checked'=>1),
167  'd.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
168  'd.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>1),
169  'd.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>1),
170  'd.date_create'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
171  'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
172  'd.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
173 );
174 // Extra fields
175 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
176 
177 $canedituser = (!empty($user->admin) || $user->rights->user->user->creer);
178 
179 $objectuser = new User($db);
180 
181 
182 /*
183  * Actions
184  */
185 
186 if (GETPOST('cancel', 'alpha')) {
187  $action = 'list'; $massaction = '';
188 }
189 if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
190  $massaction = '';
191 }
192 
193 $parameters = array('socid'=>$socid);
194 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
195 if ($reshook < 0) {
196  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
197 }
198 
199 if (empty($reshook)) {
200  // Selection of new fields
201  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
202 
203  // Purge search criteria
204  if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
205  $search_ref = "";
206  $search_user = "";
207  $search_amount_ht = "";
208  $search_amount_vat = "";
209  $search_amount_ttc = "";
210  $search_status = "";
211  $search_date_startday = '';
212  $search_date_startmonth = '';
213  $search_date_startyear = '';
214  $search_date_startendday = '';
215  $search_date_startendmonth = '';
216  $search_date_startendyear = '';
217  $search_date_start = '';
218  $search_date_startend = '';
219  $search_date_endday = '';
220  $search_date_endmonth = '';
221  $search_date_endyear = '';
222  $search_date_endendday = '';
223  $search_date_endendmonth = '';
224  $search_date_endendyear = '';
225  $search_date_end = '';
226  $search_date_endend = '';
227  $toselect = array();
228  $search_array_options = array();
229  }
230  if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
231  || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
232  $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
233  }
234 
235  // Mass actions
236  $objectclass = 'ExpenseReport';
237  $objectlabel = 'ExpenseReport';
238  $permissiontoread = $user->rights->expensereport->lire;
239  $permissiontodelete = $user->rights->expensereport->supprimer;
240  $uploaddir = $conf->expensereport->dir_output;
241  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
242 }
243 
244 
245 /*
246  * View
247  */
248 
249 $form = new Form($db);
250 $formother = new FormOther($db);
251 $formfile = new FormFile($db);
252 $formexpensereport = new FormExpenseReport($db);
253 
254 $fuser = new User($db);
255 
256 $title = $langs->trans("ListOfTrips");
257 llxHeader('', $title);
258 
259 $max_year = 5;
260 $min_year = 10;
261 
262 // Get current user id
263 $user_id = $user->id;
264 
265 if ($id > 0) {
266  // Charge utilisateur edite
267  $fuser->fetch($id, '', '', 1);
268  $fuser->getrights();
269  $user_id = $fuser->id;
270 
271  $search_user = $user_id;
272 }
273 
274 $sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.total_ttc, d.fk_statut as status,";
275 $sql .= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve, d.note_private, d.note_public,";
276 $sql .= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.email, u.statut, u.photo";
277 // Add fields from extrafields
278 if (!empty($extrafields->attributes[$object->table_element]['label'])) {
279  foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
280  $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
281  }
282 }
283 // Add fields from hooks
284 $parameters = array();
285 $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
286 $sql .= $hookmanager->resPrint;
287 $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as d";
288 if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
289  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)";
290 }
291 $sql .= ", ".MAIN_DB_PREFIX."user as u";
292 $sql .= " WHERE d.fk_user_author = u.rowid AND d.entity IN (".getEntity('expensereport').")";
293 // Search all
294 if (!empty($sall)) {
295  $sql .= natural_search(array_keys($fieldstosearchall), $sall);
296 }
297 // Ref
298 if (!empty($search_ref)) {
299  $sql .= natural_search('d.ref', $search_ref);
300 }
301 // Date Start
302 if ($search_date_start) {
303  $sql .= " AND d.date_debut >= '".$db->idate($search_date_start)."'";
304 }
305 if ($search_date_startend) {
306  $sql .= " AND d.date_debut <= '".$db->idate($search_date_startend)."'";
307 }
308 // Date End
309 if ($search_date_end) {
310  $sql .= " AND d.date_fin >= '".$db->idate($search_date_end)."'";
311 }
312 if ($search_date_endend) {
313  $sql .= " AND d.date_fin <= '".$db->idate($search_date_endend)."'";
314 }
315 
316 if ($search_amount_ht != '') {
317  $sql .= natural_search('d.total_ht', $search_amount_ht, 1);
318 }
319 if ($search_amount_ttc != '') {
320  $sql .= natural_search('d.total_ttc', $search_amount_ttc, 1);
321 }
322 // User
323 if ($search_user != '' && $search_user >= 0) {
324  $sql .= " AND u.rowid = '".$db->escape($search_user)."'";
325 }
326 // Status
327 if ($search_status != '' && $search_status >= 0) {
328  $sql .= " AND d.fk_statut IN (".$db->sanitize($search_status).")";
329 }
330 // RESTRICT RIGHTS
331 if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
332  && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance))) {
333  $sql .= " AND d.fk_user_author IN (".$db->sanitize(join(',', $childids)).")\n";
334 }
335 // Add where from extra fields
336 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
337 // Add where from hooks
338 $parameters = array();
339 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
340 $sql .= $hookmanager->resPrint;
341 
342 $sql .= $db->order($sortfield, $sortorder);
343 
344 // Count total nb of records
345 $nbtotalofrecords = '';
346 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
347  $result = $db->query($sql);
348  $nbtotalofrecords = $db->num_rows($result);
349  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
350  $page = 0;
351  $offset = 0;
352  }
353 }
354 
355 $sql .= $db->plimit($limit + 1, $offset);
356 
357 //print $sql;
358 $resql = $db->query($sql);
359 if ($resql) {
360  $num = $db->num_rows($resql);
361 
362  $arrayofselected = is_array($toselect) ? $toselect : array();
363 
364  $param = '';
365  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
366  $param .= '&contextpage='.urlencode($contextpage);
367  }
368  if ($limit > 0 && $limit != $conf->liste_limit) {
369  $param .= '&limit='.urlencode($limit);
370  }
371  if ($sall) {
372  $param .= "&sall=".urlencode($sall);
373  }
374  if ($search_ref) {
375  $param .= "&search_ref=".urlencode($search_ref);
376  }
377  // Start date
378  if ($search_date_startday) {
379  $param .= '&search_date_startday='.urlencode($search_date_startday);
380  }
381  if ($search_date_startmonth) {
382  $param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
383  }
384  if ($search_date_startyear) {
385  $param .= '&search_date_startyear='.urlencode($search_date_startyear);
386  }
387  if ($search_date_startendday) {
388  $param .= '&search_date_startendday='.urlencode($search_date_startendday);
389  }
390  if ($search_date_startendmonth) {
391  $param .= '&search_date_startendmonth='.urlencode($search_date_startendmonth);
392  }
393  if ($search_date_startendyear) {
394  $param .= '&search_date_startendyear='.urlencode($search_date_startendyear);
395  }
396  // End date
397  if ($search_date_endday) {
398  $param .= '&search_date_endday='.urlencode($search_date_endday);
399  }
400  if ($search_date_endmonth) {
401  $param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
402  }
403  if ($search_date_endyear) {
404  $param .= '&search_date_endyear='.urlencode($search_date_endyear);
405  }
406  if ($search_date_endendday) {
407  $param .= '&search_date_endendday='.urlencode($search_date_endendday);
408  }
409  if ($search_date_endendmonth) {
410  $param .= '&search_date_endendmonth='.urlencode($search_date_endendmonth);
411  }
412  if ($search_date_endendyear) {
413  $param .= '&search_date_endendyear='.urlencode($search_date_endendyear);
414  }
415  if ($search_user) {
416  $param .= "&search_user=".urlencode($search_user);
417  }
418  if ($search_amount_ht) {
419  $param .= "&search_amount_ht=".urlencode($search_amount_ht);
420  }
421  if ($search_amount_ttc) {
422  $param .= "&search_amount_ttc=".urlencode($search_amount_ttc);
423  }
424  if ($search_status >= 0) {
425  $param .= "&search_status=".urlencode($search_status);
426  }
427  if ($optioncss != '') {
428  $param .= '&optioncss='.urlencode($optioncss);
429  }
430  // Add $param from extra fields
431  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
432 
433  // List of mass actions available
434  $arrayofmassactions = array(
435  'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
436  'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
437  'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
438  );
439  if ($user->rights->expensereport->supprimer) {
440  $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
441  }
442  if (in_array($massaction, array('presend', 'predelete'))) {
443  $arrayofmassactions = array();
444  }
445  $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
446 
447  // Lines of title fields
448  print '<form id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
449  if ($optioncss != '') {
450  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
451  }
452  print '<input type="hidden" name="token" value="'.newToken().'">';
453  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
454  print '<input type="hidden" name="action" value="'.($action == 'edit' ? 'update' : 'list').'">';
455  print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
456  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
457  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
458  if ($id > 0) {
459  print '<input type="hidden" name="id" value="'.$id.'">';
460  }
461 
462  if ($id > 0) { // For user tab
463  $title = $langs->trans("User");
464  $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
465  $head = user_prepare_head($fuser);
466 
467  print dol_get_fiche_head($head, 'expensereport', $title, -1, 'user');
468 
469  dol_banner_tab($fuser, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
470 
471  print dol_get_fiche_end();
472 
473  if ($action != 'edit') {
474  print '<div class="tabsAction">';
475 
476  $childids = $user->getAllChildIds(1);
477 
478  $canedit = ((in_array($user_id, $childids) && $user->rights->expensereport->creer)
479  || ($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->expensereport->writeall_advance));
480 
481  // Buttons for actions
482  if ($canedit) {
483  print '<a href="'.DOL_URL_ROOT.'/expensereport/card.php?action=create&fk_user_author='.$fuser->id.'" class="butAction">'.$langs->trans("AddTrip").'</a>';
484  } else {
485  print '<a href="#" class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddTrip").'</a>';
486  }
487 
488  print '</div>';
489  } else {
490  print $form->buttonsSaveCancel("Save", '');
491  }
492  } else {
493  $title = $langs->trans("ListTripsAndExpenses");
494 
495  $url = DOL_URL_ROOT.'/expensereport/card.php?action=create';
496  if (!empty($socid)) {
497  $url .= '&socid='.$socid;
498  }
499  $newcardbutton = dolGetButtonTitle($langs->trans('NewTrip'), '', 'fa fa-plus-circle', $url, '', $user->rights->expensereport->creer);
500 
501  print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'trip', 0, $newcardbutton, '', $limit, 0, 0, 1);
502  }
503 
504  $topicmail = "SendExpenseReport";
505  $modelmail = "expensereport";
506  $objecttmp = new ExpenseReport($db);
507  $trackid = 'exp'.$object->id;
508  include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
509 
510  if ($sall) {
511  foreach ($fieldstosearchall as $key => $val) {
512  $fieldstosearchall[$key] = $langs->trans($val);
513  }
514  print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'</div>';
515  }
516 
517  $moreforfilter = '';
518 
519  $parameters = array();
520  $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
521  if (empty($reshook)) {
522  $moreforfilter .= $hookmanager->resPrint;
523  } else {
524  $moreforfilter = $hookmanager->resPrint;
525  }
526 
527  if (!empty($moreforfilter)) {
528  print '<div class="liste_titre liste_titre_bydiv centpercent">';
529  print $moreforfilter;
530  print '</div>';
531  }
532 
533  $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
534  $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
535  $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
536 
537  print '<div class="div-table-responsive">';
538  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
539 
540  // Filters
541  print '<tr class="liste_titre_filter">';
542  if (!empty($arrayfields['d.ref']['checked'])) {
543  print '<td class="liste_titre" align="left">';
544  print '<input class="flat" size="15" type="text" name="search_ref" value="'.$search_ref.'">';
545  print '</td>';
546  }
547  // User
548  if (!empty($arrayfields['user']['checked'])) {
549  if ($user->rights->expensereport->readall || $user->rights->expensereport->lire_tous) {
550  print '<td class="liste_titre maxwidthonspartphone" align="left">';
551  print $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
552  print '</td>';
553  } else {
554  print '<td class="liste_titre">&nbsp;</td>';
555  }
556  }
557  // Date start
558  if (!empty($arrayfields['d.date_debut']['checked'])) {
559  print '<td class="liste_titre" align="center">';
560  print '<div class="nowrap">';
561  print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
562  print '</div>';
563  print '<div class="nowrap">';
564  print $form->selectDate($search_date_startend ? $search_date_startend : -1, 'search_date_startend', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
565  print '</div>';
566  print '</td>';
567  }
568  // Date end
569  if (!empty($arrayfields['d.date_fin']['checked'])) {
570  print '<td class="liste_titre" align="center">';
571  print '<div class="nowrap">';
572  print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
573  print '</div>';
574  print '<div class="nowrap">';
575  print $form->selectDate($search_date_endend ? $search_date_endend : -1, 'search_date_endend', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
576  print '</div>';
577  print '</td>';
578  }
579  // Date valid
580  if (!empty($arrayfields['d.date_valid']['checked'])) {
581  print '<td class="liste_titre" align="center">';
582  //print '<input class="flat" type="text" size="1" maxlength="2" name="month_end" value="'.$month_end.'">';
583  //print $formother->selectyear($year_end,'year_end',1, $min_year, $max_year);
584  print '</td>';
585  }
586  // Date approve
587  if (!empty($arrayfields['d.date_approve']['checked'])) {
588  print '<td class="liste_titre" align="center">';
589  //print '<input class="flat" type="text" size="1" maxlength="2" name="month_end" value="'.$month_end.'">';
590  //print $formother->selectyear($year_end,'year_end',1, $min_year, $max_year);
591  print '</td>';
592  }
593  // Amount with no tax
594  if (!empty($arrayfields['d.total_ht']['checked'])) {
595  print '<td class="liste_titre right"><input class="flat" type="text" size="5" name="search_amount_ht" value="'.$search_amount_ht.'"></td>';
596  }
597  if (!empty($arrayfields['d.total_vat']['checked'])) {
598  print '<td class="liste_titre right"><input class="flat" type="text" size="5" name="search_amount_vat" value="'.$search_amount_vat.'"></td>';
599  }
600  // Amount with all taxes
601  if (!empty($arrayfields['d.total_ttc']['checked'])) {
602  print '<td class="liste_titre right"><input class="flat" type="text" size="5" name="search_amount_ttc" value="'.$search_amount_ttc.'"></td>';
603  }
604  // Extra fields
605  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
606 
607  // Fields from hook
608  $parameters = array('arrayfields'=>$arrayfields);
609  $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
610  print $hookmanager->resPrint;
611  // Date creation
612  if (!empty($arrayfields['d.date_create']['checked'])) {
613  print '<td class="liste_titre">';
614  print '</td>';
615  }
616  // Date modification
617  if (!empty($arrayfields['d.tms']['checked'])) {
618  print '<td class="liste_titre">';
619  print '</td>';
620  }
621  // Status
622  if (!empty($arrayfields['d.fk_statut']['checked'])) {
623  print '<td class="liste_titre right">';
624  $formexpensereport->selectExpensereportStatus($search_status, 'search_status', 1, 1);
625  print '</td>';
626  }
627  // Action column
628  print '<td class="liste_titre maxwidthsearch">';
629  $searchpicto = $form->showFilterButtons();
630  print $searchpicto;
631  print '</td>';
632 
633  print "</tr>\n";
634 
635  print '<tr class="liste_titre">';
636  if (!empty($arrayfields['d.ref']['checked'])) {
637  print_liste_field_titre($arrayfields['d.ref']['label'], $_SERVER["PHP_SELF"], "d.ref", "", $param, '', $sortfield, $sortorder);
638  }
639  if (!empty($arrayfields['user']['checked'])) {
640  print_liste_field_titre($arrayfields['user']['label'], $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder);
641  }
642  if (!empty($arrayfields['d.date_debut']['checked'])) {
643  print_liste_field_titre($arrayfields['d.date_debut']['label'], $_SERVER["PHP_SELF"], "d.date_debut", "", $param, 'align="center"', $sortfield, $sortorder);
644  }
645  if (!empty($arrayfields['d.date_fin']['checked'])) {
646  print_liste_field_titre($arrayfields['d.date_fin']['label'], $_SERVER["PHP_SELF"], "d.date_fin", "", $param, 'align="center"', $sortfield, $sortorder);
647  }
648  if (!empty($arrayfields['d.date_valid']['checked'])) {
649  print_liste_field_titre($arrayfields['d.date_valid']['label'], $_SERVER["PHP_SELF"], "d.date_valid", "", $param, 'align="center"', $sortfield, $sortorder);
650  }
651  if (!empty($arrayfields['d.date_approve']['checked'])) {
652  print_liste_field_titre($arrayfields['d.date_approve']['label'], $_SERVER["PHP_SELF"], "d.date_approve", "", $param, 'align="center"', $sortfield, $sortorder);
653  }
654  if (!empty($arrayfields['d.total_ht']['checked'])) {
655  print_liste_field_titre($arrayfields['d.total_ht']['label'], $_SERVER["PHP_SELF"], "d.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
656  }
657  if (!empty($arrayfields['d.total_vat']['checked'])) {
658  print_liste_field_titre($arrayfields['d.total_vat']['label'], $_SERVER["PHP_SELF"], "d.total_tva", "", $param, 'align="right"', $sortfield, $sortorder);
659  }
660  if (!empty($arrayfields['d.total_ttc']['checked'])) {
661  print_liste_field_titre($arrayfields['d.total_ttc']['label'], $_SERVER["PHP_SELF"], "d.total_ttc", "", $param, 'align="right"', $sortfield, $sortorder);
662  }
663  // Extra fields
664  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
665  // Hook fields
666  $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
667  $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
668  print $hookmanager->resPrint;
669  if (!empty($arrayfields['d.date_create']['checked'])) {
670  print_liste_field_titre($arrayfields['d.date_create']['label'], $_SERVER["PHP_SELF"], "d.date_create", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
671  }
672  if (!empty($arrayfields['d.tms']['checked'])) {
673  print_liste_field_titre($arrayfields['d.tms']['label'], $_SERVER["PHP_SELF"], "d.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
674  }
675  if (!empty($arrayfields['d.fk_statut']['checked'])) {
676  print_liste_field_titre($arrayfields['d.fk_statut']['label'], $_SERVER["PHP_SELF"], "d.fk_statut", "", $param, 'align="right"', $sortfield, $sortorder);
677  }
678  print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
679  print "</tr>\n";
680 
681  $total_total_ht = 0;
682  $total_total_ttc = 0;
683  $total_total_tva = 0;
684 
685  $expensereportstatic = new ExpenseReport($db);
686  $usertmp = new User($db);
687 
688  if ($num > 0) {
689  $i = 0;
690  $totalarray = array();
691  $totalarray['nbfield'] = 0;
692  $totalarray['val'] = array();
693  $totalarray['val']['d.total_ht'] = 0;
694  $totalarray['val']['d.total_tva'] = 0;
695  $totalarray['val']['d.total_ttc'] = 0;
696  $totalarray['totalizable'] = array();
697  while ($i < min($num, $limit)) {
698  $obj = $db->fetch_object($resql);
699 
700  $expensereportstatic->id = $obj->rowid;
701  $expensereportstatic->ref = $obj->ref;
702  $expensereportstatic->status = $obj->status;
703  $expensereportstatic->date_debut = $db->jdate($obj->date_debut);
704  $expensereportstatic->date_fin = $db->jdate($obj->date_fin);
705  $expensereportstatic->date_create = $db->jdate($obj->date_create);
706  $expensereportstatic->date_modif = $db->jdate($obj->date_modif);
707  $expensereportstatic->date_valid = $db->jdate($obj->date_valid);
708  $expensereportstatic->date_approve = $db->jdate($obj->date_approve);
709  $expensereportstatic->note_private = $obj->note_private;
710  $expensereportstatic->note_public = $obj->note_public;
711 
712 
713  print '<tr class="oddeven">';
714  // Ref
715  if (!empty($arrayfields['d.ref']['checked'])) {
716  print '<td>';
717  print '<table class="nobordernopadding"><tr class="nocellnopadd">';
718  print '<td class="nobordernopadding nowrap">';
719  print $expensereportstatic->getNomUrl(1);
720  print '</td>';
721  // Warning late icon and note
722  print '<td class="nobordernopadding nowrap">';
723  if ($expensereportstatic->status == 2 && $expensereportstatic->hasDelay('toappove')) {
724  print img_warning($langs->trans("Late"));
725  }
726  if ($expensereportstatic->status == 5 && $expensereportstatic->hasDelay('topay')) {
727  print img_warning($langs->trans("Late"));
728  }
729  if (!empty($obj->note_private) || !empty($obj->note_public)) {
730  print ' <span class="note">';
731  print '<a href="'.DOL_URL_ROOT.'/expensereport/note.php?id='.$obj->rowid.'">'.img_picto($langs->trans("ViewPrivateNote"), 'object_generic').'</a>';
732  print '</span>';
733  }
734  print '</td>';
735  print '<td width="16" class="nobordernopadding hideonsmartphone right">';
736  $filename = dol_sanitizeFileName($obj->ref);
737  $filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($obj->ref);
738  $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
739  print $formfile->getDocumentsLink($expensereportstatic->element, $filename, $filedir);
740  print '</td>';
741  print '</tr></table>';
742  print '</td>';
743  if (!$i) {
744  $totalarray['nbfield']++;
745  }
746  }
747  // User
748  if (!empty($arrayfields['user']['checked'])) {
749  print '<td class="left">';
750  $usertmp->id = $obj->id_user;
751  $usertmp->lastname = $obj->lastname;
752  $usertmp->firstname = $obj->firstname;
753  $usertmp->login = $obj->login;
754  $usertmp->statut = $obj->statut;
755  $usertmp->photo = $obj->photo;
756  $usertmp->email = $obj->email;
757  print $usertmp->getNomUrl(-1);
758  print '</td>';
759  if (!$i) {
760  $totalarray['nbfield']++;
761  }
762  }
763  // Start date
764  if (!empty($arrayfields['d.date_debut']['checked'])) {
765  print '<td class="center">'.($obj->date_debut > 0 ? dol_print_date($db->jdate($obj->date_debut), 'day') : '').'</td>';
766  if (!$i) {
767  $totalarray['nbfield']++;
768  }
769  }
770  // End date
771  if (!empty($arrayfields['d.date_fin']['checked'])) {
772  print '<td class="center">'.($obj->date_fin > 0 ? dol_print_date($db->jdate($obj->date_fin), 'day') : '').'</td>';
773  if (!$i) {
774  $totalarray['nbfield']++;
775  }
776  }
777  // Date validation
778  if (!empty($arrayfields['d.date_valid']['checked'])) {
779  print '<td class="center">'.($obj->date_valid > 0 ? dol_print_date($db->jdate($obj->date_valid), 'day') : '').'</td>';
780  if (!$i) {
781  $totalarray['nbfield']++;
782  }
783  }
784  // Date approval
785  if (!empty($arrayfields['d.date_approve']['checked'])) {
786  print '<td class="center">'.($obj->date_approve > 0 ? dol_print_date($db->jdate($obj->date_approve), 'day') : '').'</td>';
787  if (!$i) {
788  $totalarray['nbfield']++;
789  }
790  }
791  // Amount HT
792  if (!empty($arrayfields['d.total_ht']['checked'])) {
793  print '<td class="right">'.price($obj->total_ht)."</td>\n";
794  if (!$i) {
795  $totalarray['nbfield']++;
796  }
797  if (!$i) {
798  $totalarray['pos'][$totalarray['nbfield']] = 'd.total_ht';
799  }
800  $totalarray['val']['d.total_ht'] += $obj->total_ht;
801  }
802  // Amount VAT
803  if (!empty($arrayfields['d.total_vat']['checked'])) {
804  print '<td class="right">'.price($obj->total_tva)."</td>\n";
805  if (!$i) {
806  $totalarray['nbfield']++;
807  }
808  if (!$i) {
809  $totalarray['pos'][$totalarray['nbfield']] = 'd.total_tva';
810  }
811  $totalarray['val']['d.total_tva'] += $obj->total_tva;
812  }
813  // Amount TTC
814  if (!empty($arrayfields['d.total_ttc']['checked'])) {
815  print '<td class="right">'.price($obj->total_ttc)."</td>\n";
816  if (!$i) {
817  $totalarray['nbfield']++;
818  }
819  if (!$i) {
820  $totalarray['pos'][$totalarray['nbfield']] = 'd.total_ttc';
821  }
822  $totalarray['val']['d.total_ttc'] += $obj->total_ttc;
823  }
824 
825  // Extra fields
826  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
827  // Fields from hook
828  $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
829  $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
830  print $hookmanager->resPrint;
831 
832  // Date creation
833  if (!empty($arrayfields['d.date_create']['checked'])) {
834  print '<td class="nowrap center">';
835  print dol_print_date($db->jdate($obj->date_create), 'dayhour');
836  print '</td>';
837  if (!$i) {
838  $totalarray['nbfield']++;
839  }
840  }
841  // Date modification
842  if (!empty($arrayfields['d.tms']['checked'])) {
843  print '<td class="nowrap center">';
844  print dol_print_date($db->jdate($obj->date_modif), 'dayhour');
845  print '</td>';
846  if (!$i) {
847  $totalarray['nbfield']++;
848  }
849  }
850  // Status
851  if (!empty($arrayfields['d.fk_statut']['checked'])) {
852  print '<td class="nowrap right">'.$expensereportstatic->getLibStatut(5).'</td>';
853  if (!$i) {
854  $totalarray['nbfield']++;
855  }
856  }
857  // Action column
858  print '<td class="nowrap center">';
859  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
860  $selected = 0;
861  if (in_array($obj->rowid, $arrayofselected)) {
862  $selected = 1;
863  }
864  print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
865  }
866  print '</td>';
867  if (!$i) {
868  $totalarray['nbfield']++;
869  }
870 
871  print "</tr>\n";
872 
873  $total_total_ht = $total_total_ht + $obj->total_ht;
874  $total_total_tva = $total_total_tva + $obj->total_tva;
875  $total_total_ttc = $total_total_ttc + $obj->total_ttc;
876 
877  $i++;
878  }
879  } else {
880  $colspan = 1;
881  foreach ($arrayfields as $key => $val) {
882  if (!empty($val['checked'])) {
883  $colspan++;
884  }
885  }
886  print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
887  }
888 
889  // Show total line
890  include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
891 
892  $db->free($resql);
893 
894  $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
895  $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
896  print $hookmanager->resPrint;
897 
898  print '</table>'."\n";
899  print '</div>';
900 
901  print '</form>'."\n";
902 
903  if (empty($id)) {
904  $hidegeneratedfilelistifempty = 1;
905  if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
906  $hidegeneratedfilelistifempty = 0;
907  }
908 
909  // Show list of available documents
910  $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
911  $urlsource .= str_replace('&amp;', '&', $param);
912 
913  $filedir = $diroutputmassaction;
914  $genallowed = $user->rights->expensereport->lire;
915  $delallowed = $user->rights->expensereport->creer;
916 
917  print $formfile->showdocuments('massfilesarea_expensereport', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
918  }
919 } else {
920  dol_print_error($db);
921 }
922 
923 // End of page
924 llxFooter();
925 $db->close();
dol_sanitizeFileName
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
Definition: functions.lib.php:1226
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
user_prepare_head
user_prepare_head(User $object)
Prepare array with list of tabs.
Definition: usergroups.lib.php:35
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
img_warning
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
Definition: functions.lib.php:4521
$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
dol_banner_tab
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
Definition: functions.lib.php:2046
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
FormExpenseReport
Class to manage generation of HTML components for contract module.
Definition: html.formexpensereport.class.php:28
FormFile
Class to offer components to list and upload files.
Definition: html.formfile.class.php:36
dolGetButtonTitle
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
Definition: functions.lib.php:10605
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
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2018
User
Class to manage Dolibarr users.
Definition: user.class.php:44
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:386
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
natural_search
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
Definition: functions.lib.php:9420
ExtraFields
Class to manage standard extra fields.
Definition: extrafields.class.php:39
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
ExpenseReport
Class to manage Trips and Expenses.
Definition: expensereport.class.php:36
$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
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
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