dolibarr  16.0.5
month_report.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2011 François Legastelois <flegastelois@teclib.com>
4  * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
5  * Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
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.'/holiday/class/holiday.class.php';
29 require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
33 
34 // Load translation files required by the page
35 $langs->loadLangs(array('holiday', 'hrm'));
36 
37 // Security check
38 $socid = 0;
39 $id = GETPOST('id', 'int');
40 
41 if ($user->socid > 0) { // Protection if external user
42  //$socid = $user->socid;
44 }
45 $result = restrictedArea($user, 'holiday', $id, '');
46 
47 $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view';
48 $massaction = GETPOST('massaction', 'alpha');
49 $contextpage = GETPOST('contextpage', 'aZ');
50 $optioncss = GETPOST('optioncss', 'aZ');
51 
52 $search_ref = GETPOST('search_ref', 'alphanohtml');
53 $search_employee = GETPOST('search_employee', 'int');
54 $search_type = GETPOST('search_type', 'int');
55 $search_description = GETPOST('search_description', 'alphanohtml');
56 
57 $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
58 $sortfield = GETPOST('sortfield', 'aZ09comma');
59 $sortorder = GETPOST('sortorder', 'aZ09comma');
60 
61 if (!$sortfield) {
62  $sortfield = "cp.rowid";
63 }
64 if (!$sortorder) {
65  $sortorder = "ASC";
66 }
67 
68 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
69 if (empty($page) || $page == -1) {
70  $page = 0;
71 }
72 
73 $hookmanager->initHooks(array('leavemovementlist'));
74 
75 $arrayfields = array();
76 $arrayofmassactions = array();
77 
78 /*
79  * Actions
80  */
81 
82 if (GETPOST('cancel', 'alpha')) {
83  $action = 'list'; $massaction = '';
84 }
85 if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
86  $massaction = '';
87 }
88 
89 $parameters = array();
90 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
91 if ($reshook < 0) {
92  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
93 }
94 
95 if (empty($reshook)) {
96  // Selection of new fields
97  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
98 
99  // Purge search criteria
100  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
101  $search_ref = '';
102  $search_employee = '';
103  $search_type = '';
104  $search_description = '';
105  $toselect = array();
106  $search_array_options = array();
107  }
108 
109  if (GETPOST('button_removefilter_x', 'alpha')
110  || GETPOST('button_removefilter.x', 'alpha')
111  || GETPOST('button_removefilter', 'alpha')
112  || GETPOST('button_search_x', 'alpha')
113  || GETPOST('button_search.x', 'alpha')
114  || GETPOST('button_search', 'alpha')) {
115  $massaction = '';
116  }
117 }
118 
119 $arrayfields = array(
120  'cp.ref'=>array('label'=>$langs->trans('Ref'), 'checked'=>1),
121  'cp.fk_user'=>array('label'=>$langs->trans('Employee'), 'checked'=>1),
122  'cp.fk_type'=>array('label'=>$langs->trans('Type'), 'checked'=>1),
123  'cp.date_debut'=>array('label'=>$langs->trans('DateDebCP'), 'checked'=>1),
124  'cp.date_fin'=>array('label'=>$langs->trans('DateFinCP'), 'checked'=>1),
125  'used_days'=>array('label'=>$langs->trans('NbUseDaysCPShort'), 'checked'=>1),
126  'date_start_month'=>array('label'=>$langs->trans('DateStartInMonth'), 'checked'=>1),
127  'date_end_month'=>array('label'=>$langs->trans('DateEndInMonth'), 'checked'=>1),
128  'used_days_month'=>array('label'=>$langs->trans('NbUseDaysCPShortInMonth'), 'checked'=>1),
129  'cp.description'=>array('label'=>$langs->trans('DescCP'), 'checked'=>1),
130 );
131 
132 
133 /*
134  * View
135  */
136 
137 $form = new Form($db);
138 $formother = new FormOther($db);
139 $holidaystatic = new Holiday($db);
140 
141 $listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon"));
142 
143 $title = $langs->trans('CPTitreMenu');
144 
145 llxHeader('', $title);
146 
147 $search_month = GETPOST("remonth", 'int') ?GETPOST("remonth", 'int') : date("m", time());
148 $search_year = GETPOST("reyear", 'int') ?GETPOST("reyear", 'int') : date("Y", time());
149 $year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month);
150 
151 $sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, cp.fk_type, cp.description, cp.halfday";
152 $sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
153 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
154 $sql .= " WHERE cp.rowid > 0";
155 $sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED;
156 $sql .= " AND (";
157 $sql .= " (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";
158 $sql .= " OR"; // For leave over several months
159 $sql .= " (date_format(cp.date_debut, '%Y-%m') < '".$db->escape($year_month)."' AND date_format(cp.date_fin, '%Y-%m') > '".$db->escape($year_month)."') ";
160 $sql .= " )";
161 if (!empty($search_ref)) {
162  $sql .= natural_search('cp.ref', $search_ref);
163 }
164 if (!empty($search_employee) && $search_employee > 0) {
165  $sql .= " AND cp.fk_user = ".((int) $search_employee);
166 }
167 if (!empty($search_type) && $search_type != '-1') {
168  $sql .= ' AND cp.fk_type IN ('.$db->sanitize($search_type).')';
169 }
170 if (!empty($search_description)) {
171  $sql .= natural_search('cp.description', $search_description);
172 }
173 
174 $sql .= $db->order($sortfield, $sortorder);
175 
176 $resql = $db->query($sql);
177 if (empty($resql)) {
178  dol_print_error($db);
179  exit;
180 }
181 
182 $num = $db->num_rows($resql);
183 
184 $param = '';
185 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
186  $param .= '&contextpage='.urlencode($contextpage);
187 }
188 if ($limit > 0 && $limit != $conf->liste_limit) {
189  $param .= '&limit='.urlencode($limit);
190 }
191 if (!empty($search_ref)) {
192  $param .= '&search_ref='.urlencode($search_ref);
193 }
194 if (!empty($search_employee)) {
195  $param .= '&search_employee='.urlencode($search_employee);
196 }
197 if (!empty($search_type)) {
198  $param .= '&search_type='.urlencode($search_type);
199 }
200 if (!empty($search_description)) {
201  $param .= '&search_description='.urlencode($search_description);
202 }
203 
204 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
205 if ($optioncss != '') {
206  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
207 }
208 print '<input type="hidden" name="token" value="'.newToken().'">';
209 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
210 print '<input type="hidden" name="action" value="list">';
211 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
212 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
213 print '<input type="hidden" name="page" value="'.$page.'">';
214 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
215 
216 print load_fiche_titre($langs->trans('MenuReportMonth'), '', 'title_hrm');
217 
218 // Selection filter
219 print '<div class="tabBar">';
220 print $formother->select_month($search_month, 'remonth', 0, 0, 'minwidth50 maxwidth75imp valignmiddle', true);
221 print $formother->selectyear($search_year, 'reyear', 0, 10, 5, 0, 0, '', 'valignmiddle width75', true);
222 print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Search")).'" />';
223 print '</div>';
224 print '<br>';
225 
226 $moreforfilter = '';
227 
228 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
229 $selectedfields = '';
230 $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
231 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
232 
233 print '<div class="div-table-responsive">';
234 print '<table class="noborder centpercent">';
235 
236 print '<tr class="liste_titre">';
237 
238 // Filter: Ref
239 if (!empty($arrayfields['cp.ref']['checked'])) {
240  print '<td class="liste_titre">';
241  print '<input class="flat maxwidth100" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
242  print '</td>';
243 }
244 
245 // Filter: Employee
246 if (!empty($arrayfields['cp.fk_user']['checked'])) {
247  print '<td class="liste_titre">';
248  print $form->select_dolusers($search_employee, "search_employee", 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
249  print '</td>';
250 }
251 
252 // Filter: Type
253 if (!empty($arrayfields['cp.fk_type']['checked'])) {
254  $typeleaves = $holidaystatic->getTypes(1, -1);
255  $arraytypeleaves = array();
256  foreach ($typeleaves as $key => $val) {
257  $labeltoshow = ($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']);
258  $arraytypeleaves[$val['rowid']] = $labeltoshow;
259  }
260 
261  print '<td class="liste_titre">';
262  print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1, 0, 0, '', 0, 0, 0, '', '', 1);
263  print '</td>';
264 }
265 
266 if (!empty($arrayfields['cp.date_debut']['checked'])) {
267  print '<td class="liste_titre"></td>';
268 }
269 if (!empty($arrayfields['cp.date_fin']['checked'])) {
270  print '<td class="liste_titre"></td>';
271 }
272 if (!empty($arrayfields['used_days']['checked'])) {
273  print '<td class="liste_titre"></td>';
274 }
275 if (!empty($arrayfields['date_start_month']['checked'])) {
276  print '<td class="liste_titre"></td>';
277 }
278 if (!empty($arrayfields['date_end_month']['checked'])) {
279  print '<td class="liste_titre"></td>';
280 }
281 if (!empty($arrayfields['used_days_month']['checked'])) {
282  print '<td class="liste_titre"></td>';
283 }
284 
285 // Filter: Description
286 if (!empty($arrayfields['cp.description']['checked'])) {
287  print '<td class="liste_titre">';
288  print '<input type="text" class="maxwidth100" name="search_description" value="'.$search_description.'">';
289  print '</td>';
290 }
291 
292 // Action column
293 print '<td class="liste_titre maxwidthsearch">';
294 $searchpicto = $form->showFilterButtons();
295 print $searchpicto;
296 print '</td>';
297 print '</tr>';
298 
299 print '<tr class="liste_titre">';
300 if (!empty($arrayfields['cp.ref']['checked'])) {
301  print_liste_field_titre($arrayfields['cp.ref']['label'], $_SERVER["PHP_SELF"], 'cp.ref', '', '', '', $sortfield, $sortorder);
302 }
303 if (!empty($arrayfields['cp.fk_user']['checked'])) {
304  print_liste_field_titre($arrayfields['cp.fk_user']['label'], $_SERVER["PHP_SELF"], 'cp.fk_user', '', '', '', $sortfield, $sortorder);
305 }
306 if (!empty($arrayfields['cp.fk_type']['checked'])) {
307  print_liste_field_titre($arrayfields['cp.fk_type']['label'], $_SERVER["PHP_SELF"], 'cp.fk_type', '', '', '', $sortfield, $sortorder);
308 }
309 if (!empty($arrayfields['ct.label']['checked'])) {
310  print_liste_field_titre($arrayfields['ct.label']['label'], $_SERVER["PHP_SELF"], 'ct.label', '', '', '', $sortfield, $sortorder);
311 }
312 if (!empty($arrayfields['cp.date_debut']['checked'])) {
313  print_liste_field_titre($arrayfields['cp.date_debut']['label'], $_SERVER["PHP_SELF"], 'cp.date_debut', '', '', '', $sortfield, $sortorder);
314 }
315 if (!empty($arrayfields['cp.date_fin']['checked'])) {
316  print_liste_field_titre($arrayfields['cp.date_fin']['label'], $_SERVER["PHP_SELF"], 'cp.date_fin', '', '', '', $sortfield, $sortorder);
317 }
318 if (!empty($arrayfields['used_days']['checked'])) {
319  print_liste_field_titre($arrayfields['used_days']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder);
320 }
321 if (!empty($arrayfields['date_start_month']['checked'])) {
322  print_liste_field_titre($arrayfields['date_start_month']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder);
323 }
324 if (!empty($arrayfields['date_end_month']['checked'])) {
325  print_liste_field_titre($arrayfields['date_end_month']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder);
326 }
327 if (!empty($arrayfields['used_days_month']['checked'])) {
328  print_liste_field_titre($arrayfields['used_days_month']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder);
329 }
330 if (!empty($arrayfields['cp.description']['checked'])) {
331  print_liste_field_titre($arrayfields['cp.description']['label'], $_SERVER["PHP_SELF"], 'cp.description', '', '', '', $sortfield, $sortorder);
332 }
333 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
334 print '</tr>';
335 
336 if ($num == 0) {
337  print '<tr><td colspan="10" class="opacitymedium">'.$langs->trans('None').'</td></tr>';
338 } else {
339  while ($obj = $db->fetch_object($resql)) {
340  $user = new User($db);
341  $user->fetch($obj->fk_user);
342 
343  $date_start = $db->jdate($obj->date_debut, true);
344  $date_end = $db->jdate($obj->date_fin, true);
345 
346  $tmpstart = dol_getdate($date_start);
347  $tmpend = dol_getdate($date_end);
348 
349  $starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning';
350  $endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon';
351 
352  $halfdayinmonth = $obj->halfday;
353  $starthalfdayinmonth = $starthalfday;
354  $endhalfdayinmonth = $endhalfday;
355 
356  //0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning
357 
358  // Set date_start_gmt and date_end_gmt that are date to show for the selected month
359  $date_start_inmonth = $db->jdate($obj->date_debut, true);
360  $date_end_inmonth = $db->jdate($obj->date_fin, true);
361  if ($tmpstart['year'] < $search_year || $tmpstart['mon'] < $search_month) {
362  $date_start_inmonth = dol_get_first_day($search_year, $search_month, true);
363  $starthalfdayinmonth = 'morning';
364  if ($halfdayinmonth == 2) {
365  $halfdayinmonth = 1;
366  }
367  if ($halfdayinmonth == -1) {
368  $halfdayinmonth = 0;
369  }
370  }
371  if ($tmpend['year'] > $search_year || $tmpend['mon'] > $search_month) {
372  $date_end_inmonth = dol_get_last_day($search_year, $search_month, true) - ((24 * 3600) - 1);
373  $endhalfdayinmonth = 'afternoon';
374  if ($halfdayinmonth == 2) {
375  $halfdayinmonth = -1;
376  }
377  if ($halfdayinmonth == 1) {
378  $halfdayinmonth = 0;
379  }
380  }
381 
382  // Leave request
383  $holidaystatic->id = $obj->rowid;
384  $holidaystatic->ref = $obj->ref;
385 
386  print '<tr class="oddeven">';
387 
388  if (!empty($arrayfields['cp.ref']['checked'])) {
389  print '<td>'.$holidaystatic->getNomUrl(1, 1).'</td>';
390  }
391  if (!empty($arrayfields['cp.fk_user']['checked'])) {
392  print '<td>'.$user->getFullName($langs).'</td>';
393  }
394  if (!empty($arrayfields['cp.fk_type']['checked'])) {
395  print '<td>'.$arraytypeleaves[$obj->fk_type].'</td>';
396  }
397 
398  if (!empty($arrayfields['cp.date_debut']['checked'])) {
399  print '<td class="center">'.dol_print_date($db->jdate($obj->date_debut), 'day');
400  print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfday]).')</span>';
401  print '</td>';
402  }
403 
404  if (!empty($arrayfields['cp.date_fin']['checked'])) {
405  print '<td class="center">'.dol_print_date($db->jdate($obj->date_fin), 'day');
406  print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfday]).')</span>';
407  print '</td>';
408  }
409 
410  if (!empty($arrayfields['used_days']['checked'])) {
411  print '<td class="right">'.num_open_day($date_start, $date_end, 0, 1, $obj->halfday).'</td>';
412  }
413 
414  if (!empty($arrayfields['date_start_month']['checked'])) {
415  print '<td class="center">'.dol_print_date($date_start_inmonth, 'day');
416  print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfdayinmonth]).')</span>';
417  print '</td>';
418  }
419 
420  if (!empty($arrayfields['date_end_month']['checked'])) {
421  print '<td class="center">'.dol_print_date($date_end_inmonth, 'day');
422  print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfdayinmonth]).')</span>';
423  print '</td>';
424  }
425 
426  if (!empty($arrayfields['used_days_month']['checked'])) {
427  print '<td class="right">'.num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth).'</td>';
428  }
429  if (!empty($arrayfields['cp.description']['checked'])) {
430  print '<td class="maxwidth300 small">'.dolGetFirstLineOfText(dol_string_nohtmltag($obj->description, 1)).'</td>';
431  }
432 
433  print '<td></td>';
434  print '</tr>';
435  }
436 }
437 print '</table>';
438 print '</div>';
439 print '</form>';
440 
441 // End of page
442 llxFooter();
443 $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
getTitleFieldOfList
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
Definition: functions.lib.php:5049
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_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4844
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
FormOther
Classe permettant la generation de composants html autre Only common components are here.
Definition: html.formother.class.php:39
Holiday
Class of the module paid holiday.
Definition: holiday.class.php:34
dol_string_nohtmltag
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
Definition: functions.lib.php:6694
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
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
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
$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
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