38require
'../../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/fourn/class/paiementfourn.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(
'companies',
'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';
64$search_ref =
GETPOST(
'search_ref',
'alpha');
65$search_date_startday =
GETPOSTINT(
'search_date_startday');
66$search_date_startmonth =
GETPOSTINT(
'search_date_startmonth');
67$search_date_startyear =
GETPOSTINT(
'search_date_startyear');
68$search_date_endday =
GETPOSTINT(
'search_date_endday');
69$search_date_endmonth =
GETPOSTINT(
'search_date_endmonth');
70$search_date_endyear =
GETPOSTINT(
'search_date_endyear');
71$search_date_start =
dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
72$search_date_end =
dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
73$search_company =
GETPOST(
'search_company',
'alpha');
74$search_payment_type =
GETPOST(
'search_payment_type',
'alpha');
75$search_cheque_num =
GETPOST(
'search_cheque_num',
'alpha');
76$search_bank_account =
GETPOST(
'search_bank_account',
'int');
77$search_amount =
GETPOST(
'search_amount',
'alpha');
81$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
82$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
85if (empty($page) || $page == -1) {
88$offset = $limit * $page;
96 $sortfield =
"p.datep";
99$search_all = trim(
GETPOST(
'search_all',
'alphanohtml'));
102$fieldstosearchall = array(
103 'p.ref' =>
"RefPayment",
104 's.nom' =>
"ThirdParty",
105 'p.num_paiement' =>
"Numero",
106 'p.amount' =>
"Amount",
110 'p.ref' => array(
'label' =>
"RefPayment",
'checked' => 1,
'position' => 10),
111 'p.datep' => array(
'label' =>
"Date",
'checked' => 1,
'position' => 20),
112 's.nom' => array(
'label' =>
"ThirdParty",
'checked' => 1,
'position' => 30),
113 'c.libelle' => array(
'label' =>
"Type",
'checked' => 1,
'position' => 40),
114 'p.num_paiement' => array(
'label' =>
"Numero",
'checked' => 1,
'position' => 50,
'tooltip' =>
"ChequeOrTransferNumber"),
115 'ba.label' => array(
'label' =>
"BankAccount",
'checked' => 1,
'position' => 60,
'enable' => (isModEnabled(
"bank"))),
116 'p.amount' => array(
'label' =>
"Amount",
'checked' => 1,
'position' => 70),
119'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
122$hookmanager->initHooks(array(
'paymentsupplierlist'));
125if (!$user->hasRight(
'societe',
'client',
'voir')) {
126 $search_sale = $user->id;
131 $socid = $user->socid;
140if (!isModEnabled(
'supplier_invoice')) {
143if ((!$user->hasRight(
"fournisseur",
"facture",
"lire") && !
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD'))
144 || (!$user->hasRight(
"supplier_invoice",
"lire") &&
getDolGlobalString(
'MAIN_USE_NEW_SUPPLIERMOD'))) {
153$parameters = array(
'socid' => $socid);
154$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
159if (empty($reshook)) {
160 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 =
'';
172 $search_company =
'';
173 $search_payment_type =
'';
174 $search_cheque_num =
'';
175 $search_bank_account =
'';
179 $search_array_options = array();
186$title = $langs->trans(
'ListPayment');
189llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
191$form =
new Form($db);
193$accountstatic =
new Account($db);
194$companystatic =
new Societe($db);
197$sql =
'SELECT p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement as num_payment, p.amount';
198$sql .=
', c.code as paiement_type, c.libelle as paiement_libelle';
199$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';
200$sql .=
', s.rowid as socid, s.nom as name, s.email';
203$sql .=
", SUM(pf.amount) as totalamount, COUNT(f.rowid) as nbinvoices";
207$sql .=
' FROM '.MAIN_DB_PREFIX.
'paiementfourn AS p';
208$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_paiement AS c ON p.fk_paiement = c.id';
209$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank as b ON p.fk_bank = b.rowid';
210$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'bank_account as ba ON b.fk_account = ba.rowid';
212$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'paiementfourn_facturefourn AS pf ON p.rowid = pf.fk_paiementfourn';
213$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'facture_fourn AS f ON f.rowid = pf.fk_facturefourn';
214$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'societe AS s ON s.rowid = f.fk_soc';
216$sql .=
' WHERE f.entity IN ('.getEntity(
'supplier_invoice').
')';
218 $sql .=
" AND EXISTS (SELECT f.fk_soc FROM ".MAIN_DB_PREFIX.
"facture_fourn as f, ".MAIN_DB_PREFIX.
"paiementfourn_facturefourn as pf";
219 $sql .=
" WHERE p.rowid = pf.fk_paiementfourn AND pf.fk_facturefourn = f.rowid AND f.fk_soc = ".((int) $socid).
")";
226if ($search_date_start) {
227 $sql .=
" AND p.datep >= '" . $db->idate($search_date_start) .
"'";
229if ($search_date_end) {
230 $sql .=
" AND p.datep <= '" . $db->idate($search_date_end) .
"'";
233if ($search_company) {
236if ($search_payment_type !=
'') {
237 $sql .=
" AND c.code = '".$db->escape($search_payment_type).
"'";
239if ($search_cheque_num !=
'') {
243 $sql .=
" AND (".natural_search(
'p.amount', $search_amount, 1, 1);
248if ($search_bank_account > 0) {
249 $sql .=
' AND b.fk_account = '.((int) $search_bank_account);
252 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
255if ($search_sale && $search_sale !=
'-1') {
256 if ($search_sale == -2) {
257 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc)";
258 } elseif ($search_sale > 0) {
259 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
264include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
266$sql .=
' GROUP BY p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement, p.amount, s.rowid, s.nom, s.email, c.code, c.libelle,';
267$sql .=
' ba.rowid, ba.ref, ba.label, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.fk_accountancy_journal';
270$nbtotalofrecords =
'';
273 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(DISTINCT p.rowid) as nbtotalofrecords', $sql);
274 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
275 $resql = $db->query($sqlforcount);
277 $objforcount = $db->fetch_object($resql);
278 $nbtotalofrecords = $objforcount->nbtotalofrecords;
283 if (($page * $limit) > $nbtotalofrecords) {
291$sql .= $db->order($sortfield, $sortorder);
293 $sql .= $db->plimit($limit + 1, $offset);
297$resql = $db->query($sql);
305$num = $db->num_rows($resql);
309if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
310 $param .=
'&contextpage='.urlencode($contextpage);
312if ($limit > 0 && $limit !=
$conf->liste_limit) {
313 $param .=
'&limit='.((int) $limit);
315if ($optioncss !=
'') {
316 $param .=
'&optioncss='.urlencode($optioncss);
320 $param .=
'&search_ref='.urlencode($search_ref);
322if ($search_date_startday) {
323 $param .=
'&search_date_startday='.urlencode((
string) ($search_date_startday));
325if ($search_date_startmonth) {
326 $param .=
'&search_date_startmonth='.urlencode((
string) ($search_date_startmonth));
328if ($search_date_startyear) {
329 $param .=
'&search_date_startyear='.urlencode((
string) ($search_date_startyear));
331if ($search_date_endday) {
332 $param .=
'&search_date_endday='.urlencode((
string) ($search_date_endday));
334if ($search_date_endmonth) {
335 $param .=
'&search_date_endmonth='.urlencode((
string) ($search_date_endmonth));
337if ($search_date_endyear) {
338 $param .=
'&search_date_endyear='.urlencode((
string) ($search_date_endyear));
340if ($search_company) {
341 $param .=
'&search_company='.urlencode($search_company);
343if ($search_payment_type) {
344 $param .=
'&search_company='.urlencode($search_payment_type);
346if ($search_cheque_num) {
347 $param .=
'&search_cheque_num='.urlencode($search_cheque_num);
350 $param .=
'&search_amount='.urlencode($search_amount);
354include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
356print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
357if ($optioncss !=
'') {
358 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
360print
'<input type="hidden" name="token" value="'.newToken().
'">';
361print
'<input type="hidden" name="action" value="list">';
362print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
363print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
364print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
365print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
368print_barre_liste($langs->trans(
'SupplierPayments'), $page, $_SERVER[
'PHP_SELF'], $param, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'supplier_invoice', 0,
'',
'', $limit, 0, 0, 1);
371 foreach ($fieldstosearchall as $key => $val) {
372 $fieldstosearchall[$key] = $langs->trans($val);
374 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
379$parameters = array();
380$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
381if (empty($reshook)) {
382 $moreforfilter .= $hookmanager->resPrint;
384 $moreforfilter = $hookmanager->resPrint;
388 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
389 print $moreforfilter;
393$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
394$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
395if (!empty($massactionbutton)) {
396 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
399print
'<div class="div-table-responsive">';
400print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
'').
'">';
404print
'<tr class="liste_titre_filter">';
408 print
'<td class="liste_titre center maxwidthsearch">';
409 $searchpicto = $form->showFilterButtons(
'left');
416 print
'<td class="liste_titre">';
421if (!empty($arrayfields[
'p.ref'][
'checked'])) {
422 print
'<td class="liste_titre left">';
423 print
'<input class="flat" type="text" size="4" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
428if (!empty($arrayfields[
'p.datep'][
'checked'])) {
429 print
'<td class="liste_titre center">';
430 print
'<div class="nowrapfordate">';
431 print $form->selectDate($search_date_start ? $search_date_start : -1,
'search_date_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
433 print
'<div class="nowrapfordate">';
434 print $form->selectDate($search_date_end ? $search_date_end : -1,
'search_date_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
440if (!empty($arrayfields[
's.nom'][
'checked'])) {
441 print
'<td class="liste_titre">';
442 print
'<input class="flat" type="text" size="6" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
447if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
448 print
'<td class="liste_titre">';
449 $form->select_types_paiements($search_payment_type,
'search_payment_type',
'', 2, 1, 1);
454if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
455 print
'<td class="liste_titre">';
456 print
'<input class="flat" type="text" size="4" name="search_cheque_num" value="'.dol_escape_htmltag($search_cheque_num).
'">';
461if (!empty($arrayfields[
'ba.label'][
'checked'])) {
462 print
'<td class="liste_titre">';
463 $form->select_comptes($search_bank_account,
'search_bank_account', 0,
'', 1);
468if (!empty($arrayfields[
'p.amount'][
'checked'])) {
469 print
'<td class="liste_titre right">';
470 print
'<input class="flat" type="text" size="4" name="search_amount" value="'.dol_escape_htmltag($search_amount).
'">';
475$parameters = array(
'arrayfields' => $arrayfields);
476$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
477print $hookmanager->resPrint;
481 print
'<td class="liste_titre center maxwidthsearch">';
482 $searchpicto = $form->showFilterButtons();
489$totalarray = array();
490$totalarray[
'nbfield'] = 0;
494print
'<tr class="liste_titre">';
497 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
498 $totalarray[
'nbfield']++;
502 $totalarray[
'nbfield']++;
504if (!empty($arrayfields[
'p.ref'][
'checked'])) {
506 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'p.rowid',
'', $param,
'', $sortfield, $sortorder);
507 $totalarray[
'nbfield']++;
509if (!empty($arrayfields[
'p.datep'][
'checked'])) {
510 print_liste_field_titre($arrayfields[
'p.datep'][
'label'], $_SERVER[
"PHP_SELF"],
'p.datep',
'', $param,
'', $sortfield, $sortorder,
'center ');
511 $totalarray[
'nbfield']++;
513if (!empty($arrayfields[
's.nom'][
'checked'])) {
514 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
's.nom',
'', $param,
'', $sortfield, $sortorder);
515 $totalarray[
'nbfield']++;
517if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
518 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
'c.libelle',
'', $param,
'', $sortfield, $sortorder);
519 $totalarray[
'nbfield']++;
521if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
522 print_liste_field_titre($arrayfields[
'p.num_paiement'][
'label'], $_SERVER[
"PHP_SELF"],
"p.num_paiement",
'', $param,
'', $sortfield, $sortorder,
'', $arrayfields[
'p.num_paiement'][
'tooltip']);
523 $totalarray[
'nbfield']++;
525if (!empty($arrayfields[
'ba.label'][
'checked'])) {
526 print_liste_field_titre($arrayfields[
'ba.label'][
'label'], $_SERVER[
"PHP_SELF"],
'ba.label',
'', $param,
'', $sortfield, $sortorder);
527 $totalarray[
'nbfield']++;
529if (!empty($arrayfields[
'p.amount'][
'checked'])) {
530 print_liste_field_titre($arrayfields[
'p.amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
531 $totalarray[
'nbfield']++;
535$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
536$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
537print $hookmanager->resPrint;
541 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
542 $totalarray[
'nbfield']++;
549$needToFetchEachLine = 0;
550if (isset($extrafields->attributes[
$object->table_element][
'computed']) && is_array($extrafields->attributes[
$object->table_element][
'computed']) && count($extrafields->attributes[
$object->table_element][
'computed']) > 0) {
551 foreach ($extrafields->attributes[
$object->table_element][
'computed'] as $key => $val) {
552 if (!is_null($val) && preg_match(
'/\$object/', $val)) {
553 $needToFetchEachLine++;
562$savnbfield = $totalarray[
'nbfield'];
563$totalarray = array();
564$totalarray[
'nbfield'] = 0;
565$imaxinloop = ($limit ? min($num, $limit) : $num);
566while ($i < $imaxinloop) {
567 $objp = $db->fetch_object($resql);
572 $paymentfournstatic->id = $objp->rowid;
573 $paymentfournstatic->ref = $objp->ref;
574 $paymentfournstatic->datepaye = $db->jdate($objp->datep);
575 $paymentfournstatic->amount = $objp->amount;
577 $companystatic->id = $objp->socid;
578 $companystatic->name = $objp->name;
579 $companystatic->email = $objp->email;
581 if ($mode ==
'kanban') {
583 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
584 print
'<div class="box-flex-container kanban">';
588 if ($massactionbutton || $massaction) {
590 if (in_array(
$object->id, $arrayofselected)) {
595 print
$object->getKanbanView(
'', array(
'selected' => $selected));
596 if ($i == ($imaxinloop - 1)) {
603 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
607 print
'<td class="nowrap center">';
608 if ($massactionbutton || $massaction) {
610 if (in_array(
$object->id, $arrayofselected)) {
613 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
617 $totalarray[
'nbfield']++;
623 print
'<td class="nowraponall">'.(($offset * $limit) + $i).
'</td>';
625 $totalarray[
'nbfield']++;
630 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
631 print
'<td class="nowraponall">'.$paymentfournstatic->getNomUrl(1).
'</td>';
633 $totalarray[
'nbfield']++;
638 if (!empty($arrayfields[
'p.datep'][
'checked'])) {
639 $dateformatforpayment =
'dayhour';
640 print
'<td class="nowraponall center">'.dol_print_date($db->jdate($objp->datep), $dateformatforpayment).
'</td>';
642 $totalarray[
'nbfield']++;
647 if (!empty($arrayfields[
's.nom'][
'checked'])) {
648 print
'<td class="tdoverflowmax125">';
649 if ($objp->socid > 0) {
650 print $companystatic->getNomUrl(1,
'', 24);
654 $totalarray[
'nbfield']++;
659 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
660 $payment_type = $langs->trans(
"PaymentType".$objp->paiement_type) !=
"PaymentType".$objp->paiement_type ? $langs->trans(
"PaymentType".$objp->paiement_type) : $objp->paiement_libelle;
661 print
'<td>'.$payment_type.
' '.
dol_trunc($objp->num_payment, 32).
'</td>';
663 $totalarray[
'nbfield']++;
668 if (!empty($arrayfields[
'p.num_paiement'][
'checked'])) {
669 print
'<td>'.$objp->num_payment.
'</td>';
671 $totalarray[
'nbfield']++;
676 if (!empty($arrayfields[
'ba.label'][
'checked'])) {
677 print
'<td class="tdoverflowmax125">';
679 $accountstatic->id = $objp->bid;
680 $accountstatic->ref = $objp->bref;
681 $accountstatic->label = $objp->blabel;
682 $accountstatic->number = $objp->number;
683 $accountstatic->iban = $objp->iban_prefix;
684 $accountstatic->bic = $objp->bic;
685 $accountstatic->currency_code = $objp->currency_code;
686 $accountstatic->account_number = $objp->account_number;
689 $accountingjournal->fetch($objp->accountancy_journal);
690 $accountstatic->accountancy_journal = $accountingjournal->code;
692 print $accountstatic->getNomUrl(1);
696 $totalarray[
'nbfield']++;
701 if (!empty($arrayfields[
'p.amount'][
'checked'])) {
702 print
'<td class="right">';
703 if ($objp->nbinvoices > 1 || ($objp->totalamount && $objp->amount != $objp->totalamount)) {
704 print $form->textwithpicto(
'', $langs->trans(
"PaymentMadeForSeveralInvoices"));
706 print
'<span class="amount">'.price($objp->amount).
'</span>';
709 $totalarray[
'nbfield']++;
710 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'amount';
712 if (empty($totalarray[
'val'][
'amount'])) {
713 $totalarray[
'val'][
'amount'] = $objp->amount;
715 $totalarray[
'val'][
'amount'] += $objp->amount;
720 print
'<td class="nowrap center">';
721 if ($massactionbutton || $massaction) {
723 if (in_array(
$object->id, $arrayofselected)) {
726 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
730 $totalarray[
'nbfield']++;
740include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
745 foreach ($arrayfields as $key => $val) {
746 if (!empty($val[
'checked'])) {
750 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
755$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
756$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
757print $hookmanager->resPrint;
759print
'</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 for supplier invoices.
Class to manage third parties objects (customers, suppliers, prospects...)
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.
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.
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...
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.