dolibarr  19.0.0-dev
lines.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
3  * Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
4  * Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
5  * Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
6  * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
27 require '../../main.inc.php';
28 
29 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
36 
37 // Load translation files required by the page
38 $langs->loadLangs(array("compta", "bills", "other", "accountancy", "trips", "productbatch", "hrm"));
39 
40 $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
41 
42 $account_parent = GETPOST('account_parent', 'int');
43 $changeaccount = GETPOST('changeaccount');
44 // Search Getpost
45 $search_login = GETPOST('search_login', 'alpha');
46 $search_expensereport = GETPOST('search_expensereport', 'alpha');
47 $search_label = GETPOST('search_label', 'alpha');
48 $search_desc = GETPOST('search_desc', 'alpha');
49 $search_amount = GETPOST('search_amount', 'alpha');
50 $search_account = GETPOST('search_account', 'alpha');
51 $search_vat = GETPOST('search_vat', 'alpha');
52 $search_date_startday = GETPOST('search_date_startday', 'int');
53 $search_date_startmonth = GETPOST('search_date_startmonth', 'int');
54 $search_date_startyear = GETPOST('search_date_startyear', 'int');
55 $search_date_endday = GETPOST('search_date_endday', 'int');
56 $search_date_endmonth = GETPOST('search_date_endmonth', 'int');
57 $search_date_endyear = GETPOST('search_date_endyear', 'int');
58 $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
59 $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
60 
61 // Load variable for pagination
62 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
63 $sortfield = GETPOST('sortfield', 'aZ09comma');
64 $sortorder = GETPOST('sortorder', 'aZ09comma');
65 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
66 if (empty($page) || $page < 0) {
67  $page = 0;
68 }
69 $offset = $limit * $page;
70 $pageprev = $page - 1;
71 $pagenext = $page + 1;
72 if (!$sortfield) {
73  $sortfield = "erd.date, erd.rowid";
74 }
75 if (!$sortorder) {
76  if ($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE > 0) {
77  $sortorder = "DESC";
78  } else {
79  $sortorder = "ASC";
80  }
81 }
82 
83 // Security check
84 if (!isModEnabled('accounting')) {
86 }
87 if ($user->socid > 0) {
89 }
90 if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
92 }
93 
94 
95 $formaccounting = new FormAccounting($db);
96 
97 
98 /*
99  * Actions
100  */
101 
102 // Purge search criteria
103 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
104  $search_login = '';
105  $search_expensereport = '';
106  $search_label = '';
107  $search_desc = '';
108  $search_amount = '';
109  $search_account = '';
110  $search_vat = '';
111  $search_date_startday = '';
112  $search_date_startmonth = '';
113  $search_date_startyear = '';
114  $search_date_endday = '';
115  $search_date_endmonth = '';
116  $search_date_endyear = '';
117  $search_date_start = '';
118  $search_date_end = '';
119 }
120 
121 if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('accounting', 'bind', 'write')) {
122  $error = 0;
123 
124  if (!(GETPOST('account_parent', 'int') >= 0)) {
125  $error++;
126  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
127  }
128 
129  if (!$error) {
130  $db->begin();
131 
132  $sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd";
133  $sql1 .= " SET erd.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
134  $sql1 .= ' WHERE erd.rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')';
135 
136  dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= '.$sql1);
137  $resql1 = $db->query($sql1);
138  if (!$resql1) {
139  $error++;
140  setEventMessages($db->lasterror(), null, 'errors');
141  }
142  if (!$error) {
143  $db->commit();
144  setEventMessages($langs->trans("Save"), null, 'mesgs');
145  } else {
146  $db->rollback();
147  setEventMessages($db->lasterror(), null, 'errors');
148  }
149 
150  $account_parent = ''; // Protection to avoid to mass apply it a second time
151  }
152 }
153 
154 if (GETPOST('sortfield') == 'erd.date, erd.rowid') {
155  $value = (GETPOST('sortorder') == 'asc,asc' ? 0 : 1);
156  require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
157  $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $value, 'yesno', 0, '', $conf->entity);
158 }
159 
160 
161 /*
162  * View
163  */
164 
165 $form = new Form($db);
166 $formother = new FormOther($db);
167 
168 llxHeader('', $langs->trans("ExpenseReportsVentilation").' - '.$langs->trans("Dispatched"));
169 
170 print '<script type="text/javascript">
171  $(function () {
172  $(\'#select-all\').click(function(event) {
173  // Iterate each checkbox
174  $(\':checkbox\').each(function() {
175  this.checked = true;
176  });
177  });
178  $(\'#unselect-all\').click(function(event) {
179  // Iterate each checkbox
180  $(\':checkbox\').each(function() {
181  this.checked = false;
182  });
183  });
184  });
185  </script>';
186 
187 /*
188  * Expense reports lines
189  */
190 $sql = "SELECT er.ref, er.rowid as erid,";
191 $sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht, erd.fk_code_ventilation, erd.tva_tx, erd.vat_src_code, erd.date,";
192 $sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label,";
193 $sql .= " u.rowid as userid, u.login, u.lastname, u.firstname, u.email, u.gender, u.employee, u.photo, u.statut,";
194 $sql .= " aa.label, aa.labelshort, aa.account_number";
195 $sql .= " FROM ".MAIN_DB_PREFIX."expensereport as er";
196 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport_det as erd ON er.rowid = erd.fk_expensereport";
197 $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
198 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_fees as f ON f.id = erd.fk_c_type_fees";
199 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = er.fk_user_author";
200 $sql .= " WHERE erd.fk_code_ventilation > 0";
201 $sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
202 $sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
203 // Add search filter like
204 if (strlen(trim($search_login))) {
205  $sql .= natural_search("u.login", $search_login);
206 }
207 if (strlen(trim($search_expensereport))) {
208  $sql .= natural_search("er.ref", $search_expensereport);
209 }
210 if (strlen(trim($search_label))) {
211  $sql .= natural_search("f.label", $search_label);
212 }
213 if (strlen(trim($search_desc))) {
214  $sql .= natural_search("er.comments", $search_desc);
215 }
216 if (strlen(trim($search_amount))) {
217  $sql .= natural_search("erd.total_ht", $search_amount, 1);
218 }
219 if (strlen(trim($search_account))) {
220  $sql .= natural_search("aa.account_number", $search_account);
221 }
222 if (strlen(trim($search_vat))) {
223  $sql .= natural_search("erd.tva_tx", price2num($search_vat), 1);
224 }
225 if ($search_date_start) {
226  $sql .= " AND erd.date >= '".$db->idate($search_date_start)."'";
227 }
228 if ($search_date_end) {
229  $sql .= " AND erd.date <= '".$db->idate($search_date_end)."'";
230 }
231 $sql .= " AND er.entity IN (".getEntity('expensereport', 0).")"; // We don't share object for accountancy
232 
233 $sql .= $db->order($sortfield, $sortorder);
234 
235 // Count total nb of records
236 $nbtotalofrecords = '';
237 if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
238  $result = $db->query($sql);
239  $nbtotalofrecords = $db->num_rows($result);
240  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
241  $page = 0;
242  $offset = 0;
243  }
244 }
245 
246 $sql .= $db->plimit($limit + 1, $offset);
247 
248 dol_syslog("accountancy/expensereport/lines.php", LOG_DEBUG);
249 $result = $db->query($sql);
250 if ($result) {
251  $num_lines = $db->num_rows($result);
252  $i = 0;
253 
254  $param = '';
255  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
256  $param .= '&contextpage='.urlencode($contextpage);
257  }
258  if ($limit > 0 && $limit != $conf->liste_limit) {
259  $param .= '&limit='.((int) $limit);
260  }
261  if ($search_login) {
262  $param .= '&search_login='.urlencode($search_login);
263  }
264  if ($search_expensereport) {
265  $param .= "&search_expensereport=".urlencode($search_expensereport);
266  }
267  if ($search_label) {
268  $param .= "&search_label=".urlencode($search_label);
269  }
270  if ($search_desc) {
271  $param .= "&search_desc=".urlencode($search_desc);
272  }
273  if ($search_account) {
274  $param .= "&search_account=".urlencode($search_account);
275  }
276  if ($search_vat) {
277  $param .= "&search_vat=".urlencode($search_vat);
278  }
279  if ($search_date_startday) {
280  $param .= '&search_date_startday='.urlencode($search_date_startday);
281  }
282  if ($search_date_startmonth) {
283  $param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
284  }
285  if ($search_date_startyear) {
286  $param .= '&search_date_startyear='.urlencode($search_date_startyear);
287  }
288  if ($search_date_endday) {
289  $param .= '&search_date_endday='.urlencode($search_date_endday);
290  }
291  if ($search_date_endmonth) {
292  $param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
293  }
294  if ($search_date_endyear) {
295  $param .= '&search_date_endyear='.urlencode($search_date_endyear);
296  }
297 
298  print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">'."\n";
299  print '<input type="hidden" name="action" value="ventil">';
300  if ($optioncss != '') {
301  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
302  }
303  print '<input type="hidden" name="token" value="'.newToken().'">';
304  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
305  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
306  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
307  print '<input type="hidden" name="page" value="'.$page.'">';
308 
309  print_barre_liste($langs->trans("ExpenseReportLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
310  print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneExpenseReport").'</span><br>';
311 
312  print '<br><div class="inline-block divButAction paddingbottom">'.$langs->trans("ChangeAccount").' ';
313  print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
314  print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
315 
316  $moreforfilter = '';
317 
318  print '<div class="div-table-responsive">';
319  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
320 
321  print '<tr class="liste_titre_filter">';
322  print '<td class="liste_titre"><input type="text" name="search_login" class="maxwidth50" value="'.$search_login.'"></td>';
323  print '<td class="liste_titre"></td>';
324  print '<td><input type="text" class="flat maxwidth50" name="search_expensereport" value="'.dol_escape_htmltag($search_expensereport).'"></td>';
325  if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
326  print '<td class="liste_titre"></td>';
327  }
328  print '<td class="liste_titre center">';
329  print '<div class="nowrap">';
330  print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
331  print '</div>';
332  print '<div class="nowrap">';
333  print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
334  print '</div>';
335  print '</td>';
336  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
337  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="'.dol_escape_htmltag($search_desc).'"></td>';
338  print '<td class="liste_titre right"><input type="text" class="flat maxwidth50" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
339  print '<td class="liste_titre center"><input type="text" class="flat maxwidth50" name="search_vat" size="1" placeholder="%" value="'.dol_escape_htmltag($search_vat).'"></td>';
340  print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="'.dol_escape_htmltag($search_account).'"></td>';
341  print '<td class="liste_titre center">';
342  $searchpicto = $form->showFilterButtons();
343  print $searchpicto;
344  print '</td>';
345  print "</tr>\n";
346 
347  print '<tr class="liste_titre">';
348  print_liste_field_titre("Employees", $_SERVER['PHP_SELF'], "u.login", $param, "", "", $sortfield, $sortorder);
349  print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
350  print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
351  if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
352  print_liste_field_titre("DateValidation", $_SERVER["PHP_SELF"], "er.date_valid", "", $param, '', $sortfield, $sortorder, 'center ');
353  }
354  print_liste_field_titre("DateOfLine", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
355  print_liste_field_titre("TypeFees", $_SERVER["PHP_SELF"], "f.label", "", $param, '', $sortfield, $sortorder);
356  print_liste_field_titre("Description", $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
357  print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, '', $sortfield, $sortorder, 'right ');
358  print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, '', $sortfield, $sortorder, 'center ');
359  print_liste_field_titre("AccountAccounting", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
360  $checkpicto = $form->showCheckAddButtons();
361  print_liste_field_titre($checkpicto, '', '', '', '', '', '', '', 'center ');
362  print "</tr>\n";
363 
364  $expensereportstatic = new ExpenseReport($db);
365  $accountingaccountstatic = new AccountingAccount($db);
366  $userstatic = new User($db);
367 
368  $i = 0;
369  while ($i < min($num_lines, $limit)) {
370  $objp = $db->fetch_object($result);
371 
372  $expensereportstatic->ref = $objp->ref;
373  $expensereportstatic->id = $objp->erid;
374 
375  $userstatic->id = $objp->userid;
376  $userstatic->ref = $objp->label;
377  $userstatic->login = $objp->login;
378  $userstatic->statut = $objp->statut;
379  $userstatic->email = $objp->email;
380  $userstatic->gender = $objp->gender;
381  $userstatic->firstname = $objp->firstname;
382  $userstatic->lastname = $objp->lastname;
383  $userstatic->employee = $objp->employee;
384  $userstatic->photo = $objp->photo;
385 
386  $accountingaccountstatic->rowid = $objp->fk_compte;
387  $accountingaccountstatic->label = $objp->label;
388  $accountingaccountstatic->labelshort = $objp->labelshort;
389  $accountingaccountstatic->account_number = $objp->account_number;
390 
391  print '<tr class="oddeven">';
392 
393  // Login
394  print '<td class="nowraponall">';
395  print $userstatic->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1);
396  print '</td>';
397 
398  // Line id
399  print '<td>'.$objp->rowid.'</td>';
400 
401  // Ref Expense report
402  print '<td>'.$expensereportstatic->getNomUrl(1).'</td>';
403 
404  // Date validation
405  if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
406  print '<td class="center">'.dol_print_date($db->jdate($objp->date_valid), 'day').'</td>';
407  }
408 
409  print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>';
410 
411  // Fees label
412  print '<td class="tdoverflow">'.($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))).'</td>';
413 
414  // Fees description -- Can be null
415  print '<td>';
416  $text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments, 1));
417  $trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
418  print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments);
419  print '</td>';
420 
421  // Amount without taxes
422  print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
423 
424  // Vat rate
425  print '<td class="center">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
426 
427  // Accounting account affected
428  print '<td>';
429  print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1);
430  print ' <a class="editfielda reposition marginleftonly marginrightonly" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
431  print img_edit();
432  print '</a></td>';
433  print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="'.$objp->rowid.'"/></td>';
434 
435  print "</tr>";
436  $i++;
437  }
438  if ($num_lines == 0) {
439  $colspan=10;
440  if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
441  $colspan++;
442  }
443  print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
444  }
445 
446  print "</table>";
447  print "</div>";
448 
449  if ($nbtotalofrecords > $limit) {
450  print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1);
451  }
452 
453  print '</form>';
454 } else {
455  print $db->lasterror();
456 }
457 
458 // End of page
459 llxFooter();
460 $db->close();
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:638
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
llxFooter()
Empty footer.
Definition: wrapper.php:70
Class to manage accounting accounts.
Class to manage Trips and Expenses.
const STATUS_CLOSED
Classified paid.
Class to manage generation of HTML components for accounting management.
Class to manage generation of HTML components Only common components must be here.
Classe permettant la generation de composants html autre Only common components are here.
Class to manage Dolibarr users.
Definition: user.class.php:48
if(isModEnabled('facture') && $user->hasRight('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') && $user->hasRight('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)) $sql
Social contributions to pay.
Definition: index.php:746
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
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...
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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...
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.