dolibarr 24.0.0-beta
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-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
7 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
29// Load Dolibarr environment
30require '../../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
32require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
33require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
34
43// Load translation files required by the page
44$langs->loadLangs(array('banks', 'withdrawals', 'companies', 'categories'));
45
46$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
47$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
48$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
49$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
50$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
51$toselect = GETPOST('toselect', 'array:int'); // Array of ids of elements selected into a list
52$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlinelist'; // To manage different context of search
53$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
54$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
55$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
56
57$type = GETPOST('type', 'aZ09');
58
59// Load variable for pagination
60$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
61$sortfield = GETPOST('sortfield', 'aZ09comma');
62$sortorder = GETPOST('sortorder', 'aZ09comma');
63$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
64if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
65 // If $page is not defined, or '' or -1 or if we click on clear filters
66 $page = 0;
67}
68$offset = $limit * $page;
69$pageprev = $page - 1;
70$pagenext = $page + 1;
71if (!$sortorder) {
72 $sortorder = "DESC";
73}
74if (!$sortfield) {
75 $sortfield = ($type == 'bank-transfer' ? "datec" : "p.datec");
76}
77
78$search_line = GETPOST('search_line', 'alpha');
79$search_bon = GETPOST('search_bon', 'alpha');
80$search_code = GETPOST('search_code', 'alpha');
81$search_company = GETPOST('search_company', 'alpha');
82$statut = GETPOSTINT('statut');
83
84$bon = new BonPrelevement($db);
85$line = new LignePrelevement($db);
86$company = new Societe($db);
87$userstatic = new User($db);
88
89$hookmanager->initHooks(array('withdrawalsreceiptslineslist'));
90
91// Security check
92$socid = GETPOSTINT('socid');
93if ($user->socid) {
94 $socid = $user->socid;
95}
96if ($type == 'bank-transfer') {
97 $result = restrictedArea($user, 'paymentbybanktransfer', '', '', '');
98} else {
99 $result = restrictedArea($user, 'prelevement', '', '', 'bons');
100}
101
102
103/*
104 * Actions
105 */
106
107if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
108 $search_line = "";
109 $search_bon = "";
110 $search_code = "";
111 $search_company = "";
112 $statut = "";
113}
114
115
116/*
117 * View
118 */
119
120$form = new Form($db);
121
122$title = $langs->trans("WithdrawalsLines");
123if ($type == 'bank-transfer') {
124 $title = $langs->trans("CreditTransferLines");
125}
126$help_url = '';
127
128$sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec";
129$sql .= " , f.rowid as facid, f.ref as invoiceref, f.total_ttc";
130$sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.email";
131$sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
132
133$sqlfields = $sql; // $sql fields to remove for count total
134
135$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
136$sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
137$sql .= " , ".MAIN_DB_PREFIX."prelevement as pf";
138if ($type == 'bank-transfer') {
139 $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f";
140} else {
141 $sql .= " , ".MAIN_DB_PREFIX."facture as f";
142}
143$sql .= " , ".MAIN_DB_PREFIX."societe as s";
144$sql .= " WHERE pl.fk_prelevement_bons = p.rowid";
145$sql .= " AND pf.fk_prelevement_lignes = pl.rowid";
146if ($type == 'bank-transfer') {
147 $sql .= " AND pf.fk_facture_fourn = f.rowid";
148} else {
149 $sql .= " AND pf.fk_facture = f.rowid";
150}
151$sql .= " AND f.fk_soc = s.rowid";
152$sql .= " AND f.entity IN (".getEntity('invoice').")";
153if ($socid) {
154 $sql .= " AND s.rowid = ".((int) $socid);
155}
156if ($search_bon) {
157 $sql .= " AND pl.rowid = '".$db->escape($search_bon)."'";
158}
159if ($search_line) {
160 $sql .= natural_search("p.ref", $search_line);
161}
162if ($type == 'bank-transfer') {
163 if ($search_code) {
164 $sql .= natural_search("s.code_fournisseur", $search_code);
165 }
166} else {
167 if ($search_code) {
168 $sql .= natural_search("s.code_client", $search_code);
169 }
170}
171if ($search_company) {
172 $sql .= natural_search("s.nom", $search_company);
173}
174//get salary invoices
175if ($type == 'bank-transfer') {
176 $sql .= " UNION";
177
178 $sql .= " SELECT p.rowid, p.ref, p.statut as status, p.datec";
179 $sql .= ", sl.rowid as facid, sl.ref as invoiceref, sl.amount";
180 $sql .= ", u.rowid as socid, CONCAT(u.firstname, ' ', u.lastname) as name, u.ref_employee as code_client, NULL as code_fournisseur, u.email";
181 $sql .= ", pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
182
183 $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
184 $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
185 $sql .= " , ".MAIN_DB_PREFIX."prelevement as pf";
186 $sql .= " , ".MAIN_DB_PREFIX."salary as sl";
187 $sql .= " , ".MAIN_DB_PREFIX."user as u";
188
189 $sql .= " WHERE pl.fk_prelevement_bons = p.rowid";
190 $sql .= " AND pf.fk_prelevement_lignes = pl.rowid";
191 $sql .= " AND pf.fk_salary = sl.rowid";
192 $sql .= " AND sl.fk_user = u.rowid";
193 $sql .= " AND sl.entity IN (".getEntity('invoice').")";
194 if ($socid) {
195 $sql .= " AND s.rowid = ".((int) $socid);
196 }
197 if ($search_bon) {
198 $sql .= " AND pl.rowid = '".$db->escape($search_bon)."'";
199 }
200 if ($search_line) {
201 $sql .= natural_search("p.ref", $search_line);
202 }
203 if ($type == 'bank-transfer') {
204 if ($search_code) {
205 $sql .= natural_search("NULL", $search_code);
206 }
207 } else {
208 if ($search_code) {
209 $sql .= natural_search("s.code_client", $search_code);
210 }
211 }
212 if ($search_company) {
213 $sql .= natural_search(array("u.firstname","u.lastname"), $search_company);
214 }
215}
216// Count total nb of records
217$nbtotalofrecords = '';
218if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
219 /* The fast and low memory method to get and count full list converts the sql into a sql count */
220 if ($type == 'bank-transfer') {
221 $sqlforcount = "SELECT COUNT(*) as nbtotalofrecords FROM (" . $sql . ") AS combined_results";
222 } else {
223 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
224 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
225 }
226
227 $resql = $db->query($sqlforcount);
228 if ($resql) {
229 $objforcount = $db->fetch_object($resql);
230 $nbtotalofrecords = $objforcount->nbtotalofrecords;
231 } else {
233 }
234
235 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
236 $page = 0;
237 $offset = 0;
238 }
239 $db->free($resql);
240}
241
242// Complete request and execute it with limit
243$sql .= $db->order($sortfield, $sortorder);
244if ($limit) {
245 $sql .= $db->plimit($limit + 1, $offset);
246}
247
248$resql = $db->query($sql);
249if (!$resql) {
251 exit;
252}
253
254$num = $db->num_rows($resql);
255
256// Output page
257// --------------------------------------------------------------------
258
259llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist');
260
261$arrayofselected = is_array($toselect) ? $toselect : array();
262
263$param = '';
264$param .= "&statut=".urlencode($statut);
265$param .= "&search_bon=".urlencode($search_bon);
266if ($type == 'bank-transfer') {
267 $param .= '&type=bank-transfer';
268}
269if (!empty($mode)) {
270 $param .= '&mode='.urlencode($mode);
271}
272if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
273 $param .= '&contextpage='.urlencode($contextpage);
274}
275if ($limit > 0 && $limit != $conf->liste_limit) {
276 $param .= '&limit='.((int) $limit);
277}
278if ($optioncss != '') {
279 $param .= '&optioncss='.urlencode($optioncss);
280}
281
282$arrayofmassactions = array(
283 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
284 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
285);
286$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
287
288print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
289print '<input type="hidden" name="token" value="'.newToken().'">';
290if ($optioncss != '') {
291 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
292}
293print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
294print '<input type="hidden" name="action" value="list">';
295print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
296print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
297print '<input type="hidden" name="page" value="'.$page.'">';
298print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
299print '<input type="hidden" name="page_y" value="">';
300print '<input type="hidden" name="mode" value="'.$mode.'">';
301
302if ($type != '') {
303 print '<input type="hidden" name="type" value="'.$type.'">';
304}
305
306$newcardbutton = '';
307$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'));
308$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'));
309
310print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
311
312$moreforfilter = '';
313/*$moreforfilter.='<div class="divsearchfield">';
314 $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
315 $moreforfilter.= '</div>';*/
316
317$parameters = array();
318$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
319if (empty($reshook)) {
320 $moreforfilter .= $hookmanager->resPrint;
321} else {
322 $moreforfilter = $hookmanager->resPrint;
323}
324
325if (!empty($moreforfilter)) {
326 print '<div class="liste_titre liste_titre_bydiv centpercent">';
327 print $moreforfilter;
328 print '</div>';
329}
330
331$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
332$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup
333$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
334$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
335
336print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
337print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
338
339// Fields title search
340// --------------------------------------------------------------------
341print '<tr class="liste_titre_filter">';
342// Action column
343if ($conf->main_checkbox_left_column) {
344 print '<td class="liste_titre center maxwidthsearch">';
345 $searchpicto = $form->showFilterButtons('left');
346 print $searchpicto;
347 print '</td>';
348}
349print '<td class="liste_titre"><input type="text" class="flat" name="search_line" value="'.dol_escape_htmltag($search_line).'" size="6"></td>';
350print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'.dol_escape_htmltag($search_bon).'" size="6"></td>';
351print '<td class="liste_titre">&nbsp;</td>';
352print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'.dol_escape_htmltag($search_company).'" size="6"></td>';
353print '<td class="liste_titre center"><input type="text" class="flat" name="search_code" value="'.dol_escape_htmltag($search_code).'" size="6"></td>';
354print '<td class="liste_titre">&nbsp;</td>';
355print '<td class="liste_titre">&nbsp;</td>';
356// Action column
357if (!$conf->main_checkbox_left_column) {
358 print '<td class="liste_titre center maxwidthsearch">';
359 $searchpicto = $form->showFilterButtons();
360 print $searchpicto;
361 print '</td>';
362}
363print '</tr>'."\n";
364
365$totalarray = array();
366$totalarray['nbfield'] = 0;
367
368$columntitle = "WithdrawalsReceipts";
369$columntitlethirdparty = "CustomerCode";
370$columncodethirdparty = "s.code_client";
371if ($type == 'bank-transfer') {
372 $columntitle = "BankTransferReceipts";
373 $columntitlethirdparty = "SupplierCode";
374 $columncodethirdparty = "s.code_fournisseur";
375}
376
377// Fields title label
378// --------------------------------------------------------------------
379print '<tr class="liste_titre">';
380// Action column
381if ($conf->main_checkbox_left_column) {
382 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
383 $totalarray['nbfield']++;
384}
385print_liste_field_titre($columntitle, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
386$totalarray['nbfield']++;
387print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
388$totalarray['nbfield']++;
389print_liste_field_titre(($type == 'bank-transfer' ? "BillsAndSalaries" : "Bills"), $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder);
390$totalarray['nbfield']++;
391print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
392$totalarray['nbfield']++;
393print_liste_field_titre($columntitlethirdparty, $_SERVER["PHP_SELF"], $columncodethirdparty, '', $param, '', $sortfield, $sortorder, 'center ');
394$totalarray['nbfield']++;
395print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
396$totalarray['nbfield']++;
397print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right ');
398$totalarray['nbfield']++;
399// Action column
400if (!$conf->main_checkbox_left_column) {
401 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
402 $totalarray['nbfield']++;
403}
404print '</tr>'."\n";
405
406// Loop on record
407// --------------------------------------------------------------------
408$i = 0;
409$savnbfield = $totalarray['nbfield'];
410$totalarray = array();
411$totalarray['nbfield'] = 0;
412
413$imaxinloop = ($limit ? min($num, $limit) : $num);
414while ($i < $imaxinloop) {
415 $obj = $db->fetch_object($resql);
416
417 $bon->id = $obj->rowid;
418 $bon->ref = $obj->ref;
419 $bon->date_creation = $db->jdate($obj->datec);
420 $bon->date_tans = $db->jdate($obj->date_trans);
421 $bon->date_credit = $db->jdate($obj->date_credit);
422 $bon->amount = $obj->amount;
423 $bon->status = $obj->status;
424
425 $object = $bon;
426 if ($object->checkIfSalaryBonPrelevement()) {
427 $fullname = explode(' ', $obj->name);
428
429 $userstatic->id = $obj->socid;
430 $userstatic->email = $obj->email;
431 $userstatic->firstname = $fullname[0];
432 $userstatic->lastname = isset($fullname[1]) ? $fullname[1] : '';
433 }
434
435 $company->id = $obj->socid;
436 $company->name = $obj->name;
437 $company->email = $obj->email;
438 $company->code_client = $obj->code_client;
439
440 if ($mode == 'kanban') {
441 if ($i == 0) {
442 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
443 print '<div class="box-flex-container kanban">';
444 }
445 // Output Kanban
446 $selected = -1;
447 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
448 $selected = 0;
449 if (in_array($object->id, $arrayofselected)) {
450 $selected = 1;
451 }
452 }
453 print $object->getKanbanView('', array('selected' => $selected));
454 if ($i == ($imaxinloop - 1)) {
455 print '</div>';
456 print '</td></tr>';
457 }
458 } else {
459 // Show line of result
460 $j = 0;
461 print '<tr data-rowid="'.$object->id.'" class="oddeven row-with-select">';
462
463 // Action column
464 if ($conf->main_checkbox_left_column) {
465 print '<td class="nowrap center">';
466 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
467 $selected = 0;
468 if (in_array($object->id, $arrayofselected)) {
469 $selected = 1;
470 }
471 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
472 }
473 print '</td>';
474 if (!$i) {
475 $totalarray['nbfield']++;
476 }
477 }
478 print '<td>';
479 print $bon->getNomUrl(1);
480 print "</td>\n";
481
482 print '<td>';
483 print $line->LibStatut($obj->statut_ligne, 2);
484 print "&nbsp;";
485 print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.($type == 'bank-transfer' ? '&type=bank-transfer' : '').'">';
486 print substr('000000'.$obj->rowid_ligne, -6);
487 print '</a></td>';
488
489 // Ref invoice or salary
490 print '<td class="nowraponall">';
491 $link_to_bill = '/compta/facture/card.php?facid=';
492 $link_title = 'Invoice';
493 $link_picto = 'bill';
494 if ($type == 'bank-transfer') {
495 if ($bon->checkIfSalaryBonPrelevement()) {
496 $link_to_bill = '/salaries/card.php?id=';
497 $link_title = 'SalaryInvoice';
498 $link_picto = 'salary';
499 } else {
500 $link_to_bill = '/fourn/facture/card.php?facid=';
501 $link_title = 'SupplierInvoice';
502 $link_picto = 'supplier_invoice';
503 }
504 }
505 print '<a href="'.DOL_URL_ROOT.$link_to_bill.$obj->facid.'">';
506 print img_object($langs->trans($link_title), $link_picto);
507 if (!$bon->checkIfSalaryBonPrelevement()) {
508 print '&nbsp;'.$obj->invoiceref."</td>\n";
509 } else {
510 print '&nbsp;'.(!empty($obj->invoiceref) ? $obj->invoiceref : $obj->facid)."</td>\n";
511 }
512 print '</a>';
513 print '</td>';
514
515 // Thirdparty (company or user)
516 print '<td class="tdoverflowmax150">';
517 print(!$bon->checkIfSalaryBonPrelevement() ? $company->getNomUrl(1) : $userstatic->getNomUrl(-1));
518 print "</td>\n";
519
520 print '<td class="center">';
521 $link_to_tab = '/comm/card.php?socid=';
522 $link_code = $obj->code_client;
523 if ($type == 'bank-transfer') {
524 $link_to_tab = '/fourn/card.php?socid=';
525 $link_code = $obj->code_fournisseur;
526 }
527 print '<a href="'.DOL_URL_ROOT.$link_to_tab.$company->id.'">'.$link_code."</a>";
528 print "</td>\n";
529
530 print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
531
532 print '<td class="nowraponall right"><span class="amount">'.price($obj->amount)."</span></td>\n";
533
534 // Action column
535 if (!$conf->main_checkbox_left_column) {
536 print '<td class="nowrap center">';
537 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
538 $selected = 0;
539 if (in_array($object->id, $arrayofselected)) {
540 $selected = 1;
541 }
542 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
543 }
544 print '</td>';
545 if (!$i) {
546 $totalarray['nbfield']++;
547 }
548 }
549
550 print '</tr>'."\n";
551 }
552 $i++;
553}
554
555if ($num == 0) {
556 print '<tr><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
557}
558
559$db->free($resql);
560
561$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
562$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
563print $hookmanager->resPrint;
564
565print '</table>'."\n";
566print '</div>'."\n";
567
568print '</form>'."\n";
569
570
571// End of page
572llxFooter();
573$db->close();
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
$totalarray
Definition list.php:497
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
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...)
Class to manage Dolibarr users.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.