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