dolibarr  19.0.0-dev
list-rec.php
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.'/fourn/class/fournisseur.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', 'suppliers'));
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_fourn_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', 'alpha');
101 $sortorder = GETPOST('sortorder', 'alpha');
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 FactureFournisseurRec($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('supplierinvoicereclist'));
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->hasRight('facture', 'creer'); // Used by the include of actions_setnotes.inc.php
134 $permissiondellink = $user->hasRight('facture', 'creer'); // Used by the include of actions_dellink.inc.php
135 $permissiontoedit = $user->hasRight('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  'suspended '=>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 $objecttype = 'facture_fourn_rec';
171 
172 $result = restrictedArea($user, 'facture', $object->id, $objecttype);
173 
174 
175 /*
176  * Actions
177  */
178 
179 if (GETPOST('cancel', 'alpha')) {
180  $action = 'list';
181  $massaction = '';
182 }
183 if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
184  $massaction = '';
185 }
186 
187 $parameters = array('socid' => $socid);
188 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
189 if ($reshook < 0) {
190  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
191 }
192 
193 if (empty($reshook)) {
194  if (GETPOST('cancel', 'alpha')) {
195  $action = '';
196  }
197 
198  // Selection of new fields
199  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
200 
201  // Do we click on purge search criteria ?
202  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
203  $search_ref = '';
204  $search_societe = '';
205  $search_montant_ht = '';
206  $search_montant_vat = '';
207  $search_montant_ttc = '';
208  $search_payment_mode = '';
209  $search_payment_term = '';
210  $search_date_startday = '';
211  $search_date_startmonth = '';
212  $search_date_startyear = '';
213  $search_date_endday = '';
214  $search_date_endmonth = '';
215  $search_date_endyear = '';
216  $search_date_start = '';
217  $search_date_end = '';
218  $search_date_when_startday = '';
219  $search_date_when_startmonth = '';
220  $search_date_when_startyear = '';
221  $search_date_when_endday = '';
222  $search_date_when_endmonth = '';
223  $search_date_when_endyear = '';
224  $search_date_when_start = '';
225  $search_date_when_end = '';
226  $search_recurring = '';
227  $search_frequency = '';
228  $search_unit_frequency = '';
229  $search_status = '';
230  $search_array_options = array();
231  }
232 
233  // Mass actions
234  /*$objectclass='MyObject';
235  $objectlabel='MyObject';
236  $permissiontoread = $user->hasRight("mymodule", "read");
237  $permissiontodelete = $user->hasRight("mymodule", "delete");
238  $uploaddir = $conf->mymodule->dir_output;
239  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/
240 }
241 
242 
243 /*
244  * View
245  */
246 
247 $help_url = '';
248 llxHeader('', $langs->trans("RepeatableSupplierInvoices"), $help_url);
249 
250 $form = new Form($db);
251 $formother = new FormOther($db);
252 if (isModEnabled('project')) {
253  $formproject = new FormProjets($db);
254 }
255 $companystatic = new Societe($db);
256 $supplierinvoicerectmp = new FactureFournisseurRec($db);
257 $tmpuser = new User($db);
258 
259 $now = dol_now();
260 $tmparray = dol_getdate($now);
261 $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); // Today is last second of current day
262 
263 
264 /*
265  * List mode
266  */
267 
268 $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,";
269 $sql .= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when, f.suspended,";
270 $sql .= " f.datec, f.fk_user_author, f.tms, f.fk_user_modif,";
271 $sql .= " f.fk_cond_reglement, f.fk_mode_reglement";
272 // Add fields from extrafields
273 if (!empty($extrafields->attributes[$object->table_element]['label'])) {
274  foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
275  $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
276  }
277 }
278 // Add fields from hooks
279 $parameters = array();
280 $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
281 $sql .= $hookmanager->resPrint;
282 $sql = preg_replace('/,\s*$/', '', $sql);
283 
284 $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn_rec as f';
285 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_rec_extrafields as ef ON ef.fk_object = f.rowid';
286 if (!$user->hasRight("societe", "client", "voir") && !$socid) {
287  $sql .= ', '.MAIN_DB_PREFIX.'societe_commerciaux as sc';
288 }
289 $sql .= ' WHERE f.fk_soc = s.rowid';
290 $sql .= ' AND f.entity IN ('.getEntity('invoice').')';
291 if (!$user->hasRight("societe", "client", "voir") && !$socid) {
292  $sql .= ' AND s.rowid = sc.fk_soc AND sc.fk_user = '. (int) $user->id;
293 }
294 if ($search_ref) {
295  $sql .= natural_search('f.titre', $search_ref);
296 }
297 if ($socid) {
298  $sql .= ' AND s.rowid = '.(int) $socid;
299 }
300 if ($search_societe) {
301  $sql .= natural_search('s.nom', $search_societe);
302 }
303 if ($search_montant_ht != '') {
304  $sql .= natural_search('f.total_ht', $search_montant_ht, 1);
305 }
306 if ($search_montant_vat != '') {
307  $sql .= natural_search('f.total_tva', $search_montant_vat, 1);
308 }
309 if ($search_montant_ttc != '') {
310  $sql .= natural_search('f.total_ttc', $search_montant_ttc, 1);
311 }
312 if (!empty($search_payment_mode) && $search_payment_mode != '-1') {
313  $sql .= natural_search('f.fk_mode_reglement', $search_payment_mode, 1);
314 }
315 if (!empty($search_payment_term) && $search_payment_term != '-1') {
316  $sql .= natural_search('f.fk_cond_reglement', $search_payment_term, 1);
317 }
318 if ($search_recurring == '1') {
319  $sql .= ' AND f.frequency > 0';
320 }
321 if ($search_recurring == '0') {
322  $sql .= ' AND (f.frequency IS NULL or f.frequency = 0)';
323 }
324 if ($search_frequency != '') {
325  $sql .= natural_search('f.frequency', $search_frequency, 1);
326 }
327 if ($search_unit_frequency != '') {
328  $sql .= ' AND f.frequency > 0'.natural_search('f.unit_frequency', $search_unit_frequency);
329 }
330 if ($search_status != '' && $search_status >= -1) {
331  if ($search_status == 0) {
332  $sql .= ' AND frequency = 0 AND suspended = 0';
333  }
334  if ($search_status == 1) {
335  $sql .= ' AND frequency != 0 AND suspended = 0';
336  }
337  if ($search_status == -1) {
338  $sql .= ' AND suspended = 1';
339  }
340 }
341 if ($search_date_start) {
342  $sql .= " AND f.date_last_gen >= '".$db->idate($search_date_start)."'";
343 }
344 if ($search_date_end) {
345  $sql .= " AND f.date_last_gen <= '".$db->idate($search_date_end)."'";
346 }
347 if ($search_date_when_start) {
348  $sql .= " AND f.date_when >= '".$db->idate($search_date_when_start)."'";
349 }
350 if ($search_date_when_end) {
351  $sql .= " AND f.date_when <= '".$db->idate($search_date_when_end)."'";
352 }
353 
354 $tmpsortfield = $sortfield;
355 if ($tmpsortfield == 'recurring') {
356  $tmpsortfield = 'f.frequency';
357 }
358 $sql .= $db->order($tmpsortfield, $sortorder);
359 
360 $nbtotalofrecords = '';
361 if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
362  $result = $db->query($sql);
363  $nbtotalofrecords = $db->num_rows($result);
364  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
365  $page = 0;
366  $offset = 0;
367  }
368 }
369 
370 $sql .= $db->plimit($limit + 1, $offset);
371 
372 $resql = $db->query($sql);
373 if ($resql) {
374  $num = $db->num_rows($resql);
375 
376  $param = '';
377  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
378  $param .= '&contextpage='.urlencode($contextpage);
379  }
380  if ($limit > 0 && $limit != $conf->liste_limit) {
381  $param .= '&limit='.((int) $limit);
382  }
383  if ($socid > 0) {
384  $param .= '&socid='.urlencode($socid);
385  }
386  if ($search_date_startday) {
387  $param .= '&search_date_startday='.urlencode($search_date_startday);
388  }
389  if ($search_date_startmonth) {
390  $param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
391  }
392  if ($search_date_startyear) {
393  $param .= '&search_date_startyear='.urlencode($search_date_startyear);
394  }
395  if ($search_date_endday) {
396  $param .= '&search_date_endday='.urlencode($search_date_endday);
397  }
398  if ($search_date_endmonth) {
399  $param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
400  }
401  if ($search_date_endyear) {
402  $param .= '&search_date_endyear='.urlencode($search_date_endyear);
403  }
404  if ($search_date_when_startday) {
405  $param .= '&search_date_when_startday='.urlencode($search_date_when_startday);
406  }
407  if ($search_date_when_startmonth) {
408  $param .= '&search_date_when_startmonth='.urlencode($search_date_when_startmonth);
409  }
410  if ($search_date_when_startyear) {
411  $param .= '&search_date_when_startyear='.urlencode($search_date_when_startyear);
412  }
413  if ($search_date_when_endday) {
414  $param .= '&search_date_when_endday='.urlencode($search_date_when_endday);
415  }
416  if ($search_date_when_endmonth) {
417  $param .= '&search_date_when_endmonth='.urlencode($search_date_when_endmonth);
418  }
419  if ($search_date_when_endyear) {
420  $param .= '&search_date_when_endyear='.urlencode($search_date_when_endyear);
421  }
422  if ($search_ref) {
423  $param .= '&search_ref='.urlencode($search_ref);
424  }
425  if ($search_societe) {
426  $param .= '&search_societe='.urlencode($search_societe);
427  }
428  if ($search_montant_ht != '') {
429  $param .= '&search_montant_ht='.urlencode($search_montant_ht);
430  }
431  if ($search_montant_vat != '') {
432  $param .= '&search_montant_vat='.urlencode($search_montant_vat);
433  }
434  if ($search_montant_ttc != '') {
435  $param .= '&search_montant_ttc='.urlencode($search_montant_ttc);
436  }
437  if ($search_payment_mode != '') {
438  $param .= '&search_payment_mode='.urlencode($search_payment_mode);
439  }
440  if ($search_payment_term != '') {
441  $param .= '&search_payment_term='.urlencode($search_payment_term);
442  }
443  if ($search_recurring != '' && $search_recurring != '-1') {
444  $param .= '&search_recurring='.urlencode($search_recurring);
445  }
446  if ($search_frequency > 0) {
447  $param .= '&search_frequency='.urlencode($search_frequency);
448  }
449  if ($search_unit_frequency != '') {
450  $param .= '&search_unit_frequency='.urlencode($search_unit_frequency);
451  }
452  if ($search_status != '') {
453  $param .= '&search_status='.urlencode($search_status);
454  }
455  if ($optioncss != '') {
456  $param .= '&optioncss='.urlencode($optioncss);
457  }
458  // Add $param from extra fields
459  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
460 
461  $massactionbutton = $form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
462 
463  $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
464  $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
465  //$selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
466 
467  print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
468  if ($optioncss != '') {
469  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
470  }
471  print '<input type="hidden" name="token" value="'.newToken().'">';
472  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
473  print '<input type="hidden" name="action" value="list">';
474  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
475  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
476  print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
477  print '<input type="hidden" name="search_status" value="'.$search_status.'">';
478 
479  $title = $langs->trans("RepeatableSupplierInvoices");
480 
481  print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bill', 0, '', '', $limit, 0, 0, 1);
482 
483  print '<span class="opacitymedium">'.$langs->trans("ToCreateAPredefinedSupplierInvoice", $langs->transnoentitiesnoconv("ChangeIntoRepeatableInvoice")).'</span><br><br>';
484 
485  $i = 0;
486 
487  $moreforfilter = '';
488 
489  print '<div class="div-table-responsive">';
490  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
491 
492  // Filters lines
493  print '<tr class="liste_titre_filter">';
494  // Ref
495  if (!empty($arrayfields['f.titre']['checked'])) {
496  print '<td class="liste_titre left">';
497  print '<input class="flat maxwidth100" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
498  print '</td>';
499  }
500  // Thirdparty
501  if (!empty($arrayfields['s.nom']['checked'])) {
502  print '<td class="liste_titre left"><input class="flat" type="text" size="8" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
503  }
504  if (!empty($arrayfields['f.total_ht']['checked'])) {
505  // Amount net
506  print '<td class="liste_titre right">';
507  print '<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'">';
508  print '</td>';
509  }
510  if (!empty($arrayfields['f.total_tva']['checked'])) {
511  // Amount Vat
512  print '<td class="liste_titre right">';
513  print '<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).'">';
514  print '</td>';
515  }
516  if (!empty($arrayfields['f.total_ttc']['checked'])) {
517  // Amount
518  print '<td class="liste_titre right">';
519  print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">';
520  print '</td>';
521  }
522  if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
523  // Payment term
524  print '<td class="liste_titre right">';
525  print $form->getSelectConditionsPaiements($search_payment_term, 'search_payment_term', -1, 1, 1, 'maxwidth100');
526  print "</td>";
527  }
528  if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
529  // Payment mode
530  print '<td class="liste_titre right">';
531  print $form->select_types_paiements($search_payment_mode, 'search_payment_mode', '', 0, 1, 1, 0, 1, 'maxwidth100', 1);
532  print '</td>';
533  }
534  if (!empty($arrayfields['recurring']['checked'])) {
535  // Recurring or not
536  print '<td class="liste_titre center">';
537  print $form->selectyesno('search_recurring', $search_recurring, 1, false, 1);
538  print '</td>';
539  }
540  if (!empty($arrayfields['f.frequency']['checked'])) {
541  // Recurring or not
542  print '<td class="liste_titre center">';
543  print '<input class="flat" type="text" size="1" name="search_frequency" value="'.dol_escape_htmltag($search_frequency).'">';
544  print '</td>';
545  }
546  if (!empty($arrayfields['f.unit_frequency']['checked'])) {
547  // Frequency unit
548  print '<td class="liste_titre center">';
549  print '<input class="flat" type="text" size="1" name="search_unit_frequency" value="'.dol_escape_htmltag($search_unit_frequency).'">';
550  print '</td>';
551  }
552  if (!empty($arrayfields['f.nb_gen_done']['checked'])) {
553  // Nb generation
554  print '<td class="liste_titre" align="center">';
555  print '</td>';
556  }
557  // Date invoice
558  if (!empty($arrayfields['f.date_last_gen']['checked'])) {
559  print '<td class="liste_titre center">';
560  print '<div class="nowrap">';
561  print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
562  print '</div>';
563  print '<div class="nowrap">';
564  print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
565  print '</div>';
566  print '</td>';
567  }
568  // Date next generation
569  if (!empty($arrayfields['f.date_when']['checked'])) {
570  print '<td class="liste_titre center">';
571  print '<div class="nowrap">';
572  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'));
573  print '</div>';
574  print '<div class="nowrap">';
575  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'));
576  print '</div>';
577  print '</td>';
578  }
579  // Extra fields
580  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
581 
582  // Fields from hook
583  $parameters = array('arrayfields'=>$arrayfields);
584  $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
585  print $hookmanager->resPrint;
586  // User creation
587  if (!empty($arrayfields['f.fk_user_author']['checked'])) {
588  print '<td class="liste_titre">';
589  print '</td>';
590  }
591  // User modification
592  if (!empty($arrayfields['f.fk_user_modif']['checked'])) {
593  print '<td class="liste_titre">';
594  print '</td>';
595  }
596  // Date creation
597  if (!empty($arrayfields['f.datec']['checked'])) {
598  print '<td class="liste_titre">';
599  print '</td>';
600  }
601  // Date modification
602  if (!empty($arrayfields['f.tms']['checked'])) {
603  print '<td class="liste_titre">';
604  print '</td>';
605  }
606  // Action column
607  print '<td class="liste_titre" align="middle">';
608  $searchpicto = $form->showFilterButtons();
609  print $searchpicto;
610  print '</td>';
611  print "</tr>\n";
612 
613  print '<tr class="liste_titre">';
614  if (!empty($arrayfields['f.titre']['checked'])) {
615  print_liste_field_titre($arrayfields['f.titre']['label'], $_SERVER['PHP_SELF'], "f.titre", "", $param, "", $sortfield, $sortorder);
616  }
617  if (!empty($arrayfields['s.nom']['checked'])) {
618  print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], "s.nom", "", $param, "", $sortfield, $sortorder);
619  }
620  if (!empty($arrayfields['f.total_ht']['checked'])) {
621  print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], "f.total_ht", "", $param, 'class="right"', $sortfield, $sortorder);
622  }
623  if (!empty($arrayfields['f.total_tva']['checked'])) {
624  print_liste_field_titre($arrayfields['f.total_tva']['label'], $_SERVER['PHP_SELF'], "f.total_tva", "", $param, 'class="right"', $sortfield, $sortorder);
625  }
626  if (!empty($arrayfields['f.total_ttc']['checked'])) {
627  print_liste_field_titre($arrayfields['f.total_ttc']['label'], $_SERVER['PHP_SELF'], "f.total_ttc", "", $param, 'class="right"', $sortfield, $sortorder);
628  }
629  if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
630  print_liste_field_titre($arrayfields['f.fk_cond_reglement']['label'], $_SERVER['PHP_SELF'], "f.fk_cond_reglement", "", $param, '', $sortfield, $sortorder);
631  }
632  if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
633  print_liste_field_titre($arrayfields['f.fk_mode_reglement']['label'], $_SERVER['PHP_SELF'], "f.fk_mode_reglement", "", $param, '', $sortfield, $sortorder);
634  }
635  if (!empty($arrayfields['recurring']['checked'])) {
636  print_liste_field_titre($arrayfields['recurring']['label'], $_SERVER['PHP_SELF'], "recurring", "", $param, 'class="center"', $sortfield, $sortorder);
637  }
638  if (!empty($arrayfields['f.frequency']['checked'])) {
639  print_liste_field_titre($arrayfields['f.frequency']['label'], $_SERVER['PHP_SELF'], "f.frequency", "", $param, 'align="center"', $sortfield, $sortorder);
640  }
641  if (!empty($arrayfields['f.unit_frequency']['checked'])) {
642  print_liste_field_titre($arrayfields['f.unit_frequency']['label'], $_SERVER['PHP_SELF'], "f.unit_frequency", "", $param, 'align="center"', $sortfield, $sortorder);
643  }
644  if (!empty($arrayfields['f.nb_gen_done']['checked'])) {
645  print_liste_field_titre($arrayfields['f.nb_gen_done']['label'], $_SERVER['PHP_SELF'], "f.nb_gen_done", "", $param, 'align="center"', $sortfield, $sortorder);
646  }
647  if (!empty($arrayfields['f.date_last_gen']['checked'])) {
648  print_liste_field_titre($arrayfields['f.date_last_gen']['label'], $_SERVER['PHP_SELF'], "f.date_last_gen", "", $param, 'align="center"', $sortfield, $sortorder);
649  }
650  if (!empty($arrayfields['f.date_when']['checked'])) {
651  print_liste_field_titre($arrayfields['f.date_when']['label'], $_SERVER['PHP_SELF'], "f.date_when", "", $param, 'align="center"', $sortfield, $sortorder);
652  }
653  if (!empty($arrayfields['f.fk_user_author']['checked'])) {
654  print_liste_field_titre($arrayfields['f.fk_user_author']['label'], $_SERVER['PHP_SELF'], "f.fk_user_author", "", $param, 'align="center"', $sortfield, $sortorder);
655  }
656  if (!empty($arrayfields['f.fk_user_modif']['checked'])) {
657  print_liste_field_titre($arrayfields['f.fk_user_modif']['label'], $_SERVER['PHP_SELF'], "f.fk_user_modif", "", $param, 'align="center"', $sortfield, $sortorder);
658  }
659  if (!empty($arrayfields['f.datec']['checked'])) {
660  print_liste_field_titre($arrayfields['f.datec']['label'], $_SERVER['PHP_SELF'], "f.datec", "", $param, 'align="center"', $sortfield, $sortorder);
661  }
662  if (!empty($arrayfields['f.tms']['checked'])) {
663  print_liste_field_titre($arrayfields['f.tms']['label'], $_SERVER['PHP_SELF'], "f.tms", "", $param, 'align="center"', $sortfield, $sortorder);
664  }
665  // Extra fields
666  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
667  if (!empty($arrayfields['status']['checked'])) {
668  print_liste_field_titre($arrayfields['status']['label'], $_SERVER['PHP_SELF'], "f.suspended,f.frequency", "", $param, 'align="center"', $sortfield, $sortorder);
669  }
670  print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'center maxwidthsearch ');
671  print "</tr>\n";
672 
673  if ($num > 0) {
674  $i = 0;
675  $totalarray = array();
676  $totalarray['nbfield'] = 0;
677  $totalarray['val']['f.total_ht'] = 0;
678  $totalarray['val']['f.total_tva'] = 0;
679  $totalarray['val']['f.total_ttc'] = 0;
680  while ($i < min($num, $limit)) {
681  $objp = $db->fetch_object($resql);
682  if (empty($objp)) {
683  break;
684  }
685 
686  $companystatic->id = $objp->socid;
687  $companystatic->name = $objp->name;
688 
689  $supplierinvoicerectmp->id = !empty($objp->id) ? $objp->id : $objp->facid;
690  $supplierinvoicerectmp->frequency = $objp->frequency;
691  $supplierinvoicerectmp->suspended = $objp->suspended;
692  $supplierinvoicerectmp->unit_frequency = $objp->unit_frequency;
693  $supplierinvoicerectmp->nb_gen_max = $objp->nb_gen_max;
694  $supplierinvoicerectmp->nb_gen_done = $objp->nb_gen_done;
695  $supplierinvoicerectmp->ref = $objp->title;
696  $supplierinvoicerectmp->total_ht = $objp->total_ht;
697  $supplierinvoicerectmp->total_tva = $objp->total_tva;
698  $supplierinvoicerectmp->total_ttc = $objp->total_ttc;
699 
700  print '<tr class="oddeven">';
701 
702  if (!empty($arrayfields['f.titre']['checked'])) {
703  print '<td class="nowrap tdoverflowmax200">';
704  print $supplierinvoicerectmp->getNomUrl(1);
705  print "</a>";
706  print "</td>\n";
707  if (!$i) {
708  $totalarray['nbfield']++;
709  }
710  }
711  if (!empty($arrayfields['s.nom']['checked'])) {
712  print '<td class="tdoverflowmax200">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
713  if (!$i) {
714  $totalarray['nbfield']++;
715  }
716  }
717  if (!empty($arrayfields['f.total_ht']['checked'])) {
718  print '<td class="nowrap right amount">'.price($objp->total_ht).'</td>'."\n";
719  if (!$i) {
720  $totalarray['nbfield']++;
721  }
722  if (!$i) {
723  $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ht';
724  }
725  $totalarray['val']['f.total_ht'] += $objp->total_ht;
726  }
727  if (!empty($arrayfields['f.total_tva']['checked'])) {
728  print '<td class="nowrap right amount">'.price($objp->total_tva).'</td>'."\n";
729  if (!$i) {
730  $totalarray['nbfield']++;
731  }
732  if (!$i) {
733  $totalarray['pos'][$totalarray['nbfield']] = 'f.total_tva';
734  }
735  $totalarray['val']['f.total_tva'] += $objp->total_tva;
736  }
737  if (!empty($arrayfields['f.total_ttc']['checked'])) {
738  print '<td class="nowrap right amount">'.price($objp->total_ttc).'</td>'."\n";
739  if (!$i) {
740  $totalarray['nbfield']++;
741  }
742  if (!$i) {
743  $totalarray['pos'][$totalarray['nbfield']] = 'f.total_ttc';
744  }
745  $totalarray['val']['f.total_ttc'] += $objp->total_ttc;
746  }
747  // Payment term
748  if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
749  print '<td class="right">';
750  $form->form_conditions_reglement('', $objp->fk_cond_reglement, 'none');
751  print '</td>'."\n";
752  if (!$i) {
753  $totalarray['nbfield']++;
754  }
755  }
756  // Payment mode
757  if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
758  print '<td class="right">';
759  $form->form_modes_reglement('', $objp->fk_mode_reglement, 'none');
760  print '</td>'."\n";
761  if (!$i) {
762  $totalarray['nbfield']++;
763  }
764  }
765  // Is it a recurring invoice
766  if (!empty($arrayfields['recurring']['checked'])) {
767  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>';
768  if (!$i) {
769  $totalarray['nbfield']++;
770  }
771  }
772  if (!empty($arrayfields['f.frequency']['checked'])) {
773  print '<td class="center">'.($objp->frequency > 0 ? $objp->frequency : '').'</td>';
774  if (!$i) {
775  $totalarray['nbfield']++;
776  }
777  }
778  if (!empty($arrayfields['f.unit_frequency']['checked'])) {
779  print '<td class="center">'.($objp->frequency > 0 ? $objp->unit_frequency : '').'</td>';
780  if (!$i) {
781  $totalarray['nbfield']++;
782  }
783  }
784  if (!empty($arrayfields['f.nb_gen_done']['checked'])) {
785  print '<td class="center">';
786  print ($objp->frequency > 0 ? $objp->nb_gen_done.($objp->nb_gen_max > 0 ? ' / '.$objp->nb_gen_max : '') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
787  print '</td>';
788  if (!$i) {
789  $totalarray['nbfield']++;
790  }
791  }
792  // Date last generation
793  if (!empty($arrayfields['f.date_last_gen']['checked'])) {
794  print '<td class="center">';
795  print ($objp->frequency > 0 ? dol_print_date($db->jdate($objp->date_last_gen), 'day') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
796  print '</td>';
797  if (!$i) {
798  $totalarray['nbfield']++;
799  }
800  }
801  // Date next generation
802  if (!empty($arrayfields['f.date_when']['checked'])) {
803  print '<td class="center">';
804  print '<div class="nowraponall">';
805  print ($objp->frequency ? ($supplierinvoicerectmp->isMaxNbGenReached() ? '<strike>' : '').dol_print_date($db->jdate($objp->date_when), 'day').($supplierinvoicerectmp->isMaxNbGenReached() ? '</strike>' : '') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
806  if (!$supplierinvoicerectmp->isMaxNbGenReached()) {
807  if (!$objp->suspended && $objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) {
808  print img_warning($langs->trans("Late"));
809  }
810  } else {
811  print img_info($langs->trans("MaxNumberOfGenerationReached"));
812  }
813  print '</div>';
814  print '</td>';
815  if (!$i) {
816  $totalarray['nbfield']++;
817  }
818  }
819  if (!empty($arrayfields['f.fk_user_author']['checked'])) {
820  print '<td class="center tdoverflowmax150">';
821  if ($objp->fk_user_author > 0) {
822  $tmpuser->fetch($objp->fk_user_author);
823  print $tmpuser->getNomUrl(1);
824  }
825  print '</td>';
826  if (!$i) {
827  $totalarray['nbfield']++;
828  }
829  }
830  if (!empty($arrayfields['f.fk_user_modif']['checked'])) {
831  print '<td class="center tdoverflowmax150">';
832  if ($objp->fk_user_author > 0) {
833  $tmpuser->fetch($objp->fk_user_author);
834  print $tmpuser->getNomUrl(1);
835  }
836  print '</td>';
837  if (!$i) {
838  $totalarray['nbfield']++;
839  }
840  }
841  if (!empty($arrayfields['f.datec']['checked'])) {
842  print '<td class="center">';
843  print dol_print_date($db->jdate($objp->datec), 'dayhour');
844  print '</td>';
845  if (!$i) {
846  $totalarray['nbfield']++;
847  }
848  }
849  if (!empty($arrayfields['f.tms']['checked'])) {
850  print '<td class="center">';
851  print dol_print_date($db->jdate($objp->tms), 'dayhour');
852  print '</td>';
853  if (!$i) {
854  $totalarray['nbfield']++;
855  }
856  }
857 
858  $obj = $objp;
859  // Extra fields
860  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
861  // Fields from hook
862  $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray);
863  $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
864  print $hookmanager->resPrint;
865  // Status
866  if (!empty($arrayfields['status']['checked'])) {
867  print '<td class="center">';
868  print $supplierinvoicerectmp->getLibStatut(3, 0);
869  print '</td>';
870  if (!$i) {
871  $totalarray['nbfield']++;
872  }
873  }
874  // Action column
875  print '<td class="center tdoverflowmax125">';
876  if ($user->hasRight('facture', 'creer') && empty($supplierinvoicerectmp->suspended)) {
877  if ($supplierinvoicerectmp->isMaxNbGenReached()) {
878  print $langs->trans("MaxNumberOfGenerationReached");
879  } elseif (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) {
880  print '<a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&amp;socid='.$objp->socid.'&amp;fac_rec='.$objp->facid.'">';
881  print img_picto($langs->trans("CreateBill"), 'add', 'class="paddingrightonly"');
882  print $langs->trans("CreateBill").'</a>';
883  } else {
884  print $form->textwithpicto('', $langs->trans("DateIsNotEnough"));
885  }
886  } else {
887  print "&nbsp;";
888  }
889  if (!$i) {
890  $totalarray['nbfield']++;
891  }
892  print "</td>";
893 
894  print "</tr>\n";
895 
896  $i++;
897  }
898  } else {
899  $colspan = 1;
900  foreach ($arrayfields as $key => $val) {
901  if (!empty($val['checked'])) {
902  $colspan++;
903  }
904  }
905  print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
906  }
907 
908  // Show total line
909  include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
910 
911 
912  print "</table>";
913  print "</div>";
914  print "</form>";
915 
916  $db->free($resql);
917 } else {
918  dol_print_error($db);
919 }
920 
921 // End of page
922 llxFooter();
923 $db->close();
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:118
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:48
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
Definition: index.php:746
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
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...
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.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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.
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.