dolibarr  x.y.z
invoicetemplate_list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
6  * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
7  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
8  * Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
9  * Copyright (C) 2015-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
10  * Copyright (C) 2016 Meziane Sof <virtualsof@yahoo.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 // Load Dolibarr environment
33 require '../../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
35 require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
37 require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
38 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
39 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
40 require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
41 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
42 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
43 
44 // Load translation files required by the page
45 $langs->loadLangs(array('bills', 'compta', 'admin', 'other'));
46 
47 $action = GETPOST('action', 'alpha');
48 $massaction = GETPOST('massaction', 'alpha');
49 $show_files = GETPOST('show_files', 'int');
50 $confirm = GETPOST('confirm', 'alpha');
51 $cancel = GETPOST('cancel', 'alpha');
52 $toselect = GETPOST('toselect', 'array');
53 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'invoicetemplatelist'; // To manage different context of search
54 $optioncss = GETPOST('optioncss', 'alpha');
55 
56 $socid = GETPOST('socid', 'int');
57 
58 // Security check
59 $id = (GETPOST('facid', 'int') ?GETPOST('facid', 'int') : GETPOST('id', 'int'));
60 $lineid = GETPOST('lineid', 'int');
61 $ref = GETPOST('ref', 'alpha');
62 if ($user->socid) {
63  $socid = $user->socid;
64 }
65 $objecttype = 'facture_rec';
66 if ($action == "create" || $action == "add") {
67  $objecttype = '';
68 }
69 $result = restrictedArea($user, 'facture', $id, $objecttype);
70 
71 $search_ref = GETPOST('search_ref');
72 $search_societe = GETPOST('search_societe');
73 $search_montant_ht = GETPOST('search_montant_ht');
74 $search_montant_vat = GETPOST('search_montant_vat');
75 $search_montant_ttc = GETPOST('search_montant_ttc');
76 $search_payment_mode = GETPOST('search_payment_mode');
77 $search_payment_term = GETPOST('search_payment_term');
78 $search_date_startday = GETPOST('search_date_startday', 'int');
79 $search_date_startmonth = GETPOST('search_date_startmonth', 'int');
80 $search_date_startyear = GETPOST('search_date_startyear', 'int');
81 $search_date_endday = GETPOST('search_date_endday', 'int');
82 $search_date_endmonth = GETPOST('search_date_endmonth', 'int');
83 $search_date_endyear = GETPOST('search_date_endyear', 'int');
84 $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
85 $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
86 $search_date_when_startday = GETPOST('search_date_when_startday', 'int');
87 $search_date_when_startmonth = GETPOST('search_date_when_startmonth', 'int');
88 $search_date_when_startyear = GETPOST('search_date_when_startyear', 'int');
89 $search_date_when_endday = GETPOST('search_date_when_endday', 'int');
90 $search_date_when_endmonth = GETPOST('search_date_when_endmonth', 'int');
91 $search_date_when_endyear = GETPOST('search_date_when_endyear', 'int');
92 $search_date_when_start = dol_mktime(0, 0, 0, $search_date_when_startmonth, $search_date_when_startday, $search_date_when_startyear); // Use tzserver
93 $search_date_when_end = dol_mktime(23, 59, 59, $search_date_when_endmonth, $search_date_when_endday, $search_date_when_endyear);
94 $search_recurring = GETPOST('search_recurring', 'int');
95 $search_frequency = GETPOST('search_frequency', 'alpha');
96 $search_unit_frequency = GETPOST('search_unit_frequency', 'alpha');
97 $search_status = GETPOST('search_status', 'int');
98 
99 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
100 $sortfield = GETPOST('sortfield', 'aZ09comma');
101 $sortorder = GETPOST('sortorder', 'aZ09comma');
102 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
103 if (empty($page) || $page == -1) {
104  $page = 0;
105 } // If $page is not defined, or '' or -1
106 $offset = $limit * $page;
107 if (!$sortorder) {
108  $sortorder = 'DESC';
109 }
110 if (!$sortfield) {
111  $sortfield = 'f.titre';
112 }
113 $pageprev = $page - 1;
114 $pagenext = $page + 1;
115 
116 $object = new FactureRec($db);
117 if (($id > 0 || $ref) && $action != 'create' && $action != 'add') {
118  $ret = $object->fetch($id, $ref);
119  if (!$ret) {
120  setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors');
121  }
122 }
123 
124 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
125 $hookmanager->initHooks(array('invoicereclist'));
126 $extrafields = new ExtraFields($db);
127 
128 // fetch optionals attributes and labels
129 $extrafields->fetch_name_optionals_label($object->table_element);
130 
131 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
132 
133 $permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php
134 $permissiondellink = $user->rights->facture->creer; // Used by the include of actions_dellink.inc.php
135 $permissiontoedit = $user->rights->facture->creer; // Used by the include of actions_lineupdonw.inc.php
136 
137 $arrayfields = array(
138  'f.titre'=>array('label'=>"Ref", 'checked'=>1),
139  's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
140  'f.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
141  'f.total_tva'=>array('label'=>"AmountVAT", 'checked'=>1),
142  'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>1),
143  'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0),
144  'f.fk_cond_reglement'=>array('label'=>"PaymentTerm", 'checked'=>0),
145  'recurring'=>array('label'=>"RecurringInvoice", 'checked'=>1),
146  'f.frequency'=>array('label'=>"Frequency", 'checked'=>1),
147  'f.unit_frequency'=>array('label'=>"FrequencyUnit", 'checked'=>1),
148  'f.nb_gen_done'=>array('label'=>"NbOfGenerationDoneShort", 'checked'=>1),
149  'f.date_last_gen'=>array('label'=>"DateLastGenerationShort", 'checked'=>1),
150  'f.date_when'=>array('label'=>"NextDateToExecutionShort", 'checked'=>1),
151  'f.fk_user_author'=>array('label'=>"UserCreation", 'checked'=>0, 'position'=>500),
152  'f.fk_user_modif'=>array('label'=>"UserModification", 'checked'=>0, 'position'=>505),
153  'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>520),
154  'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>525),
155  'status'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
156 );
157 // Extra fields
158 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
159 
160 $object->fields = dol_sort_array($object->fields, 'position');
161 $arrayfields = dol_sort_array($arrayfields, 'position');
162 
163 if ($socid > 0) {
164  $tmpthirdparty = new Societe($db);
165  $res = $tmpthirdparty->fetch($socid);
166  if ($res > 0) {
167  $search_societe = $tmpthirdparty->name;
168  }
169 }
170 
171 
172 if ($socid > 0) {
173  $tmpthirdparty = new Societe($db);
174  $res = $tmpthirdparty->fetch($socid);
175  if ($res > 0) {
176  $search_societe = $tmpthirdparty->name;
177  }
178 }
179 
180 $objecttype = 'facture_rec';
181 
182 $result = restrictedArea($user, 'facture', $object->id, $objecttype);
183 
184 
185 /*
186  * Actions
187  */
188 
189 if (GETPOST('cancel', 'alpha')) {
190  $action = 'list';
191  $massaction = '';
192 }
193 if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
194  $massaction = '';
195 }
196 
197 $parameters = array('socid' => $socid);
198 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
199 if ($reshook < 0) {
200  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
201 }
202 
203 if (empty($reshook)) {
204  if (GETPOST('cancel', 'alpha')) {
205  $action = '';
206  }
207 
208  // Selection of new fields
209  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
210 
211  // Do we click on purge search criteria ?
212  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
213  $search_ref = '';
214  $search_societe = '';
215  $search_montant_ht = '';
216  $search_montant_vat = '';
217  $search_montant_ttc = '';
218  $search_payment_mode = '';
219  $search_payment_term = '';
220  $search_date_startday = '';
221  $search_date_startmonth = '';
222  $search_date_startyear = '';
223  $search_date_endday = '';
224  $search_date_endmonth = '';
225  $search_date_endyear = '';
226  $search_date_start = '';
227  $search_date_end = '';
228  $search_date_when_startday = '';
229  $search_date_when_startmonth = '';
230  $search_date_when_startyear = '';
231  $search_date_when_endday = '';
232  $search_date_when_endmonth = '';
233  $search_date_when_endyear = '';
234  $search_date_when_start = '';
235  $search_date_when_end = '';
236  $search_recurring = '';
237  $search_frequency = '';
238  $search_unit_frequency = '';
239  $search_status = '';
240  $search_array_options = array();
241  }
242 
243  // Mass actions
244  /*$objectclass='MyObject';
245  $objectlabel='MyObject';
246  $permissiontoread = $user->rights->mymodule->read;
247  $permissiontodelete = $user->rights->mymodule->delete;
248  $uploaddir = $conf->mymodule->dir_output;
249  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/
250 }
251 
252 
253 /*
254  * View
255  */
256 
257 llxHeader('', $langs->trans("RepeatableInvoices"), 'ch-facture.html#s-fac-facture-rec');
258 
259 $form = new Form($db);
260 $formother = new FormOther($db);
261 if (isModEnabled('project')) {
262  $formproject = new FormProjets($db);
263 }
264 $companystatic = new Societe($db);
265 $invoicerectmp = new FactureRec($db);
266 $tmpuser = new User($db);
267 
268 $now = dol_now();
269 $tmparray = dol_getdate($now);
270 $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); // Today is last second of current day
271 
272 
273 /*
274  * List mode
275  */
276 
277 $sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre as title, f.total_ht, f.total_tva, f.total_ttc, f.frequency, f.unit_frequency,";
278 $sql .= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,";
279 $sql .= " f.datec, f.fk_user_author, f.tms, f.fk_user_modif,";
280 $sql .= " f.fk_cond_reglement, f.fk_mode_reglement";
281 // Add fields from extrafields
282 if (!empty($extrafields->attributes[$object->table_element]['label'])) {
283  foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
284  $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
285  }
286 }
287 // Add fields from hooks
288 $parameters = array();
289 $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
290 $sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
291 $sql = preg_replace('/,\s*$/', '', $sql);
292 
293 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_rec as f";
294 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_rec_extrafields as ef ON ef.fk_object = f.rowid";
295 if (empty($user->rights->societe->client->voir) && !$socid) {
296  $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
297 }
298 $sql .= " WHERE f.fk_soc = s.rowid";
299 $sql .= ' AND f.entity IN ('.getEntity('invoice').')';
300 if (empty($user->rights->societe->client->voir) && !$socid) {
301  $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
302 }
303 if ($search_ref) {
304  $sql .= natural_search('f.titre', $search_ref);
305 }
306 if ($socid) {
307  $sql .= ' AND s.rowid = '.(int) $socid;
308 }
309 if ($search_societe) {
310  $sql .= natural_search('s.nom', $search_societe);
311 }
312 if ($search_montant_ht != '') {
313  $sql .= natural_search('f.total_ht', $search_montant_ht, 1);
314 }
315 if ($search_montant_vat != '') {
316  $sql .= natural_search('f.total_tva', $search_montant_vat, 1);
317 }
318 if ($search_montant_ttc != '') {
319  $sql .= natural_search('f.total_ttc', $search_montant_ttc, 1);
320 }
321 if (!empty($search_payment_mode) && $search_payment_mode != '-1') {
322  $sql .= natural_search('f.fk_mode_reglement', $search_payment_mode, 1);
323 }
324 if (!empty($search_payment_term) && $search_payment_term != '-1') {
325  $sql .= natural_search('f.fk_cond_reglement', $search_payment_term, 1);
326 }
327 if ($search_recurring == '1') {
328  $sql .= ' AND f.frequency > 0';
329 }
330 if ($search_recurring == '0') {
331  $sql .= ' AND (f.frequency IS NULL or f.frequency = 0)';
332 }
333 if ($search_frequency != '') {
334  $sql .= natural_search('f.frequency', $search_frequency, 1);
335 }
336 if ($search_unit_frequency != '') {
337  $sql .= ' AND f.frequency > 0'.natural_search('f.unit_frequency', $search_unit_frequency);
338 }
339 if ($search_status != '' && $search_status >= -1) {
340  if ($search_status == 0) {
341  $sql .= ' AND frequency = 0 AND suspended = 0';
342  }
343  if ($search_status == 1) {
344  $sql .= ' AND frequency != 0 AND suspended = 0';
345  }
346  if ($search_status == -1) {
347  $sql .= ' AND suspended = 1';
348  }
349 }
350 if ($search_date_start) {
351  $sql .= " AND f.date_last_gen >= '".$db->idate($search_date_start)."'";
352 }
353 if ($search_date_end) {
354  $sql .= " AND f.date_last_gen <= '".$db->idate($search_date_end)."'";
355 }
356 if ($search_date_when_start) {
357  $sql .= " AND f.date_when >= '".$db->idate($search_date_when_start)."'";
358 }
359 if ($search_date_when_end) {
360  $sql .= " AND f.date_when <= '".$db->idate($search_date_when_end)."'";
361 }
362 
363 $tmpsortfield = $sortfield;
364 if ($tmpsortfield == 'recurring') {
365  $tmpsortfield = 'f.frequency';
366 }
367 $sql .= $db->order($tmpsortfield, $sortorder);
368 
369 $nbtotalofrecords = '';
370 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
371  $result = $db->query($sql);
372  $nbtotalofrecords = $db->num_rows($result);
373  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
374  $page = 0;
375  $offset = 0;
376  }
377 }
378 
379 $sql .= $db->plimit($limit + 1, $offset);
380 
381 $resql = $db->query($sql);
382 if ($resql) {
383  $num = $db->num_rows($resql);
384 
385  $param = '';
386  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
387  $param .= '&contextpage='.urlencode($contextpage);
388  }
389  if ($limit > 0 && $limit != $conf->liste_limit) {
390  $param .= '&limit='.urlencode($limit);
391  }
392  if ($socid > 0) {
393  $param .= '&socid='.urlencode($socid);
394  }
395  if ($search_date_startday) {
396  $param .= '&search_date_startday='.urlencode($search_date_startday);
397  }
398  if ($search_date_startmonth) {
399  $param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
400  }
401  if ($search_date_startyear) {
402  $param .= '&search_date_startyear='.urlencode($search_date_startyear);
403  }
404  if ($search_date_endday) {
405  $param .= '&search_date_endday='.urlencode($search_date_endday);
406  }
407  if ($search_date_endmonth) {
408  $param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
409  }
410  if ($search_date_endyear) {
411  $param .= '&search_date_endyear='.urlencode($search_date_endyear);
412  }
413  if ($search_date_when_startday) {
414  $param .= '&search_date_when_startday='.urlencode($search_date_when_startday);
415  }
416  if ($search_date_when_startmonth) {
417  $param .= '&search_date_when_startmonth='.urlencode($search_date_when_startmonth);
418  }
419  if ($search_date_when_startyear) {
420  $param .= '&search_date_when_startyear='.urlencode($search_date_when_startyear);
421  }
422  if ($search_date_when_endday) {
423  $param .= '&search_date_when_endday='.urlencode($search_date_when_endday);
424  }
425  if ($search_date_when_endmonth) {
426  $param .= '&search_date_when_endmonth='.urlencode($search_date_when_endmonth);
427  }
428  if ($search_date_when_endyear) {
429  $param .= '&search_date_when_endyear='.urlencode($search_date_when_endyear);
430  }
431  if ($search_ref) {
432  $param .= '&search_ref='.urlencode($search_ref);
433  }
434  if ($search_societe) {
435  $param .= '&search_societe='.urlencode($search_societe);
436  }
437  if ($search_montant_ht != '') {
438  $param .= '&search_montant_ht='.urlencode($search_montant_ht);
439  }
440  if ($search_montant_vat != '') {
441  $param .= '&search_montant_vat='.urlencode($search_montant_vat);
442  }
443  if ($search_montant_ttc != '') {
444  $param .= '&search_montant_ttc='.urlencode($search_montant_ttc);
445  }
446  if ($search_payment_mode != '') {
447  $param .= '&search_payment_mode='.urlencode($search_payment_mode);
448  }
449  if ($search_payment_term != '') {
450  $param .= '&search_payment_term='.urlencode($search_payment_term);
451  }
452  if ($search_recurring != '' && $search_recurring != '-1') {
453  $param .= '&search_recurring='.urlencode($search_recurring);
454  }
455  if ($search_frequency > 0) {
456  $param .= '&search_frequency='.urlencode($search_frequency);
457  }
458  if ($search_unit_frequency != '') {
459  $param .= '&search_unit_frequency='.urlencode($search_unit_frequency);
460  }
461  if ($search_status != '') {
462  $param .= '&search_status='.urlencode($search_status);
463  }
464  if ($optioncss != '') {
465  $param .= '&optioncss='.urlencode($optioncss);
466  }
467  // Add $param from extra fields
468  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
469 
470  $massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
471 
472  $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
473  $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
474  //$selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
475 
476  print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
477  if ($optioncss != '') {
478  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
479  }
480  print '<input type="hidden" name="token" value="'.newToken().'">';
481  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
482  print '<input type="hidden" name="action" value="list">';
483  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
484  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
485  print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
486  print '<input type="hidden" name="search_status" value="'.$search_status.'">';
487 
488  $title = $langs->trans("RepeatableInvoices");
489 
490  print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit, 0, 0, 1);
491 
492  print '<span class="opacitymedium">'.$langs->trans("ToCreateAPredefinedInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'</span><br><br>';
493 
494  $i = 0;
495 
496  $moreforfilter = '';
497 
498  print '<div class="div-table-responsive">';
499  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
500 
501  // Filters lines
502  print '<tr class="liste_titre_filter">';
503  // Ref
504  if (!empty($arrayfields['f.titre']['checked'])) {
505  print '<td class="liste_titre left">';
506  print '<input class="flat maxwidth100" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
507  print '</td>';
508  }
509  // Thirdparty
510  if (!empty($arrayfields['s.nom']['checked'])) {
511  print '<td class="liste_titre left"><input class="flat" type="text" size="8" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
512  }
513  if (!empty($arrayfields['f.total_ht']['checked'])) {
514  // Amount net
515  print '<td class="liste_titre right">';
516  print '<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'">';
517  print '</td>';
518  }
519  if (!empty($arrayfields['f.total_tva']['checked'])) {
520  // Amount Vat
521  print '<td class="liste_titre right">';
522  print '<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).'">';
523  print '</td>';
524  }
525  if (!empty($arrayfields['f.total_ttc']['checked'])) {
526  // Amount
527  print '<td class="liste_titre right">';
528  print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">';
529  print '</td>';
530  }
531  if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
532  // Payment term
533  print '<td class="liste_titre right">';
534  print $form->getSelectConditionsPaiements($search_payment_term, 'search_payment_term', -1, 1, 1, 'maxwidth100');
535  print "</td>";
536  }
537  if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
538  // Payment mode
539  print '<td class="liste_titre right">';
540  print $form->select_types_paiements($search_payment_mode, 'search_payment_mode', '', 0, 1, 1, 0, 1, 'maxwidth100', 1);
541  print '</td>';
542  }
543  if (!empty($arrayfields['recurring']['checked'])) {
544  // Recurring or not
545  print '<td class="liste_titre center">';
546  print $form->selectyesno('search_recurring', $search_recurring, 1, false, 1);
547  print '</td>';
548  }
549  if (!empty($arrayfields['f.frequency']['checked'])) {
550  // Recurring or not
551  print '<td class="liste_titre center">';
552  print '<input class="flat" type="text" size="1" name="search_frequency" value="'.dol_escape_htmltag($search_frequency).'">';
553  print '</td>';
554  }
555  if (!empty($arrayfields['f.unit_frequency']['checked'])) {
556  // Frequency unit
557  print '<td class="liste_titre center">';
558  print '<input class="flat" type="text" size="1" name="search_unit_frequency" value="'.dol_escape_htmltag($search_unit_frequency).'">';
559  print '</td>';
560  }
561  if (!empty($arrayfields['f.nb_gen_done']['checked'])) {
562  // Nb generation
563  print '<td class="liste_titre" align="center">';
564  print '</td>';
565  }
566  // Date invoice
567  if (!empty($arrayfields['f.date_last_gen']['checked'])) {
568  print '<td class="liste_titre center">';
569  print '<div class="nowrap">';
570  print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
571  print '</div>';
572  print '<div class="nowrap">';
573  print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
574  print '</div>';
575  print '</td>';
576  }
577  // Date next generation
578  if (!empty($arrayfields['f.date_when']['checked'])) {
579  print '<td class="liste_titre center">';
580  print '<div class="nowrap">';
581  print $form->selectDate($search_date_when_start ? $search_date_when_start : -1, 'search_date_when_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
582  print '</div>';
583  print '<div class="nowrap">';
584  print $form->selectDate($search_date_when_end ? $search_date_when_end : -1, 'search_date_when_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
585  print '</div>';
586  print '</td>';
587  }
588  // Extra fields
589  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
590 
591  // Fields from hook
592  $parameters = array('arrayfields'=>$arrayfields);
593  $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
594  print $hookmanager->resPrint;
595  // User creation
596  if (!empty($arrayfields['f.fk_user_author']['checked'])) {
597  print '<td class="liste_titre">';
598  print '</td>';
599  }
600  // User modification
601  if (!empty($arrayfields['f.fk_user_modif']['checked'])) {
602  print '<td class="liste_titre">';
603  print '</td>';
604  }
605  // Date creation
606  if (!empty($arrayfields['f.datec']['checked'])) {
607  print '<td class="liste_titre">';
608  print '</td>';
609  }
610  // Date modification
611  if (!empty($arrayfields['f.tms']['checked'])) {
612  print '<td class="liste_titre">';
613  print '</td>';
614  }
615  // Status
616  if (!empty($arrayfields['status']['checked'])) {
617  print '<td class="liste_titre center">';
618  $liststatus = array(
619  0=>$langs->trans("Draft"),
620  1=>$langs->trans("Active"),
621  -1=>$langs->trans("Disabled"),
622  );
623  print $form->selectarray('search_status', $liststatus, $search_status, -2, 0, 0, '', 0, 0, 0, '', 'width100 onrightofpage');
624  print '</td>';
625  }
626  // Action column
627  print '<td class="liste_titre" align="middle">';
628  $searchpicto = $form->showFilterButtons();
629  print $searchpicto;
630  print '</td>';
631  print "</tr>\n";
632 
633  print '<tr class="liste_titre">';
634  if (!empty($arrayfields['f.titre']['checked'])) {
635  print_liste_field_titre($arrayfields['f.titre']['label'], $_SERVER['PHP_SELF'], "f.titre", "", $param, "", $sortfield, $sortorder);
636  }
637  if (!empty($arrayfields['s.nom']['checked'])) {
638  print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], "s.nom", "", $param, "", $sortfield, $sortorder);
639  }
640  if (!empty($arrayfields['f.total_ht']['checked'])) {
641  print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], "f.total_ht", "", $param, 'class="right"', $sortfield, $sortorder);
642  }
643  if (!empty($arrayfields['f.total_tva']['checked'])) {
644  print_liste_field_titre($arrayfields['f.total_tva']['label'], $_SERVER['PHP_SELF'], "f.total_tva", "", $param, 'class="right"', $sortfield, $sortorder);
645  }
646  if (!empty($arrayfields['f.total_ttc']['checked'])) {
647  print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], "f.total_ttc", "", $param, 'class="right"', $sortfield, $sortorder);
648  }
649  if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
650  print_liste_field_titre($arrayfields['f.fk_cond_reglement']['label'], $_SERVER['PHP_SELF'], "f.fk_cond_reglement", "", $param, '', $sortfield, $sortorder);
651  }
652  if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
653  print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER['PHP_SELF'], "f.fk_mode_reglement", "", $param, '', $sortfield, $sortorder);
654  }
655  if (!empty($arrayfields['recurring']['checked'])) {
656  print_liste_field_titre($arrayfields['recurring']['label'], $_SERVER['PHP_SELF'], "recurring", "", $param, 'class="center"', $sortfield, $sortorder);
657  }
658  if (!empty($arrayfields['f.frequency']['checked'])) {
659  print_liste_field_titre($arrayfields['f.frequency']['label'], $_SERVER['PHP_SELF'], "f.frequency", "", $param, 'align="center"', $sortfield, $sortorder);
660  }
661  if (!empty($arrayfields['f.unit_frequency']['checked'])) {
662  print_liste_field_titre($arrayfields['f.unit_frequency']['label'], $_SERVER['PHP_SELF'], "f.unit_frequency", "", $param, 'align="center"', $sortfield, $sortorder);
663  }
664  if (!empty($arrayfields['f.nb_gen_done']['checked'])) {
665  print_liste_field_titre($arrayfields['f.nb_gen_done']['label'], $_SERVER['PHP_SELF'], "f.nb_gen_done", "", $param, 'align="center"', $sortfield, $sortorder);
666  }
667  if (!empty($arrayfields['f.date_last_gen']['checked'])) {
668  print_liste_field_titre($arrayfields['f.date_last_gen']['label'], $_SERVER['PHP_SELF'], "f.date_last_gen", "", $param, 'align="center"', $sortfield, $sortorder);
669  }
670  if (!empty($arrayfields['f.date_when']['checked'])) {
671  print_liste_field_titre($arrayfields['f.date_when']['label'], $_SERVER['PHP_SELF'], "f.date_when", "", $param, 'align="center"', $sortfield, $sortorder);
672  }
673  if (!empty($arrayfields['f.fk_user_author']['checked'])) {
674  print_liste_field_titre($arrayfields['f.fk_user_author']['label'], $_SERVER['PHP_SELF'], "f.fk_user_author", "", $param, 'align="center"', $sortfield, $sortorder);
675  }
676  if (!empty($arrayfields['f.fk_user_modif']['checked'])) {
677  print_liste_field_titre($arrayfields['f.fk_user_modif']['label'], $_SERVER['PHP_SELF'], "f.fk_user_modif", "", $param, 'align="center"', $sortfield, $sortorder);
678  }
679  if (!empty($arrayfields['f.datec']['checked'])) {
680  print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER['PHP_SELF'], "f.datec", "", $param, 'align="center"', $sortfield, $sortorder);
681  }
682  if (!empty($arrayfields['f.tms']['checked'])) {
683  print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER['PHP_SELF'], "f.tms", "", $param, 'align="center"', $sortfield, $sortorder);
684  }
685  // Extra fields
686  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
687  if (!empty($arrayfields['status']['checked'])) {
688  print_liste_field_titre($arrayfields['status']['label'], $_SERVER['PHP_SELF'], "f.suspended,f.frequency", "", $param, 'align="center"', $sortfield, $sortorder);
689  }
690  print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'center maxwidthsearch ');
691  print "</tr>\n";
692 
693  if ($num > 0) {
694  $i = 0;
695  $totalarray = array();
696  $totalarray['nbfield'] = 0;
697  $totalarray['val']['f.total_ht'] = 0;
698  $totalarray['val']['f.total_tva'] = 0;
699  $totalarray['val']['f.total_ttc'] = 0;
700  while ($i < min($num, $limit)) {
701  $objp = $db->fetch_object($resql);
702  if (empty($objp)) {
703  break;
704  }
705 
706  $companystatic->id = $objp->socid;
707  $companystatic->name = $objp->name;
708 
709  $invoicerectmp->id = !empty($objp->id) ? $objp->id : $objp->facid;
710  $invoicerectmp->frequency = $objp->frequency;
711  $invoicerectmp->suspended = $objp->suspended;
712  $invoicerectmp->unit_frequency = $objp->unit_frequency;
713  $invoicerectmp->nb_gen_max = $objp->nb_gen_max;
714  $invoicerectmp->nb_gen_done = $objp->nb_gen_done;
715  $invoicerectmp->ref = $objp->title;
716  $invoicerectmp->total_ht = $objp->total_ht;
717  $invoicerectmp->total_tva = $objp->total_tva;
718  $invoicerectmp->total_ttc = $objp->total_ttc;
719 
720  print '<tr class="oddeven">';
721 
722  if (!empty($arrayfields['f.titre']['checked'])) {
723  print '<td class="nowrap tdoverflowmax200">';
724  print $invoicerectmp->getNomUrl(1);
725  print "</td>\n";
726  if (!$i) {
727  $totalarray['nbfield']++;
728  }
729  }
730  if (!empty($arrayfields['s.nom']['checked'])) {
731  print '<td class="tdoverflowmax200">'.$companystatic->getNomUrl(1, 'customer').'</td>';
732  if (!$i) {
733  $totalarray['nbfield']++;
734  }
735  }
736  if (!empty($arrayfields['f.total_ht']['checked'])) {
737  print '<td class="nowrap right amount">'.price($objp->total_ht).'</td>'."\n";
738  if (!$i) {
739  $totalarray['nbfield']++;
740  }
741  if (!$i) {
742  $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ht';
743  }
744  $totalarray['val']['f.total_ht'] += $objp->total_ht;
745  }
746  if (!empty($arrayfields['f.total_tva']['checked'])) {
747  print '<td class="nowrap right amount">'.price($objp->total_tva).'</td>'."\n";
748  if (!$i) {
749  $totalarray['nbfield']++;
750  }
751  if (!$i) {
752  $totalarray['pos'][$totalarray['nbfield']] = 'f.total_tva';
753  }
754  $totalarray['val']['f.total_tva'] += $objp->total_tva;
755  }
756  if (!empty($arrayfields['f.total_ttc']['checked'])) {
757  print '<td class="nowrap right amount">'.price($objp->total_ttc).'</td>'."\n";
758  if (!$i) {
759  $totalarray['nbfield']++;
760  }
761  if (!$i) {
762  $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ttc';
763  }
764  $totalarray['val']['f.total_ttc'] += $objp->total_ttc;
765  }
766  // Payment term
767  if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
768  print '<td class="tdoverflowmax150">';
769  $form->form_conditions_reglement('', $objp->fk_cond_reglement, 'none');
770  print '</td>'."\n";
771  if (!$i) {
772  $totalarray['nbfield']++;
773  }
774  }
775  // Payment mode
776  if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
777  print '<td class="tdoverflowmax150">';
778  $form->form_modes_reglement('', $objp->fk_mode_reglement, 'none');
779  print '</td>'."\n";
780  if (!$i) {
781  $totalarray['nbfield']++;
782  }
783  }
784  // Is it a recurring invoice
785  if (!empty($arrayfields['recurring']['checked'])) {
786  print '<td class="center">'.($objp->frequency ? img_picto($langs->trans("Frequency").': '.$objp->frequency.' '.$objp->unit_frequency, 'recurring', 'class="opacitymedium"').' ' : '').yn($objp->frequency ? 1 : 0).'</td>';
787  if (!$i) {
788  $totalarray['nbfield']++;
789  }
790  }
791  if (!empty($arrayfields['f.frequency']['checked'])) {
792  print '<td class="center">'.($objp->frequency > 0 ? $objp->frequency : '').'</td>';
793  if (!$i) {
794  $totalarray['nbfield']++;
795  }
796  }
797  if (!empty($arrayfields['f.unit_frequency']['checked'])) {
798  print '<td class="center">'.($objp->frequency > 0 ? $objp->unit_frequency : '').'</td>';
799  if (!$i) {
800  $totalarray['nbfield']++;
801  }
802  }
803  if (!empty($arrayfields['f.nb_gen_done']['checked'])) {
804  print '<td class="center">';
805  print ($objp->frequency > 0 ? $objp->nb_gen_done.($objp->nb_gen_max > 0 ? ' / '.$objp->nb_gen_max : '') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
806  print '</td>';
807  if (!$i) {
808  $totalarray['nbfield']++;
809  }
810  }
811  // Date last generation
812  if (!empty($arrayfields['f.date_last_gen']['checked'])) {
813  print '<td class="center">';
814  print ($objp->frequency > 0 ? dol_print_date($db->jdate($objp->date_last_gen), 'day') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
815  print '</td>';
816  if (!$i) {
817  $totalarray['nbfield']++;
818  }
819  }
820  // Date next generation
821  if (!empty($arrayfields['f.date_when']['checked'])) {
822  print '<td class="center">';
823  print '<div class="nowraponall">';
824  print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached() ? '<strike>' : '').dol_print_date($db->jdate($objp->date_when), 'day').($invoicerectmp->isMaxNbGenReached() ? '</strike>' : '') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
825  if (!$invoicerectmp->isMaxNbGenReached()) {
826  if (!$objp->suspended && $objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) {
827  print img_warning($langs->trans("Late"));
828  }
829  } else {
830  print img_info($langs->trans("MaxNumberOfGenerationReached"));
831  }
832  print '</div>';
833  print '</td>';
834  if (!$i) {
835  $totalarray['nbfield']++;
836  }
837  }
838  if (!empty($arrayfields['f.fk_user_author']['checked'])) {
839  print '<td class="center tdoverflowmax150">';
840  if ($objp->fk_user_author > 0) {
841  $tmpuser->fetch($objp->fk_user_author);
842  print $tmpuser->getNomUrl(1);
843  }
844  print '</td>';
845  if (!$i) {
846  $totalarray['nbfield']++;
847  }
848  }
849  if (!empty($arrayfields['f.fk_user_modif']['checked'])) {
850  print '<td class="center tdoverflowmax150">';
851  if ($objp->fk_user_author > 0) {
852  $tmpuser->fetch($objp->fk_user_author);
853  print $tmpuser->getNomUrl(1);
854  }
855  print '</td>';
856  if (!$i) {
857  $totalarray['nbfield']++;
858  }
859  }
860  if (!empty($arrayfields['f.datec']['checked'])) {
861  print '<td class="center nowraponall">';
862  print dol_print_date($db->jdate($objp->datec), 'dayhour');
863  print '</td>';
864  if (!$i) {
865  $totalarray['nbfield']++;
866  }
867  }
868  if (!empty($arrayfields['f.tms']['checked'])) {
869  print '<td class="center nowraponall">';
870  print dol_print_date($db->jdate($objp->tms), 'dayhour');
871  print '</td>';
872  if (!$i) {
873  $totalarray['nbfield']++;
874  }
875  }
876 
877  $obj = $objp;
878  // Extra fields
879  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
880  // Fields from hook
881  $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray);
882  $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
883  print $hookmanager->resPrint;
884  // Status
885  if (!empty($arrayfields['status']['checked'])) {
886  print '<td class="center">';
887  print $invoicerectmp->getLibStatut(3, 0);
888  print '</td>';
889  if (!$i) {
890  $totalarray['nbfield']++;
891  }
892  }
893  // Action column
894  print '<td class="center tdoverflowmax125">';
895  if ($user->rights->facture->creer && empty($invoicerectmp->suspended)) {
896  if ($invoicerectmp->isMaxNbGenReached()) {
897  print $langs->trans("MaxNumberOfGenerationReached");
898  } elseif (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) {
899  print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;socid='.$objp->socid.'&amp;fac_rec='.$objp->facid.'">';
900  print img_picto($langs->trans("CreateBill"), 'add', 'class="paddingrightonly"');
901  print $langs->trans("CreateBill").'</a>';
902  } else {
903  print $form->textwithpicto('', $langs->trans("DateIsNotEnough"));
904  }
905  } else {
906  print "&nbsp;";
907  }
908  if (!$i) {
909  $totalarray['nbfield']++;
910  }
911  print "</td>";
912 
913  print "</tr>\n";
914 
915  $i++;
916  }
917  } else {
918  $colspan = 1;
919  foreach ($arrayfields as $key => $val) {
920  if (!empty($val['checked'])) {
921  $colspan++;
922  }
923  }
924  print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
925  }
926 
927  // Show total line
928  include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
929 
930 
931  print "</table>";
932  print "</div>";
933  print "</form>";
934 
935  $db->free($resql);
936 } else {
937  dol_print_error($db);
938 }
939 
940 // End of page
941 llxFooter();
942 $db->close();
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 standard extra fields.
Class to manage invoice templates.
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 building of HTML components.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
Definition: user.class.php:45
if(isModEnabled('facture') &&!empty($user->rights->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') &&!empty($user->rights->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)) $resql
Social contributions to pay.
Definition: index.php:745
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...
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
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.
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.
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.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
img_info($titlealt='default')
Show info logo.
$nbtotalofrecords
Count total nb of records.
Definition: list.php:329
restrictedArea(User $user, $features, $object=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.