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';
54$langs->loadLangs(array(
'trips',
'bills',
'banks',
'compta'));
56$action =
GETPOST(
'action',
'alpha');
57$massaction =
GETPOST(
'massaction',
'alpha');
58$optioncss =
GETPOST(
'optioncss',
'alpha');
59$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'vendorpaymentlist';
60$mode =
GETPOST(
'mode',
'alpha');
66 $socid = $user->socid;
69$search_ref =
GETPOST(
'search_ref',
'alpha');
70$search_date_startday =
GETPOSTINT(
'search_date_startday');
71$search_date_startmonth =
GETPOSTINT(
'search_date_startmonth');
72$search_date_startyear =
GETPOSTINT(
'search_date_startyear');
73$search_date_endday =
GETPOSTINT(
'search_date_endday');
74$search_date_endmonth =
GETPOSTINT(
'search_date_endmonth');
75$search_date_endyear =
GETPOSTINT(
'search_date_endyear');
76$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
77$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
78$search_user =
GETPOST(
'search_user',
'alpha');
79$search_payment_type =
GETPOST(
'search_payment_type');
80$search_cheque_num =
GETPOST(
'search_cheque_num',
'alpha');
81$search_bank_account =
GETPOST(
'search_bank_account',
'int');
82$search_amount =
GETPOST(
'search_amount',
'alpha');
85$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
86$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
88if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
92$offset = $limit * $page;
100 $sortfield =
"pndf.datep";
103$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
106$fieldstosearchall = array(
107 'pndf.rowid' =>
"RefPayment",
109 'pndf.num_payment' =>
"Numero",
110 'pndf.amount' =>
"Amount",
114 'pndf.rowid' => array(
'label' =>
"RefPayment",
'checked' => 1,
'position' => 10),
115 'pndf.datep' => array(
'label' =>
"Date",
'checked' => 1,
'position' => 20),
116 'u.login' => array(
'label' =>
"User",
'checked' => 1,
'position' => 30),
117 'c.libelle' => array(
'label' =>
"Type",
'checked' => 1,
'position' => 40),
118 'pndf.num_payment' => array(
'label' =>
"Numero",
'checked' => 1,
'position' => 50,
'tooltip' =>
"ChequeOrTransferNumber"),
119 'ba.label' => array(
'label' =>
"BankAccount",
'checked' => 1,
'position' => 60,
'enable' => (isModEnabled(
"bank"))),
120 'pndf.amount' => array(
'label' =>
"Amount",
'checked' => 1,
'position' => 70),
123'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
126$hookmanager->initHooks(array(
'paymentexpensereportlist'));
131 $socid = $user->socid;
140if (!$user->hasRight(
'expensereport',
'lire')) {
149$childids = $user->getAllChildIds(1);
151$parameters = array(
'socid' => $socid);
152$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
157if (empty($reshook)) {
159 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
162 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
164 $search_date_startday =
'';
165 $search_date_startmonth =
'';
166 $search_date_startyear =
'';
167 $search_date_endday =
'';
168 $search_date_endmonth =
'';
169 $search_date_endyear =
'';
170 $search_date_start =
'';
171 $search_date_end =
'';
173 $search_payment_type =
'';
174 $search_cheque_num =
'';
175 $search_bank_account =
'';
184$form =
new Form($db);
186$accountstatic =
new Account($db);
187$userstatic =
new User($db);
190$title = $langs->trans(
'ListPayment');
194$sql =
'SELECT pndf.rowid, pndf.rowid as ref, pndf.datep, pndf.amount as pamount, pndf.num_payment';
195$sql .=
', u.rowid as userid, u.login, u.email, u.lastname, u.firstname, u.photo';
196$sql .=
', c.code as paiement_type, c.libelle as paiement_libelle';
197$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';
198$sql .=
', SUM(pndf.amount)';
200$parameters = array();
201$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
202$sql .= $hookmanager->resPrint;
203$sql = preg_replace(
'/,\s*$/',
'', $sql);
207$sql .=
' FROM '.MAIN_DB_PREFIX.
'payment_expensereport AS pndf';
208$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'expensereport AS ndf ON ndf.rowid=pndf.fk_expensereport';
209$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_paiement AS c ON pndf.fk_typepayment = c.id';
210$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON u.rowid = ndf.fk_user_author';
211$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank as b ON pndf.fk_bank = b.rowid';
212$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank_account as ba ON b.fk_account = ba.rowid';
213$sql .=
' WHERE ndf.entity IN ('.getEntity(
"expensereport").
')';
216if (!$user->hasRight(
'expensereport',
'readall') && !$user->hasRight(
'expensereport',
'lire_tous')
217 && (!
getDolGlobalString(
'MAIN_USE_ADVANCED_PERMS') || !$user->hasRight(
'expensereport',
'writeall_advance'))) {
218 $sql .=
" AND ndf.fk_user_author IN (".$db->sanitize(implode(
',', $childids)).
")\n";
224if ($search_date_start) {
225 $sql .=
" AND pndf.datep >= '" . $db->idate($search_date_start) .
"'";
227if ($search_date_end) {
228 $sql .=
" AND pndf.datep <= '" . $db->idate($search_date_end) .
"'";
232 $sql .=
natural_search(array(
'u.login',
'u.lastname',
'u.firstname'), $search_user);
234if ($search_payment_type !=
'') {
235 $sql .=
" AND c.code = '".$db->escape($search_payment_type).
"'";
237if ($search_cheque_num !=
'') {
243if ($search_bank_account > 0) {
244 $sql .=
' AND b.fk_account = '.((int) $search_bank_account);
247 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
251include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
253$parameters = array();
254$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
255$sql .= $hookmanager->resPrint;
257$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,';
258$sql .=
' ba.rowid, ba.ref, ba.label, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.fk_accountancy_journal';
261$nbtotalofrecords =
'';
264 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
265 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
267 $resql = $db->query($sqlforcount);
269 $objforcount = $db->fetch_object($resql);
270 $nbtotalofrecords = $objforcount->nbtotalofrecords;
275 if (($page * $limit) > $nbtotalofrecords) {
283$sql .= $db->order($sortfield, $sortorder);
285 $sql .= $db->plimit($limit + 1, $offset);
288$resql = $db->query($sql);
294$num = $db->num_rows($resql);
302llxHeader(
'', $title,
'',
'', 0, 0,
'',
'',
'',
'bodyforlist');
304$arrayofselected = is_array($toselect) ? $toselect : array();
308 $param .=
'&mode='.urlencode($mode);
310if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
311 $param .=
'&contextpage='.urlencode($contextpage);
313if ($limit > 0 && $limit !=
$conf->liste_limit) {
314 $param .=
'&limit='.((int) $limit);
316if ($optioncss !=
'') {
317 $param .=
'&optioncss='.urlencode($optioncss);
321 $param .=
'&search_ref='.urlencode($search_ref);
323if ($search_date_startday) {
324 $param .=
'&search_date_startday='.urlencode((
string) ($search_date_startday));
326if ($search_date_startmonth) {
327 $param .=
'&search_date_startmonth='.urlencode((
string) ($search_date_startmonth));
329if ($search_date_startyear) {
330 $param .=
'&search_date_startyear='.urlencode((
string) ($search_date_startyear));
332if ($search_date_endday) {
333 $param .=
'&search_date_endday='.urlencode((
string) ($search_date_endday));
335if ($search_date_endmonth) {
336 $param .=
'&search_date_endmonth='.urlencode((
string) ($search_date_endmonth));
338if ($search_date_endyear) {
339 $param .=
'&search_date_endyear='.urlencode((
string) ($search_date_endyear));
342 $param .=
'&search_user='.urlencode($search_user);
344if ($search_payment_type) {
345 $param .=
'&search_payment_type='.urlencode($search_payment_type);
347if ($search_cheque_num) {
348 $param .=
'&search_cheque_num='.urlencode($search_cheque_num);
351 $param .=
'&search_amount='.urlencode($search_amount);
353if ($search_bank_account) {
354 $param .=
'&search_bank_account='.urlencode((
string) ($search_bank_account));
358include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
360$parameters = array(
'param' => &$param);
361$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
362$param .= $hookmanager->resPrint;
365$arrayofmassactions = array(
372if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
373 $arrayofmassactions = array();
375$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
377print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
378if ($optioncss !=
'') {
379 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
381print
'<input type="hidden" name="token" value="'.newToken().
'">';
382print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
383print
'<input type="hidden" name="action" value="list">';
384print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
385print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
386print
'<input type="hidden" name="page" value="'.$page.
'">';
387print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
388print
'<input type="hidden" name="page_y" value="">';
389print
'<input type="hidden" name="mode" value="'.$mode.
'">';
392$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'));
393$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'));
396print_barre_liste($langs->trans(
'ExpenseReportPayments'), $page, $_SERVER[
'PHP_SELF'], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'expensereport', 0, $newcardbutton,
'', $limit, 0, 0, 1);
400 foreach ($fieldstosearchall as $key => $val) {
401 $fieldstosearchall[$key] = $langs->trans($val);
402 $setupstring .= $key.
"=".$val.
";";
404 print
'<!-- Search done like if EXPENSEREPORT_PAYMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.
' -->'.
"\n";
405 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
410$parameters = array();
411$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
412if (empty($reshook)) {
413 $moreforfilter .= $hookmanager->resPrint;
415 $moreforfilter = $hookmanager->resPrint;
418if (!empty($moreforfilter)) {
419 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
420 print $moreforfilter;
424$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
425$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
426$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
427$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
429print
'<div class="div-table-responsive">';
430print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
'').
'">';
434print
'<tr class="liste_titre_filter">';
438 print
'<td class="liste_titre center maxwidthsearch">';
439 $searchpicto = $form->showFilterButtons(
'left');
445if (!empty($arrayfields[
'pndf.rowid'][
'checked'])) {
446 print
'<td class="liste_titre left">';
447 print
'<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
452if (!empty($arrayfields[
'pndf.datep'][
'checked'])) {
453 print
'<td class="liste_titre center">';
454 print
'<div class="nowrapfordate">';
455 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
457 print
'<div class="nowrapfordate">';
458 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
464if (!empty($arrayfields[
'u.login'][
'checked'])) {
465 print
'<td class="liste_titre">';
466 print
'<input class="flat width75" type="text" name="search_user" value="'.dol_escape_htmltag($search_user).
'">';
471if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
472 print
'<td class="liste_titre">';
473 $form->select_types_paiements($search_payment_type,
'search_payment_type',
'', 2, 1, 1);
478if (!empty($arrayfields[
'pndf.num_payment'][
'checked'])) {
479 print
'<td class="liste_titre">';
480 print
'<input class="flat" type="text" size="4" name="search_cheque_num" value="'.dol_escape_htmltag($search_cheque_num).
'">';
485if (!empty($arrayfields[
'ba.label'][
'checked'])) {
486 print
'<td class="liste_titre">';
487 $form->select_comptes($search_bank_account,
'search_bank_account', 0,
'', 1);
492if (!empty($arrayfields[
'pndf.amount'][
'checked'])) {
493 print
'<td class="liste_titre right">';
494 print
'<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'">';
499$parameters = array(
'arrayfields' => $arrayfields);
500$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
501print $hookmanager->resPrint;
505 print
'<td class="liste_titre center maxwidthsearch">';
506 $searchpicto = $form->showFilterButtons();
513$totalarray = array();
514$totalarray[
'nbfield'] = 0;
518print
'<tr class="liste_titre">';
521 print_liste_field_titre($selectedfields, $_SERVER[
'PHP_SELF'],
'',
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
522 $totalarray[
'nbfield']++;
524if (!empty($arrayfields[
'i'][
'checked'])) {
526 $totalarray[
'nbfield']++;
528if (!empty($arrayfields[
'pndf.rowid'][
'checked'])) {
530 print_liste_field_titre($arrayfields[
'pndf.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
'pndf.rowid',
'', $param,
'', $sortfield, $sortorder);
531 $totalarray[
'nbfield']++;
533if (!empty($arrayfields[
'pndf.datep'][
'checked'])) {
534 print_liste_field_titre($arrayfields[
'pndf.datep'][
'label'], $_SERVER[
"PHP_SELF"],
'pndf.datep',
'', $param,
'', $sortfield, $sortorder,
'center ');
535 $totalarray[
'nbfield']++;
537if (!empty($arrayfields[
'u.login'][
'checked'])) {
538 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.lastname',
'', $param,
'', $sortfield, $sortorder);
539 $totalarray[
'nbfield']++;
541if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
542 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
'c.libelle',
'', $param,
'', $sortfield, $sortorder);
543 $totalarray[
'nbfield']++;
545if (!empty($arrayfields[
'pndf.num_payment'][
'checked'])) {
546 print_liste_field_titre($arrayfields[
'pndf.num_payment'][
'label'], $_SERVER[
"PHP_SELF"],
"pndf.num_payment",
'', $param,
'', $sortfield, $sortorder,
'', $arrayfields[
'pndf.num_payment'][
'tooltip']);
547 $totalarray[
'nbfield']++;
549if (!empty($arrayfields[
'ba.label'][
'checked'])) {
550 print_liste_field_titre($arrayfields[
'ba.label'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
551 $totalarray[
'nbfield']++;
553if (!empty($arrayfields[
'pndf.amount'][
'checked'])) {
554 print_liste_field_titre($arrayfields[
'pndf.amount'][
'label'], $_SERVER[
"PHP_SELF"],
'pndf.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
555 $totalarray[
'nbfield']++;
559$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
560$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
561print $hookmanager->resPrint;
564 print_liste_field_titre($selectedfields, $_SERVER[
'PHP_SELF'],
'',
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
565 $totalarray[
'nbfield']++;
570foreach ($arrayfields as $column) {
571 if ($column[
'checked']) {
579$savnbfield = $totalarray[
'nbfield'];
580$totalarray = array();
581$totalarray[
'nbfield'] = 0;
582$imaxinloop = ($limit ? min($num, $limit) : $num);
583while ($i < $imaxinloop) {
584 $objp = $db->fetch_object($resql);
589 $paymentexpensereportstatic->id = $objp->rowid;
590 $paymentexpensereportstatic->ref = $objp->ref;
591 $paymentexpensereportstatic->datep = $db->jdate($objp->datep);
592 $paymentexpensereportstatic->amount = $objp->pamount;
593 $paymentexpensereportstatic->fk_typepayment = $objp->paiement_type;
596 $accountstatic->fetch($objp->bid);
597 $paymentexpensereportstatic->fk_bank = $accountstatic->id;
599 $paymentexpensereportstatic->fk_bank = 0;
602 $userstatic->id = $objp->userid;
603 $userstatic->lastname = $objp->lastname;
604 $userstatic->firstname = $objp->firstname;
605 $userstatic->login = $objp->login;
606 $userstatic->email = $objp->email;
607 $userstatic->photo = $objp->photo;
609 if ($mode ==
'kanban') {
611 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
612 print
'<div class="box-flex-container kanban">';
615 print $paymentexpensereportstatic->getKanbanView(
'', array(
'selected' => in_array($objp->id, $arrayofselected)));
616 if ($i == ($imaxinloop - 1)) {
623 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
627 print
'<td class="nowrap center">';
628 if ($massactionbutton || $massaction) {
630 if (in_array(
$object->id, $arrayofselected)) {
633 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
637 $totalarray[
'nbfield']++;
642 if (!empty($arrayfields[
'i'][
'checked'])) {
643 print
'<td>#'.(($offset * $limit) + $i).
'</td>';
645 $totalarray[
'nbfield']++;
650 if (!empty($arrayfields[
'pndf.rowid'][
'checked'])) {
651 print
'<td class="nowrap">'.$paymentexpensereportstatic->getNomUrl(1).
'</td>';
653 $totalarray[
'nbfield']++;
658 if (!empty($arrayfields[
'pndf.datep'][
'checked'])) {
659 $dateformatforpayment =
'dayhour';
660 print
'<td class="nowrap center">'.dol_print_date($db->jdate($objp->datep), $dateformatforpayment).
'</td>';
662 $totalarray[
'nbfield']++;
667 if (!empty($arrayfields[
'u.login'][
'checked'])) {
669 if ($userstatic->id > 0) {
670 print $userstatic->getNomUrl(-1);
674 $totalarray[
'nbfield']++;
679 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
680 $payment_type = $langs->trans(
"PaymentType".$objp->paiement_type) !=
"PaymentType".$objp->paiement_type ? $langs->trans(
"PaymentType".$objp->paiement_type) : $objp->paiement_libelle;
681 print
'<td>'.$payment_type.
' '.
dol_trunc($objp->num_payment, 32).
'</td>';
683 $totalarray[
'nbfield']++;
688 if (!empty($arrayfields[
'pndf.num_payment'][
'checked'])) {
689 print
'<td>'.$objp->num_payment.
'</td>';
691 $totalarray[
'nbfield']++;
696 if (!empty($arrayfields[
'ba.label'][
'checked'])) {
699 $accountstatic->id = $objp->bid;
700 $accountstatic->ref = $objp->bref;
701 $accountstatic->label = $objp->blabel;
702 $accountstatic->number = $objp->number;
703 $accountstatic->iban = $objp->iban_prefix;
704 $accountstatic->bic = $objp->bic;
705 $accountstatic->currency_code = $objp->currency_code;
706 $accountstatic->account_number = $objp->account_number;
709 $accountingjournal->fetch($objp->accountancy_journal);
710 $accountstatic->accountancy_journal = $accountingjournal->code;
712 print $accountstatic->getNomUrl(1);
718 $totalarray[
'nbfield']++;
723 if (!empty($arrayfields[
'pndf.amount'][
'checked'])) {
724 print
'<td class="right"><span class="amount">'.price($objp->pamount).
'</span></td>';
726 $totalarray[
'nbfield']++;
728 $totalarray[
'pos'][$checkedCount] =
'amount';
729 if (empty($totalarray[
'val'][
'amount'])) {
730 $totalarray[
'val'][
'amount'] = $objp->pamount;
732 $totalarray[
'val'][
'amount'] += $objp->pamount;
738 print
'<td class="nowrap center">';
739 if ($massactionbutton || $massaction) {
741 if (in_array(
$object->id, $arrayofselected)) {
744 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
748 $totalarray[
'nbfield']++;
759include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
764 foreach ($arrayfields as $key => $val) {
765 if (!empty($val[
'checked'])) {
769 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
774$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
775$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
776print $hookmanager->resPrint;
778print
'</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.
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.
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.
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.