dolibarr  16.0.5
subaccount.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
3  * Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
4  * Copyright (C) 2016-2018 Laurent Destailleur <eldy@users.sourceforge.net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
26 require '../../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
29 
30 // Load translation files required by the page
31 $langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "hrm", "errors"));
32 
33 $mesg = '';
34 $action = GETPOST('action', 'aZ09');
35 $cancel = GETPOST('cancel', 'alpha');
36 $id = GETPOST('id', 'int');
37 $rowid = GETPOST('rowid', 'int');
38 $massaction = GETPOST('massaction', 'aZ09');
39 $optioncss = GETPOST('optioncss', 'alpha');
40 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'accountingsubaccountlist'; // To manage different context of search
41 
42 $search_subaccount = GETPOST('search_subaccount', 'alpha');
43 $search_label = GETPOST('search_label', 'alpha');
44 $search_type = GETPOST('search_type', 'int');
45 
46 // Security check
47 if ($user->socid > 0) {
49 }
50 if (empty($user->rights->accounting->chartofaccount)) {
52 }
53 
54 // Load variable for pagination
55 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
56 $sortfield = GETPOST('sortfield', 'aZ09comma');
57 $sortorder = GETPOST('sortorder', 'aZ09comma');
58 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
59 if (empty($page) || $page == -1) {
60  $page = 0;
61 } // If $page is not defined, or '' or -1
62 $offset = $limit * $page;
63 $pageprev = $page - 1;
64 $pagenext = $page + 1;
65 if (!$sortfield) {
66  $sortfield = "label";
67 }
68 if (!$sortorder) {
69  $sortorder = "ASC";
70 }
71 
72 $arrayfields = array(
73  'subaccount'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
74  'label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
75  'type'=>array('label'=>$langs->trans("Type"), 'checked'=>1),
76  'reconcilable'=>array('label'=>$langs->trans("Reconcilable"), 'checked'=>1)
77 );
78 
79 if ($conf->global->MAIN_FEATURES_LEVEL < 2) {
80  unset($arrayfields['reconcilable']);
81 }
82 
83 /*
84  * Actions
85  */
86 
87 if (GETPOST('cancel', 'alpha')) {
88  $action = 'list'; $massaction = '';
89 }
90 if (!GETPOST('confirmmassaction', 'alpha')) {
91  $massaction = '';
92 }
93 
94 $parameters = array();
95 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
96 if ($reshook < 0) {
97  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
98 }
99 
100 if (empty($reshook)) {
101  if (!empty($cancel)) {
102  $action = '';
103  }
104 
105  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
106 
107  if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All test are required to be compatible with all browsers
108  $search_subaccount = "";
109  $search_label = "";
110  $search_type = "";
111  $search_array_options = array();
112  }
113 }
114 
115 
116 /*
117  * View
118  */
119 
120 $form = new Form($db);
121 
122 $help_url = '';
123 $title = $langs->trans('ChartOfIndividualAccountsOfSubsidiaryLedger');
124 
125 llxHeader('', $title, $help_url);
126 
127 // Customer
128 $sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity";
129 $sql .= " FROM ".MAIN_DB_PREFIX."societe sa";
130 $sql .= " WHERE sa.entity IN (".getEntity('societe').")";
131 $sql .= " AND sa.code_compta <> ''";
132 //print $sql;
133 if (strlen(trim($search_subaccount))) {
134  $lengthpaddingaccount = 0;
135  if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
136  $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT);
137  }
138  $search_subaccount_tmp = $search_subaccount;
139  $weremovedsomezero = 0;
140  if (strlen($search_subaccount_tmp) <= $lengthpaddingaccount) {
141  for ($i = 0; $i < $lengthpaddingaccount; $i++) {
142  if (preg_match('/0$/', $search_subaccount_tmp)) {
143  $weremovedsomezero++;
144  $search_subaccount_tmp = preg_replace('/0$/', '', $search_subaccount_tmp);
145  }
146  }
147  }
148 
149  //var_dump($search_subaccount); exit;
150  if ($search_subaccount_tmp) {
151  if ($weremovedsomezero) {
152  $search_subaccount_tmp_clean = $search_subaccount_tmp;
153  $search_subaccount_clean = $search_subaccount;
154  $startchar = '%';
155  if (strpos($search_subaccount_tmp, '^') === 0) {
156  $startchar = '';
157  $search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
158  $search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
159  }
160  $sql .= " AND (sa.code_compta LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
161  $sql .= " OR sa.code_compta LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
162  } else {
163  $sql .= natural_search("sa.code_compta", $search_subaccount_tmp);
164  }
165  }
166 }
167 if (strlen(trim($search_label))) {
168  $sql .= natural_search("sa.nom", $search_label);
169 }
170 if (!empty($search_type) && $search_type >= 0) {
171  $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
172 }
173 
174 // Supplier
175 $sql .= " UNION ";
176 $sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '2' as type, sa.entity FROM ".MAIN_DB_PREFIX."societe sa";
177 $sql .= " WHERE sa.entity IN (".getEntity('societe').")";
178 $sql .= " AND sa.code_compta_fournisseur <> ''";
179 //print $sql;
180 if (strlen(trim($search_subaccount))) {
181  $lengthpaddingaccount = 0;
182  if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
183  $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT);
184  }
185  $search_subaccount_tmp = $search_subaccount;
186  $weremovedsomezero = 0;
187  if (strlen($search_subaccount_tmp) <= $lengthpaddingaccount) {
188  for ($i = 0; $i < $lengthpaddingaccount; $i++) {
189  if (preg_match('/0$/', $search_subaccount_tmp)) {
190  $weremovedsomezero++;
191  $search_subaccount_tmp = preg_replace('/0$/', '', $search_subaccount_tmp);
192  }
193  }
194  }
195 
196  //var_dump($search_subaccount); exit;
197  if ($search_subaccount_tmp) {
198  if ($weremovedsomezero) {
199  $search_subaccount_tmp_clean = $search_subaccount_tmp;
200  $search_subaccount_clean = $search_subaccount;
201  $startchar = '%';
202  if (strpos($search_subaccount_tmp, '^') === 0) {
203  $startchar = '';
204  $search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
205  $search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
206  }
207  $sql .= " AND (sa.code_compta_fournisseur LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
208  $sql .= " OR sa.code_compta_fournisseur LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
209  } else {
210  $sql .= natural_search("sa.code_compta_fournisseur", $search_subaccount_tmp);
211  }
212  }
213 }
214 if (strlen(trim($search_label))) {
215  $sql .= natural_search("sa.nom", $search_label);
216 }
217 if (!empty($search_type) && $search_type >= 0) {
218  $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
219 }
220 
221 // User
222 $sql .= " UNION ";
223 $sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '3' as type, u.entity FROM ".MAIN_DB_PREFIX."user u";
224 $sql .= " WHERE u.entity IN (".getEntity('user').")";
225 $sql .= " AND u.accountancy_code <> ''";
226 //print $sql;
227 if (strlen(trim($search_subaccount))) {
228  $lengthpaddingaccount = 0;
229  if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
230  $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT);
231  }
232  $search_subaccount_tmp = $search_subaccount;
233  $weremovedsomezero = 0;
234  if (strlen($search_subaccount_tmp) <= $lengthpaddingaccount) {
235  for ($i = 0; $i < $lengthpaddingaccount; $i++) {
236  if (preg_match('/0$/', $search_subaccount_tmp)) {
237  $weremovedsomezero++;
238  $search_subaccount_tmp = preg_replace('/0$/', '', $search_subaccount_tmp);
239  }
240  }
241  }
242 
243  //var_dump($search_subaccount); exit;
244  if ($search_subaccount_tmp) {
245  if ($weremovedsomezero) {
246  $search_subaccount_tmp_clean = $search_subaccount_tmp;
247  $search_subaccount_clean = $search_subaccount;
248  $startchar = '%';
249  if (strpos($search_subaccount_tmp, '^') === 0) {
250  $startchar = '';
251  $search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
252  $search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
253  }
254  $sql .= " AND (u.accountancy_code LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
255  $sql .= " OR u.accountancy_code LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
256  } else {
257  $sql .= natural_search("u.accountancy_code", $search_subaccount_tmp);
258  }
259  }
260 }
261 if (strlen(trim($search_label))) {
262  $sql .= natural_search("u.lastname", $search_label);
263 }
264 if (!empty($search_type) && $search_type >= 0) {
265  $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
266 }
267 
268 $sql .= $db->order($sortfield, $sortorder);
269 
270 // Count total nb of records
271 $nbtotalofrecords = '';
272 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
273  $resql = $db->query($sql);
274  $nbtotalofrecords = $db->num_rows($resql);
275  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
276  $page = 0;
277  $offset = 0;
278  }
279 }
280 
281 $sql .= $db->plimit($limit + 1, $offset);
282 
283 dol_syslog('accountancy/admin/subaccount.php:: $sql='.$sql);
284 $resql = $db->query($sql);
285 
286 if ($resql) {
287  $num = $db->num_rows($resql);
288 
289  $param = '';
290  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
291  $param .= '&contextpage='.urlencode($contextpage);
292  }
293  if ($limit > 0 && $limit != $conf->liste_limit) {
294  $param .= '&limit='.urlencode($limit);
295  }
296  if ($search_subaccount) {
297  $param .= '&search_subaccount='.urlencode($search_subaccount);
298  }
299  if ($search_label) {
300  $param .= '&search_label='.urlencode($search_label);
301  }
302  if ($optioncss != '') {
303  $param .= '&optioncss='.urlencode($optioncss);
304  }
305 
306  print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
307  if ($optioncss != '') {
308  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
309  }
310  print '<input type="hidden" name="token" value="'.newToken().'">';
311  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
312  print '<input type="hidden" name="action" value="list">';
313  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
314  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
315  print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
316 
317  print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1);
318 
319  print '<div class="info">'.$langs->trans("WarningCreateSubAccounts").'</div>';
320 
321  $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
322  $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
323 
324  $moreforfilter = '';
325  $massactionbutton = '';
326 
327  print '<div class="div-table-responsive">';
328  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
329 
330  // Line for search fields
331  print '<tr class="liste_titre_filter">';
332  if (!empty($arrayfields['subaccount']['checked'])) {
333  print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_subaccount" value="'.$search_subaccount.'"></td>';
334  }
335  if (!empty($arrayfields['label']['checked'])) {
336  print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
337  }
338  if (!empty($arrayfields['type']['checked'])) {
339  print '<td class="liste_titre center">'.$form->selectarray('search_type', array('1'=>$langs->trans('Customer'), '2'=>$langs->trans('Supplier'), '3'=>$langs->trans('Employee')), $search_type, 1).'</td>';
340  }
341  if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
342  if (!empty($arrayfields['reconcilable']['checked'])) {
343  print '<td class="liste_titre">&nbsp;</td>';
344  }
345  }
346  print '<td class="liste_titre maxwidthsearch">';
347  $searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1);
348  print $searchpicto;
349  print '</td>';
350  print '</tr>';
351 
352  print '<tr class="liste_titre">';
353  if (!empty($arrayfields['subaccount']['checked'])) {
354  print_liste_field_titre($arrayfields['subaccount']['label'], $_SERVER["PHP_SELF"], "subaccount", "", $param, '', $sortfield, $sortorder);
355  }
356  if (!empty($arrayfields['label']['checked'])) {
357  print_liste_field_titre($arrayfields['label']['label'], $_SERVER["PHP_SELF"], "label", "", $param, '', $sortfield, $sortorder);
358  }
359  if (!empty($arrayfields['type']['checked'])) {
360  print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'center ');
361  }
362  if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
363  if (!empty($arrayfields['reconcilable']['checked'])) {
364  print_liste_field_titre($arrayfields['reconcilable']['label'], $_SERVER["PHP_SELF"], 'reconcilable', '', $param, '', $sortfield, $sortorder, 'center ');
365  }
366  }
367  print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
368  print "</tr>\n";
369 
370  $totalarray = array();
371  $totalarray['nbfield'] = 0;
372  $i = 0;
373  while ($i < min($num, $limit)) {
374  $obj = $db->fetch_object($resql);
375 
376  print '<tr class="oddeven">';
377 
378  // Account number
379  if (!empty($arrayfields['subaccount']['checked'])) {
380  print "<td>";
381  print length_accounta($obj->subaccount);
382  print "</td>\n";
383  if (!$i) {
384  $totalarray['nbfield']++;
385  }
386  }
387 
388  // Subaccount label
389  if (!empty($arrayfields['label']['checked'])) {
390  print "<td>";
391  print $obj->label;
392  print "</td>\n";
393  if (!$i) {
394  $totalarray['nbfield']++;
395  }
396  }
397 
398  // Type
399  if (!empty($arrayfields['type']['checked'])) {
400  print '<td class="center">';
401  $s = '';
402  // Customer
403  if ($obj->type == 1) {
404  $s .= '<a class="customer-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">'.$langs->trans("Customer").'</a>';
405  } elseif ($obj->type == 2) {
406  // Supplier
407  $s .= '<a class="vendor-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
408  } elseif ($obj->type == 3) {
409  // User
410  $s .= '<a class="user-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->id.'">'.$langs->trans("Employee").'</a>';
411  }
412  print $s;
413  print '</td>';
414  if (!$i) {
415  $totalarray['nbfield']++;
416  }
417  }
418 
419  if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
420  // Activated or not reconciliation on accounting account
421  if (!empty($arrayfields['reconcilable']['checked'])) {
422  print '<td class="center">';
423  if (empty($obj->reconcilable)) {
424  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=1&token='.newToken().'">';
425  print img_picto($langs->trans("Disabled"), 'switch_off');
426  print '</a>';
427  } else {
428  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=1&token='.newToken().'">';
429  print img_picto($langs->trans("Activated"), 'switch_on');
430  print '</a>';
431  }
432  print '</td>';
433  if (!$i) {
434  $totalarray['nbfield']++;
435  }
436  }
437  }
438 
439  // Action
440  print '<td class="center">';
441  $e = '';
442  // Customer
443  if ($obj->type == 1) {
444  $e .= '<a class="editfielda" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&token='.newToken().'&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
445  } elseif ($obj->type == 2) {
446  // Supplier
447  $e .= '<a class="editfielda" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&token='.newToken().'&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
448  } elseif ($obj->type == 3) {
449  // User
450  $e .= '<a class="editfielda" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
451  }
452  print $e;
453  print '</td>'."\n";
454  if (!$i) {
455  $totalarray['nbfield']++;
456  }
457 
458  print '</tr>'."\n";
459  $i++;
460  }
461 
462  $db->free($resql);
463 
464  $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
465  $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
466  print $hookmanager->resPrint;
467 
468  print "</table>";
469  print "</div>";
470 
471  print '</form>';
472 } else {
473  dol_print_error($db);
474 }
475 
476 // End of page
477 llxFooter();
478 $db->close();
length_accounta
length_accounta($accounta)
Return Auxiliary accounting account of thirdparties with defined length.
Definition: accounting.lib.php:133
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
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
img_edit
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
Definition: functions.lib.php:4389
$help_url
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Definition: agenda.php:116
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
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
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10878
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