38require
'../../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/expensereport/class/paymentexpensereport.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
46$langs->loadLangs(array(
'trips',
'bills',
'banks',
'compta'));
48$action =
GETPOST(
'action',
'alpha');
49$massaction =
GETPOST(
'massaction',
'alpha');
50$optioncss =
GETPOST(
'optioncss',
'alpha');
51$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'vendorpaymentlist';
52$mode =
GETPOST(
'mode',
'alpha');
58 $socid = $user->socid;
61$search_ref =
GETPOST(
'search_ref',
'alpha');
62$search_date_startday =
GETPOSTINT(
'search_date_startday');
63$search_date_startmonth =
GETPOSTINT(
'search_date_startmonth');
64$search_date_startyear =
GETPOSTINT(
'search_date_startyear');
65$search_date_endday =
GETPOSTINT(
'search_date_endday');
66$search_date_endmonth =
GETPOSTINT(
'search_date_endmonth');
67$search_date_endyear =
GETPOSTINT(
'search_date_endyear');
68$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
69$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
70$search_user =
GETPOST(
'search_user',
'alpha');
71$search_payment_type =
GETPOST(
'search_payment_type');
72$search_cheque_num =
GETPOST(
'search_cheque_num',
'alpha');
73$search_bank_account =
GETPOST(
'search_bank_account',
'int');
74$search_amount =
GETPOST(
'search_amount',
'alpha');
77$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
78$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
80if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
84$offset = $limit * $page;
92 $sortfield =
"pndf.datep";
95$search_all = trim(GETPOSTISSET(
"search_all") ?
GETPOST(
"search_all",
'alpha') :
GETPOST(
'sall'));
98$fieldstosearchall = array(
99 'pndf.rowid' =>
"RefPayment",
101 'pndf.num_payment' =>
"Numero",
102 'pndf.amount' =>
"Amount",
106 'pndf.rowid' => array(
'label' =>
"RefPayment",
'checked' => 1,
'position' => 10),
107 'pndf.datep' => array(
'label' =>
"Date",
'checked' => 1,
'position' => 20),
108 'u.login' => array(
'label' =>
"User",
'checked' => 1,
'position' => 30),
109 'c.libelle' => array(
'label' =>
"Type",
'checked' => 1,
'position' => 40),
110 'pndf.num_payment' => array(
'label' =>
"Numero",
'checked' => 1,
'position' => 50,
'tooltip' =>
"ChequeOrTransferNumber"),
111 'ba.label' => array(
'label' =>
"BankAccount",
'checked' => 1,
'position' => 60,
'enable' => (isModEnabled(
"bank"))),
112 'pndf.amount' => array(
'label' =>
"Amount",
'checked' => 1,
'position' => 70),
115'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
118$hookmanager->initHooks(array(
'paymentexpensereportlist'));
123 $socid = $user->socid;
132if (!$user->hasRight(
'expensereport',
'lire')) {
141$childids = $user->getAllChildIds(1);
143$parameters = array(
'socid' => $socid);
144$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
149if (empty($reshook)) {
151 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
154 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
156 $search_date_startday =
'';
157 $search_date_startmonth =
'';
158 $search_date_startyear =
'';
159 $search_date_endday =
'';
160 $search_date_endmonth =
'';
161 $search_date_endyear =
'';
162 $search_date_start =
'';
163 $search_date_end =
'';
165 $search_payment_type =
'';
166 $search_cheque_num =
'';
167 $search_bank_account =
'';
176$form =
new Form($db);
178$accountstatic =
new Account($db);
179$userstatic =
new User($db);
182$title = $langs->trans(
'ListPayment');
186$sql =
'SELECT pndf.rowid, pndf.rowid as ref, pndf.datep, pndf.amount as pamount, pndf.num_payment';
187$sql .=
', u.rowid as userid, u.login, u.email, u.lastname, u.firstname, u.photo';
188$sql .=
', c.code as paiement_type, c.libelle as paiement_libelle';
189$sql .=
', ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.fk_accountancy_journal as accountancy_journal';
190$sql .=
', SUM(pndf.amount)';
192$parameters = array();
193$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
194$sql .= $hookmanager->resPrint;
195$sql = preg_replace(
'/,\s*$/',
'', $sql);
199$sql .=
' FROM '.MAIN_DB_PREFIX.
'payment_expensereport AS pndf';
200$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'expensereport AS ndf ON ndf.rowid=pndf.fk_expensereport';
201$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_paiement AS c ON pndf.fk_typepayment = c.id';
202$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON u.rowid = ndf.fk_user_author';
203$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank as b ON pndf.fk_bank = b.rowid';
204$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank_account as ba ON b.fk_account = ba.rowid';
205$sql .=
' WHERE ndf.entity IN ('.getEntity(
"expensereport").
')';
208if (!$user->hasRight(
'expensereport',
'readall') && !$user->hasRight(
'expensereport',
'lire_tous')
209 && (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') || !$user->hasRight(
'expensereport',
'writeall_advance'))) {
210 $sql .=
" AND ndf.fk_user_author IN (".$db->sanitize(implode(
',', $childids)).
")\n";
216if ($search_date_start) {
217 $sql .=
" AND pndf.datep >= '" . $db->idate($search_date_start) .
"'";
219if ($search_date_end) {
220 $sql .=
" AND pndf.datep <= '" . $db->idate($search_date_end) .
"'";
224 $sql .=
natural_search(array(
'u.login',
'u.lastname',
'u.firstname'), $search_user);
226if ($search_payment_type !=
'') {
227 $sql .=
" AND c.code = '".$db->escape($search_payment_type).
"'";
229if ($search_cheque_num !=
'') {
235if ($search_bank_account > 0) {
236 $sql .=
' AND b.fk_account = '.((int) $search_bank_account);
239 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
243include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
245$parameters = array();
246$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
247$sql .= $hookmanager->resPrint;
249$sql .=
' GROUP BY pndf.rowid, pndf.datep, pndf.amount, pndf.num_payment, u.rowid, u.login, u.email, u.lastname, u.firstname, u.photo, c.code, c.libelle,';
250$sql .=
' ba.rowid, ba.ref, ba.label, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.fk_accountancy_journal';
253$nbtotalofrecords =
'';
256 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
257 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
259 $resql = $db->query($sqlforcount);
261 $objforcount = $db->fetch_object($resql);
262 $nbtotalofrecords = $objforcount->nbtotalofrecords;
267 if (($page * $limit) > $nbtotalofrecords) {
275$sql .= $db->order($sortfield, $sortorder);
277 $sql .= $db->plimit($limit + 1, $offset);
280$resql = $db->query($sql);
286$num = $db->num_rows($resql);
294llxHeader(
'', $title,
'',
'', 0, 0,
'',
'',
'',
'bodyforlist');
296$arrayofselected = is_array($toselect) ? $toselect : array();
300 $param .=
'&mode='.urlencode($mode);
302if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
303 $param .=
'&contextpage='.urlencode($contextpage);
305if ($limit > 0 && $limit != $conf->liste_limit) {
306 $param .=
'&limit='.((int) $limit);
308if ($optioncss !=
'') {
309 $param .=
'&optioncss='.urlencode($optioncss);
313 $param .=
'&search_ref='.urlencode($search_ref);
315if ($search_date_startday) {
316 $param .=
'&search_date_startday='.urlencode((
string) ($search_date_startday));
318if ($search_date_startmonth) {
319 $param .=
'&search_date_startmonth='.urlencode((
string) ($search_date_startmonth));
321if ($search_date_startyear) {
322 $param .=
'&search_date_startyear='.urlencode((
string) ($search_date_startyear));
324if ($search_date_endday) {
325 $param .=
'&search_date_endday='.urlencode((
string) ($search_date_endday));
327if ($search_date_endmonth) {
328 $param .=
'&search_date_endmonth='.urlencode((
string) ($search_date_endmonth));
330if ($search_date_endyear) {
331 $param .=
'&search_date_endyear='.urlencode((
string) ($search_date_endyear));
334 $param .=
'&search_user='.urlencode($search_user);
336if ($search_payment_type) {
337 $param .=
'&search_payment_type='.urlencode($search_payment_type);
339if ($search_cheque_num) {
340 $param .=
'&search_cheque_num='.urlencode($search_cheque_num);
343 $param .=
'&search_amount='.urlencode($search_amount);
345if ($search_bank_account) {
346 $param .=
'&search_bank_account='.urlencode((
string) ($search_bank_account));
350include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
352$parameters = array(
'param' => &$param);
353$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
354$param .= $hookmanager->resPrint;
357$arrayofmassactions = array(
364if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
365 $arrayofmassactions = array();
367$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
369print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
370if ($optioncss !=
'') {
371 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
373print
'<input type="hidden" name="token" value="'.newToken().
'">';
374print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
375print
'<input type="hidden" name="action" value="list">';
376print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
377print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
378print
'<input type="hidden" name="page" value="'.$page.
'">';
379print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
380print
'<input type="hidden" name="page_y" value="">';
381print
'<input type="hidden" name="mode" value="'.$mode.
'">';
384$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'));
385$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'));
388print_barre_liste($langs->trans(
'ExpenseReportPayments'), $page, $_SERVER[
'PHP_SELF'], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'expensereport', 0, $newcardbutton,
'', $limit, 0, 0, 1);
392 foreach ($fieldstosearchall as $key => $val) {
393 $fieldstosearchall[$key] = $langs->trans($val);
394 $setupstring .= $key.
"=".$val.
";";
396 print
'<!-- Search done like if EXPENSEREPORT_PAYMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
397 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
402$parameters = array();
403$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
404if (empty($reshook)) {
405 $moreforfilter .= $hookmanager->resPrint;
407 $moreforfilter = $hookmanager->resPrint;
410if (!empty($moreforfilter)) {
411 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
412 print $moreforfilter;
416$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
417$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
418$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
419$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
421print
'<div class="div-table-responsive">';
422print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
'').
'">';
426print
'<tr class="liste_titre_filter">';
430 print
'<td class="liste_titre center maxwidthsearch">';
431 $searchpicto = $form->showFilterButtons(
'left');
437if (!empty($arrayfields[
'pndf.rowid'][
'checked'])) {
438 print
'<td class="liste_titre left">';
439 print
'<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
444if (!empty($arrayfields[
'pndf.datep'][
'checked'])) {
445 print
'<td class="liste_titre center">';
446 print
'<div class="nowrapfordate">';
447 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
449 print
'<div class="nowrapfordate">';
450 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
456if (!empty($arrayfields[
'u.login'][
'checked'])) {
457 print
'<td class="liste_titre">';
458 print
'<input class="flat width75" type="text" name="search_user" value="'.dol_escape_htmltag($search_user).
'">';
463if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
464 print
'<td class="liste_titre">';
465 $form->select_types_paiements($search_payment_type,
'search_payment_type',
'', 2, 1, 1);
470if (!empty($arrayfields[
'pndf.num_payment'][
'checked'])) {
471 print
'<td class="liste_titre">';
472 print
'<input class="flat" type="text" size="4" name="search_cheque_num" value="'.dol_escape_htmltag($search_cheque_num).
'">';
477if (!empty($arrayfields[
'ba.label'][
'checked'])) {
478 print
'<td class="liste_titre">';
479 $form->select_comptes($search_bank_account,
'search_bank_account', 0,
'', 1);
484if (!empty($arrayfields[
'pndf.amount'][
'checked'])) {
485 print
'<td class="liste_titre right">';
486 print
'<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'">';
491$parameters = array(
'arrayfields' => $arrayfields);
492$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
493print $hookmanager->resPrint;
497 print
'<td class="liste_titre center maxwidthsearch">';
498 $searchpicto = $form->showFilterButtons();
505$totalarray = array();
506$totalarray[
'nbfield'] = 0;
510print
'<tr class="liste_titre">';
513 print_liste_field_titre($selectedfields, $_SERVER[
'PHP_SELF'],
'',
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
514 $totalarray[
'nbfield']++;
516if (!empty($arrayfields[
'i'][
'checked'])) {
518 $totalarray[
'nbfield']++;
520if (!empty($arrayfields[
'pndf.rowid'][
'checked'])) {
522 print_liste_field_titre($arrayfields[
'pndf.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'pndf.rowid',
'', $param,
'', $sortfield, $sortorder);
523 $totalarray[
'nbfield']++;
525if (!empty($arrayfields[
'pndf.datep'][
'checked'])) {
526 print_liste_field_titre($arrayfields[
'pndf.datep'][
'label'], $_SERVER[
"PHP_SELF"],
'pndf.datep',
'', $param,
'', $sortfield, $sortorder,
'center ');
527 $totalarray[
'nbfield']++;
529if (!empty($arrayfields[
'u.login'][
'checked'])) {
530 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.lastname',
'', $param,
'', $sortfield, $sortorder);
531 $totalarray[
'nbfield']++;
533if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
534 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
'c.libelle',
'', $param,
'', $sortfield, $sortorder);
535 $totalarray[
'nbfield']++;
537if (!empty($arrayfields[
'pndf.num_payment'][
'checked'])) {
538 print_liste_field_titre($arrayfields[
'pndf.num_payment'][
'label'], $_SERVER[
"PHP_SELF"],
"pndf.num_payment",
'', $param,
'', $sortfield, $sortorder,
'', $arrayfields[
'pndf.num_payment'][
'tooltip']);
539 $totalarray[
'nbfield']++;
541if (!empty($arrayfields[
'ba.label'][
'checked'])) {
542 print_liste_field_titre($arrayfields[
'ba.label'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
543 $totalarray[
'nbfield']++;
545if (!empty($arrayfields[
'pndf.amount'][
'checked'])) {
546 print_liste_field_titre($arrayfields[
'pndf.amount'][
'label'], $_SERVER[
"PHP_SELF"],
'pndf.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
547 $totalarray[
'nbfield']++;
551$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
552$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
553print $hookmanager->resPrint;
556 print_liste_field_titre($selectedfields, $_SERVER[
'PHP_SELF'],
'',
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
557 $totalarray[
'nbfield']++;
562foreach ($arrayfields as $column) {
563 if ($column[
'checked']) {
571$savnbfield = $totalarray[
'nbfield'];
572$totalarray = array();
573$totalarray[
'nbfield'] = 0;
574$imaxinloop = ($limit ? min($num, $limit) : $num);
575while ($i < $imaxinloop) {
576 $objp = $db->fetch_object($resql);
581 $paymentexpensereportstatic->id = $objp->rowid;
582 $paymentexpensereportstatic->ref = $objp->ref;
583 $paymentexpensereportstatic->datep = $db->jdate($objp->datep);
584 $paymentexpensereportstatic->amount = $objp->pamount;
585 $paymentexpensereportstatic->fk_typepayment = $objp->paiement_type;
588 $accountstatic->fetch($objp->bid);
589 $paymentexpensereportstatic->fk_bank = $accountstatic->id;
591 $paymentexpensereportstatic->fk_bank = 0;
594 $userstatic->id = $objp->userid;
595 $userstatic->lastname = $objp->lastname;
596 $userstatic->firstname = $objp->firstname;
597 $userstatic->login = $objp->login;
598 $userstatic->email = $objp->email;
599 $userstatic->photo = $objp->photo;
601 if ($mode ==
'kanban') {
603 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
604 print
'<div class="box-flex-container kanban">';
607 print $paymentexpensereportstatic->getKanbanView(
'', array(
'selected' => in_array($objp->id, $arrayofselected)));
608 if ($i == ($imaxinloop - 1)) {
615 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
619 print
'<td class="nowrap center">';
620 if ($massactionbutton || $massaction) {
622 if (in_array(
$object->id, $arrayofselected)) {
625 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
629 $totalarray[
'nbfield']++;
634 if (!empty($arrayfields[
'i'][
'checked'])) {
635 print
'<td>#'.(($offset * $limit) + $i).
'</td>';
637 $totalarray[
'nbfield']++;
642 if (!empty($arrayfields[
'pndf.rowid'][
'checked'])) {
643 print
'<td class="nowrap">'.$paymentexpensereportstatic->getNomUrl(1).
'</td>';
645 $totalarray[
'nbfield']++;
650 if (!empty($arrayfields[
'pndf.datep'][
'checked'])) {
651 $dateformatforpayment =
'dayhour';
652 print
'<td class="nowrap center">'.dol_print_date($db->jdate($objp->datep), $dateformatforpayment).
'</td>';
654 $totalarray[
'nbfield']++;
659 if (!empty($arrayfields[
'u.login'][
'checked'])) {
661 if ($userstatic->id > 0) {
662 print $userstatic->getNomUrl(-1);
666 $totalarray[
'nbfield']++;
671 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
672 $payment_type = $langs->trans(
"PaymentType".$objp->paiement_type) !=
"PaymentType".$objp->paiement_type ? $langs->trans(
"PaymentType".$objp->paiement_type) : $objp->paiement_libelle;
673 print
'<td>'.$payment_type.
' '.
dol_trunc($objp->num_payment, 32).
'</td>';
675 $totalarray[
'nbfield']++;
680 if (!empty($arrayfields[
'pndf.num_payment'][
'checked'])) {
681 print
'<td>'.$objp->num_payment.
'</td>';
683 $totalarray[
'nbfield']++;
688 if (!empty($arrayfields[
'ba.label'][
'checked'])) {
691 $accountstatic->id = $objp->bid;
692 $accountstatic->ref = $objp->bref;
693 $accountstatic->label = $objp->blabel;
694 $accountstatic->number = $objp->number;
695 $accountstatic->iban = $objp->iban_prefix;
696 $accountstatic->bic = $objp->bic;
697 $accountstatic->currency_code = $objp->currency_code;
698 $accountstatic->account_number = $objp->account_number;
701 $accountingjournal->fetch($objp->accountancy_journal);
702 $accountstatic->accountancy_journal = $accountingjournal->code;
704 print $accountstatic->getNomUrl(1);
710 $totalarray[
'nbfield']++;
715 if (!empty($arrayfields[
'pndf.amount'][
'checked'])) {
716 print
'<td class="right"><span class="amount">'.price($objp->pamount).
'</span></td>';
718 $totalarray[
'nbfield']++;
720 $totalarray[
'pos'][$checkedCount] =
'amount';
721 if (empty($totalarray[
'val'][
'amount'])) {
722 $totalarray[
'val'][
'amount'] = $objp->pamount;
724 $totalarray[
'val'][
'amount'] += $objp->pamount;
730 print
'<td class="nowrap center">';
731 if ($massactionbutton || $massaction) {
733 if (in_array(
$object->id, $arrayofselected)) {
736 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
740 $totalarray[
'nbfield']++;
751include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
756 foreach ($arrayfields as $key => $val) {
757 if (!empty($val[
'checked'])) {
761 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
766$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
767$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
768print $hookmanager->resPrint;
770print
'</table>'.
"\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
Class to manage bank accounts.
Class to manage accounting journals.
Class to manage payments of expense report.
Class to manage Dolibarr users.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $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, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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...
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.