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