dolibarr 21.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'); // 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 {
232 dol_print_error($db);
233 }
234
235 if (($page * $limit) > $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) {
250 dol_print_error($db);
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, getDolGlobalString('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 (getDolGlobalString('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 (!getDolGlobalString('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 (getDolGlobalString('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 (!getDolGlobalString('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->statut = $obj->status;
420 $bon->date_echeance = $obj->datec;
421 $bon->total = $obj->amount;
422
423 $object = $bon;
424 if ($object->checkIfSalaryBonPrelevement()) {
425 $fullname = explode(' ', $obj->name);
426
427 $userstatic->id = $obj->socid;
428 $userstatic->email = $obj->email;
429 $userstatic->firstname = $fullname[0];
430 $userstatic->lastname = isset($fullname[1]) ? $fullname[1] : '';
431 }
432
433 $company->id = $obj->socid;
434 $company->name = $obj->name;
435 $company->email = $obj->email;
436 $company->code_client = $obj->code_client;
437
438 if ($mode == 'kanban') {
439 if ($i == 0) {
440 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
441 print '<div class="box-flex-container kanban">';
442 }
443 // Output Kanban
444 $selected = -1;
445 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
446 $selected = 0;
447 if (in_array($object->id, $arrayofselected)) {
448 $selected = 1;
449 }
450 }
451 print $object->getKanbanView('', array('selected' => $selected));
452 if ($i == ($imaxinloop - 1)) {
453 print '</div>';
454 print '</td></tr>';
455 }
456 } else {
457 // Show line of result
458 $j = 0;
459 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
460
461 // Action column
462 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
463 print '<td class="nowrap center">';
464 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
465 $selected = 0;
466 if (in_array($object->id, $arrayofselected)) {
467 $selected = 1;
468 }
469 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
470 }
471 print '</td>';
472 if (!$i) {
473 $totalarray['nbfield']++;
474 }
475 }
476 print '<td>';
477 print $bon->getNomUrl(1);
478 print "</td>\n";
479
480 print '<td>';
481 print $line->LibStatut($obj->statut_ligne, 2);
482 print "&nbsp;";
483 print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">';
484 print substr('000000'.$obj->rowid_ligne, -6);
485 print '</a></td>';
486
487 // Ref invoice or salary
488 print '<td class="nowraponall">';
489 $link_to_bill = '/compta/facture/card.php?facid=';
490 $link_title = 'Invoice';
491 $link_picto = 'bill';
492 if ($type == 'bank-transfer') {
493 if ($bon->checkIfSalaryBonPrelevement()) {
494 $link_to_bill = '/salaries/card.php?id=';
495 $link_title = 'SalaryInvoice';
496 $link_picto = 'salary';
497 } else {
498 $link_to_bill = '/fourn/facture/card.php?facid=';
499 $link_title = 'SupplierInvoice';
500 $link_picto = 'supplier_invoice';
501 }
502 }
503 print '<a href="'.DOL_URL_ROOT.$link_to_bill.$obj->facid.'">';
504 print img_object($langs->trans($link_title), $link_picto);
505 if (!$bon->checkIfSalaryBonPrelevement()) {
506 print '&nbsp;'.$obj->invoiceref."</td>\n";
507 } else {
508 print '&nbsp;'.(!empty($obj->invoiceref) ? $obj->invoiceref : $obj->facid)."</td>\n";
509 }
510 print '</a>';
511 print '</td>';
512
513 // Thirdparty (company or user)
514 print '<td class="tdoverflowmax150">';
515 print(!$bon->checkIfSalaryBonPrelevement() ? $company->getNomUrl(1) : $userstatic->getNomUrl(-1));
516 print "</td>\n";
517
518 print '<td class="center">';
519 $link_to_tab = '/comm/card.php?socid=';
520 $link_code = $obj->code_client;
521 if ($type == 'bank-transfer') {
522 $link_to_tab = '/fourn/card.php?socid=';
523 $link_code = $obj->code_fournisseur;
524 }
525 print '<a href="'.DOL_URL_ROOT.$link_to_tab.$company->id.'">'.$link_code."</a>";
526 print "</td>\n";
527
528 print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
529
530 print '<td class="nowraponall right"><span class="amount">'.price($obj->amount)."</span></td>\n";
531
532 // Action column
533 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
534 print '<td class="nowrap center">';
535 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
536 $selected = 0;
537 if (in_array($object->id, $arrayofselected)) {
538 $selected = 1;
539 }
540 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
541 }
542 print '</td>';
543 if (!$i) {
544 $totalarray['nbfield']++;
545 }
546 }
547
548 print '</tr>'."\n";
549 }
550 $i++;
551}
552
553if ($num == 0) {
554 print '<tr><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
555}
556
557$db->free($resql);
558
559$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
560$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
561print $hookmanager->resPrint;
562
563print '</table>'."\n";
564print '</div>'."\n";
565
566print '</form>'."\n";
567
568
569// End of page
570llxFooter();
571$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
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:71
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.
llxFooter()
Footer empty.
Definition document.php:107
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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.
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 a 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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
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.