dolibarr  19.0.0-dev
list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
6  * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
28 // Load Dolibarr environment
29 require '../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
33 
34 // Load translation files required by the page
35 $langs->loadLangs(array('banks', 'withdrawals', 'companies', 'categories'));
36 
37 $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
38 $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
39 $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
40 $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
41 $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
42 $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
43 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlinelist'; // To manage different context of search
44 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
45 $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
46 $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
47 
48 $type = GETPOST('type', 'aZ09');
49 
50 // Load variable for pagination
51 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
52 $sortfield = GETPOST('sortfield', 'aZ09comma');
53 $sortorder = GETPOST('sortorder', 'aZ09comma');
54 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
55 if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
56  // If $page is not defined, or '' or -1 or if we click on clear filters
57  $page = 0;
58 }
59 $offset = $limit * $page;
60 $pageprev = $page - 1;
61 $pagenext = $page + 1;
62 if (!$sortorder) {
63  $sortorder = "DESC";
64 }
65 if (!$sortfield) {
66  $sortfield = "p.datec";
67 }
68 
69 $search_line = GETPOST('search_line', 'alpha');
70 $search_bon = GETPOST('search_bon', 'alpha');
71 $search_code = GETPOST('search_code', 'alpha');
72 $search_company = GETPOST('search_company', 'alpha');
73 $statut = GETPOST('statut', 'int');
74 
75 $bon = new BonPrelevement($db);
76 $line = new LignePrelevement($db);
77 $company = new Societe($db);
78 
79 $hookmanager->initHooks(array('withdrawalsreceiptslineslist'));
80 
81 // Security check
82 $socid = GETPOST('socid', 'int');
83 if ($user->socid) {
84  $socid = $user->socid;
85 }
86 if ($type == 'bank-transfer') {
87  $result = restrictedArea($user, 'paymentbybanktransfer', '', '', '');
88 } else {
89  $result = restrictedArea($user, 'prelevement', '', '', 'bons');
90 }
91 
92 
93 /*
94  * Actions
95  */
96 
97 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
98  $search_line = "";
99  $search_bon = "";
100  $search_code = "";
101  $search_company = "";
102  $statut = "";
103 }
104 
105 
106 /*
107  * View
108  */
109 
110 $form = new Form($db);
111 
112 $title = $langs->trans("WithdrawalsLines");
113 if ($type == 'bank-transfer') {
114  $title = $langs->trans("CreditTransferLines");
115 }
116 $help_url = '';
117 
118 $sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec";
119 $sql .= " , f.rowid as facid, f.ref as invoiceref, f.total_ttc";
120 $sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.email";
121 $sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
122 
123 $sqlfields = $sql; // $sql fields to remove for count total
124 
125 $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
126 $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
127 $sql .= " , ".MAIN_DB_PREFIX."prelevement as pf";
128 if ($type == 'bank-transfer') {
129  $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f";
130 } else {
131  $sql .= " , ".MAIN_DB_PREFIX."facture as f";
132 }
133 $sql .= " , ".MAIN_DB_PREFIX."societe as s";
134 $sql .= " WHERE pl.fk_prelevement_bons = p.rowid";
135 $sql .= " AND pf.fk_prelevement_lignes = pl.rowid";
136 if ($type == 'bank-transfer') {
137  $sql .= " AND pf.fk_facture_fourn = f.rowid";
138 } else {
139  $sql .= " AND pf.fk_facture = f.rowid";
140 }
141 $sql .= " AND f.fk_soc = s.rowid";
142 $sql .= " AND f.entity IN (".getEntity('invoice').")";
143 if ($socid) {
144  $sql .= " AND s.rowid = ".((int) $socid);
145 }
146 if ($search_line) {
147  $sql .= " AND pl.rowid = '".$db->escape($search_line)."'";
148 }
149 if ($search_bon) {
150  $sql .= natural_search("p.ref", $search_bon);
151 }
152 if ($type == 'bank-transfer') {
153  if ($search_code) {
154  $sql .= natural_search("s.code_fournisseur", $search_code);
155  }
156 } else {
157  if ($search_code) {
158  $sql .= natural_search("s.code_client", $search_code);
159  }
160 }
161 if ($search_company) {
162  $sql .= natural_search("s.nom", $search_company);
163 }
164 
165 // Count total nb of records
166 $nbtotalofrecords = '';
167 if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
168  /* The fast and low memory method to get and count full list converts the sql into a sql count */
169  $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
170  $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
171  $resql = $db->query($sqlforcount);
172  if ($resql) {
173  $objforcount = $db->fetch_object($resql);
174  $nbtotalofrecords = $objforcount->nbtotalofrecords;
175  } else {
176  dol_print_error($db);
177  }
178 
179  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
180  $page = 0;
181  $offset = 0;
182  }
183  $db->free($resql);
184 }
185 
186 // Complete request and execute it with limit
187 $sql .= $db->order($sortfield, $sortorder);
188 if ($limit) {
189  $sql .= $db->plimit($limit + 1, $offset);
190 }
191 
192 $resql = $db->query($sql);
193 if (!$resql) {
194  dol_print_error($db);
195  exit;
196 }
197 
198 $num = $db->num_rows($resql);
199 
200 // Output page
201 // --------------------------------------------------------------------
202 
203 llxHeader('', $title, $help_url);
204 
205 $arrayofselected = is_array($toselect) ? $toselect : array();
206 
207 $param = '';
208 $param .= "&statut=".urlencode($statut);
209 $param .= "&search_bon=".urlencode($search_bon);
210 if ($type == 'bank-transfer') {
211  $param .= '&type=bank-transfer';
212 }
213 if (!empty($mode)) {
214  $param .= '&mode='.urlencode($mode);
215 }
216 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
217  $param .= '&contextpage='.urlencode($contextpage);
218 }
219 if ($limit > 0 && $limit != $conf->liste_limit) {
220  $param .= '&limit='.((int) $limit);
221 }
222 if ($optioncss != '') {
223  $param .= '&optioncss='.urlencode($optioncss);
224 }
225 
226 $arrayofmassactions = array(
227  //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
228  //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
229 );
230 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
231 
232 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
233 print '<input type="hidden" name="token" value="'.newToken().'">';
234 if ($optioncss != '') {
235  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
236 }
237 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
238 print '<input type="hidden" name="action" value="list">';
239 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
240 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
241 print '<input type="hidden" name="page" value="'.$page.'">';
242 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
243 print '<input type="hidden" name="page_y" value="">';
244 print '<input type="hidden" name="mode" value="'.$mode.'">';
245 
246 if ($type != '') {
247  print '<input type="hidden" name="type" value="'.$type.'">';
248 }
249 
250 $newcardbutton = '';
251 $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
252 $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
253 
254 print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
255 
256 $moreforfilter = '';
257 /*$moreforfilter.='<div class="divsearchfield">';
258  $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
259  $moreforfilter.= '</div>';*/
260 
261 $parameters = array();
262 $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
263 if (empty($reshook)) {
264  $moreforfilter .= $hookmanager->resPrint;
265 } else {
266  $moreforfilter = $hookmanager->resPrint;
267 }
268 
269 if (!empty($moreforfilter)) {
270  print '<div class="liste_titre liste_titre_bydiv centpercent">';
271  print $moreforfilter;
272  $parameters = array();
273  $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
274  print $hookmanager->resPrint;
275  print '</div>';
276 }
277 
278 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
279 $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
280 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
281 
282 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
283 print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
284 
285 // Fields title search
286 // --------------------------------------------------------------------
287 print '<tr class="liste_titre_filter">';
288 // Action column
289 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
290  print '<td class="liste_titre center maxwidthsearch">';
291  $searchpicto = $form->showFilterButtons('left');
292  print $searchpicto;
293  print '</td>';
294 }
295 print '<td class="liste_titre"><input type="text" class="flat" name="search_line" value="'.dol_escape_htmltag($search_line).'" size="6"></td>';
296 print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'.dol_escape_htmltag($search_bon).'" size="6"></td>';
297 print '<td class="liste_titre">&nbsp;</td>';
298 print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'.dol_escape_htmltag($search_company).'" size="6"></td>';
299 print '<td class="liste_titre center"><input type="text" class="flat" name="search_code" value="'.dol_escape_htmltag($search_code).'" size="6"></td>';
300 print '<td class="liste_titre">&nbsp;</td>';
301 print '<td class="liste_titre">&nbsp;</td>';
302 // Action column
303 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
304  print '<td class="liste_titre center maxwidthsearch">';
305  $searchpicto = $form->showFilterButtons();
306  print $searchpicto;
307  print '</td>';
308 }
309 print '</tr>'."\n";
310 
311 $totalarray = array();
312 $totalarray['nbfield'] = 0;
313 
314 $columntitle = "WithdrawalsReceipts";
315 $columntitlethirdparty = "CustomerCode";
316 $columncodethirdparty = "s.code_client";
317 if ($type == 'bank-transfer') {
318  $columntitle = "BankTransferReceipts";
319  $columntitlethirdparty = "SupplierCode";
320  $columncodethirdparty = "s.code_fournisseur";
321 }
322 
323 // Fields title label
324 // --------------------------------------------------------------------
325 print '<tr class="liste_titre">';
326 // Action column
327 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
328  print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
329  $totalarray['nbfield']++;
330 }
331 print_liste_field_titre($columntitle, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
332 $totalarray['nbfield']++;
333 print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
334 $totalarray['nbfield']++;
335 print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder);
336 $totalarray['nbfield']++;
337 print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
338 $totalarray['nbfield']++;
339 print_liste_field_titre($columntitlethirdparty, $_SERVER["PHP_SELF"], $columncodethirdparty, '', $param, '', $sortfield, $sortorder, 'center ');
340 $totalarray['nbfield']++;
341 print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
342 $totalarray['nbfield']++;
343 print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right ');
344 $totalarray['nbfield']++;
345 // Action column
346 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
347  print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
348  $totalarray['nbfield']++;
349 }
350 print '</tr>'."\n";
351 
352 // Loop on record
353 // --------------------------------------------------------------------
354 $i = 0;
355 $savnbfield = $totalarray['nbfield'];
356 $totalarray = array();
357 $totalarray['nbfield'] = 0;
358 
359 $imaxinloop = ($limit ? min($num, $limit) : $num);
360 while ($i < $imaxinloop) {
361  $obj = $db->fetch_object($resql);
362 
363  $bon->id = $obj->rowid;
364  $bon->ref = $obj->ref;
365  $bon->statut = $obj->status;
366  $bon->date_echeance = $obj->datec;
367  $bon->total = $obj->amount;
368 
369  $object = $bon;
370 
371  $company->id = $obj->socid;
372  $company->name = $obj->name;
373  $company->email = $obj->email;
374  $company->code_client = $obj->code_client;
375 
376  if ($mode == 'kanban') {
377  if ($i == 0) {
378  print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
379  print '<div class="box-flex-container kanban">';
380  }
381  // Output Kanban
382  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
383  $selected = 0;
384  if (in_array($object->id, $arrayofselected)) {
385  $selected = 1;
386  }
387  }
388  print $object->getKanbanView('', array('selected' => in_array($bon->id, $arrayofselected)));
389  if ($i == ($imaxinloop - 1)) {
390  print '</div>';
391  print '</td></tr>';
392  }
393  } else {
394  // Show line of result
395  $j = 0;
396  print '<tr data-rowid="'.$object->id.'" class="oddeven">';
397 
398  // Action column
399  if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
400  print '<td class="nowrap center">';
401  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
402  $selected = 0;
403  if (in_array($object->id, $arrayofselected)) {
404  $selected = 1;
405  }
406  print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
407  }
408  print '</td>';
409  if (!$i) {
410  $totalarray['nbfield']++;
411  }
412  }
413  print '<td>';
414  print $bon->getNomUrl(1);
415  print "</td>\n";
416 
417  print '<td>';
418  print $line->LibStatut($obj->statut_ligne, 2);
419  print "&nbsp;";
420  print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">';
421  print substr('000000'.$obj->rowid_ligne, -6);
422  print '</a></td>';
423 
424  print '<td>';
425  $link_to_bill = '/compta/facture/card.php?facid=';
426  $link_title = 'Invoice';
427  $link_picto = 'bill';
428  if ($type == 'bank-transfer') {
429  $link_to_bill = '/fourn/facture/card.php?facid=';
430  $link_title = 'SupplierInvoice';
431  $link_picto = 'supplier_invoice';
432  }
433  print '<a href="'.DOL_URL_ROOT.$link_to_bill.$obj->facid.'">';
434  print img_object($langs->trans($link_title), $link_picto);
435  print '&nbsp;'.$obj->invoiceref."</td>\n";
436  print '</a>';
437  print '</td>';
438 
439  print '<td>';
440  print $company->getNomUrl(1);
441  print "</td>\n";
442 
443 
444  print '<td class="center">';
445  $link_to_tab = '/comm/card.php?socid=';
446  $link_code = $obj->code_client;
447  if ($type == 'bank-transfer') {
448  $link_to_tab = '/fourn/card.php?socid=';
449  $link_code = $obj->code_fournisseur;
450  }
451  print '<a href="'.DOL_URL_ROOT.$link_to_tab.$company->id.'">'.$link_code."</a></td>\n";
452 
453  print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
454 
455  print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>\n";
456 
457  // Action column
458  if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
459  print '<td class="nowrap center">';
460  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
461  $selected = 0;
462  if (in_array($object->id, $arrayofselected)) {
463  $selected = 1;
464  }
465  print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
466  }
467  print '</td>';
468  if (!$i) {
469  $totalarray['nbfield']++;
470  }
471  }
472 
473  print '</tr>'."\n";
474  }
475  $i++;
476 }
477 
478 if ($num == 0) {
479  print '<tr><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
480 }
481 
482 $db->free($result);
483 
484 $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
485 $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
486 print $hookmanager->resPrint;
487 
488 print '</table>'."\n";
489 print '</div>'."\n";
490 
491 print '</form>'."\n";
492 
493 
494 // End of page
495 llxFooter();
496 $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 withdrawal receipts.
Class to manage generation of HTML components Only common components must be here.
Class to manage withdrawals.
Class to manage third parties objects (customers, suppliers, prospects...)
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_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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...
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get 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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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.