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