29 require
'../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/tva.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
46 $langs->loadLangs(array(
'banks',
'categories',
'accountancy',
'compta'));
48 $action =
GETPOST(
'action',
'aZ09');
49 $massaction =
GETPOST(
'massaction',
'alpha');
50 $show_files =
GETPOST(
'show_files',
'int');
51 $confirm =
GETPOST(
'confirm',
'alpha');
52 $toselect =
GETPOST(
'toselect',
'array');
53 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'bankaccountlist';
55 $search_ref =
GETPOST(
'search_ref',
'alpha');
56 $search_label =
GETPOST(
'search_label',
'alpha');
57 $search_number =
GETPOST(
'search_number',
'alpha');
58 $search_status =
GETPOST(
'search_status') ?
GETPOST(
'search_status',
'alpha') :
'opened';
59 $optioncss =
GETPOST(
'optioncss',
'alpha');
62 $search_category_list =
GETPOST(
"search_category_".Categorie::TYPE_ACCOUNT.
"_list",
"array");
68 $socid = $user->socid;
72 if (!empty($user->rights->accounting->chartofaccount)) {
79 $diroutputmassaction = $conf->bank->dir_output.
'/temp/massgeneration/'.$user->id;
81 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
82 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
83 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
85 if (empty($page) || $page == -1) {
88 $offset = $limit * $page;
89 $pageprev = $page - 1;
90 $pagenext = $page + 1;
92 $sortfield =
'b.label';
101 $hookmanager->initHooks(array(
'bankaccountlist'));
104 $extrafields->fetch_name_optionals_label($object->table_element);
105 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
108 $fieldstosearchall = array(
113 $checkedtypetiers = 0;
114 $arrayfields = array(
115 'b.ref'=>array(
'label'=>$langs->trans(
"BankAccounts"),
'checked'=>1,
'position'=>10),
116 'b.label'=>array(
'label'=>$langs->trans(
"Label"),
'checked'=>1,
'position'=>12),
117 'accountype'=>array(
'label'=>$langs->trans(
"Type"),
'checked'=>1,
'position'=>14),
118 'b.number'=>array(
'label'=>$langs->trans(
"AccountIdShort"),
'checked'=>1,
'position'=>16),
119 'b.account_number'=>array(
'label'=>$langs->trans(
"AccountAccounting"),
'checked'=>(
isModEnabled(
'accounting')),
'position'=>18),
120 'b.fk_accountancy_journal'=>array(
'label'=>$langs->trans(
"AccountancyJournal"),
'checked'=>(
isModEnabled(
'accounting')),
'position'=>20),
121 'toreconcile'=>array(
'label'=>$langs->trans(
"TransactionsToConciliate"),
'checked'=>1,
'position'=>50),
122 'b.currency_code'=>array(
'label'=>$langs->trans(
"Currency"),
'checked'=>0,
'position'=>22),
123 'b.datec'=>array(
'label'=>$langs->trans(
"DateCreation"),
'checked'=>0,
'position'=>500),
124 'b.tms'=>array(
'label'=>$langs->trans(
"DateModificationShort"),
'checked'=>0,
'position'=>500),
125 'b.clos'=>array(
'label'=>$langs->trans(
"Status"),
'checked'=>1,
'position'=>1000),
126 'balance'=>array(
'label'=>$langs->trans(
"Balance"),
'checked'=>1,
'position'=>1010),
129 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
134 $permissiontoadd = $user->rights->banque->modifier;
135 $permissiontodelete = $user->rights->banque->configurer;
141 if (
GETPOST(
'cancel',
'alpha')) {
145 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
149 $parameters = array(
'socid'=>$socid);
150 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
155 if (empty($reshook)) {
156 include DOL_DOCUMENT_ROOT .
'/core/actions_changeselectedfields.inc.php';
159 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
167 $objectclass =
'Account';
168 $objectlabel =
'FinancialAccount';
169 $uploaddir = $conf->banque->dir_output;
170 include DOL_DOCUMENT_ROOT .
'/core/actions_massactions.inc.php';
179 $title = $langs->trans(
'BankAccounts');
184 $sql =
"SELECT b.rowid, b.label, b.courant, b.rappro, b.account_number, b.fk_accountancy_journal, b.currency_code, b.datec as date_creation, b.tms as date_update";
186 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
187 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
188 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
192 $parameters = array();
193 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
194 $sql .= $hookmanager->resPrint;
195 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account as b";
196 if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
197 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (b.rowid = ef.fk_object)";
204 $sql .=
" WHERE b.entity IN (".getEntity(
'bank_account').
")";
205 if ($search_status ==
'opened') {
206 $sql .=
" AND clos = 0";
208 if ($search_status ==
'closed') {
209 $sql .=
" AND clos = 1";
216 if ($search_ref !=
'') {
219 if ($search_label !=
'') {
222 if ($search_number !=
'') {
226 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
228 $parameters = array();
229 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
230 $sql .= $hookmanager->resPrint;
232 $sql .= $db->order($sortfield, $sortorder);
235 $nbtotalofrecords =
'';
236 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
237 $result = $db->query($sql);
238 $nbtotalofrecords = $db->num_rows($result);
241 $sql .= $db->plimit($limit + 1, $offset);
243 $resql = $db->query($sql);
245 $num = $db->num_rows(
$resql);
248 $objp = $db->fetch_object(
$resql);
249 $accounts[$objp->rowid] = $objp->courant;
259 $help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
264 $arrayofselected = is_array($toselect) ? $toselect : array();
267 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
268 $param .=
'&contextpage='.urlencode($contextpage);
270 if ($limit > 0 && $limit != $conf->liste_limit) {
271 $param .=
'&limit='.urlencode($limit);
273 if ($search_ref !=
'') {
274 $param .=
'&search_ref='.urlencode($search_ref);
276 if ($search_label !=
'') {
277 $param .=
'&search_label='.urlencode($search_label);
279 if ($search_number !=
'') {
280 $param .=
'&search_number='.urlencode($search_number);
282 if ($search_status !=
'') {
283 $param .=
'&search_status='.urlencode($search_status);
286 $param .=
'&show_files='.urlencode($show_files);
288 if ($optioncss !=
'') {
289 $param .=
'&optioncss='.urlencode($optioncss);
292 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
294 $parameters = array();
295 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
296 $param .= $hookmanager->resPrint;
299 $arrayofmassactions = array(
303 if ($permissiontodelete) {
304 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
306 if (
isModEnabled(
'category') && $user->rights->banque->modifier) {
307 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
309 if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
310 $arrayofmassactions = array();
312 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
314 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
315 if ($optioncss !=
'') {
316 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
318 print
'<input type="hidden" name="token" value="'.newToken().
'">';
319 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
320 print
'<input type="hidden" name="action" value="list">';
321 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
322 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
323 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
325 print
'<input type="hidden" name="page" value="'.$page.
'">';
326 print
'<input type="hidden" name="search_status" value="'.$search_status.
'">';
328 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewFinancialAccount'),
'',
'fa fa-plus-circle',
'card.php?action=create',
'', $user->rights->banque->configurer);
330 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit, 1);
332 $topicmail =
"Information";
335 $trackid =
'bank'.$object->id;
336 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
347 if (
isModEnabled(
'categorie') && $user->rights->categorie->lire) {
348 $moreforfilter .=
$form->getFilterBox(Categorie::TYPE_ACCOUNT, $search_category_list);
352 $parameters = array();
353 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object);
354 if (empty($reshook)) {
355 $moreforfilter .= $hookmanager->resPrint;
357 $moreforfilter = $hookmanager->resPrint;
360 if (!empty($moreforfilter)) {
361 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
362 print $moreforfilter;
366 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
367 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
368 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
370 print
'<div class="div-table-responsive">';
371 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
375 print
'<tr class="liste_titre">';
378 if (!empty($arrayfields[
'b.ref'][
'checked'])) {
379 print
'<td class="liste_titre">';
380 print
'<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
384 if (!empty($arrayfields[
'b.label'][
'checked'])) {
385 print
'<td class="liste_titre">';
386 print
'<input class="flat" size="6" type="text" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
390 if (!empty($arrayfields[
'accountype'][
'checked'])) {
391 print
'<td class="liste_titre">';
395 if (!empty($arrayfields[
'b.number'][
'checked'])) {
396 print
'<td class="liste_titre">';
397 print
'<input class="flat" size="6" type="text" name="search_number" value="'.dol_escape_htmltag($search_number).
'">';
401 if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
402 print
'<td class="liste_titre">';
406 if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
407 print
'<td class="liste_titre">';
411 if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
412 print
'<td class="liste_titre">';
416 if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
417 print
'<td class="liste_titre">';
421 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
424 $parameters = array(
'arrayfields'=>$arrayfields);
425 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object);
426 print $hookmanager->resPrint;
428 if (!empty($arrayfields[
'b.datec'][
'checked'])) {
429 print
'<td class="liste_titre">';
433 if (!empty($arrayfields[
'b.tms'][
'checked'])) {
434 print
'<td class="liste_titre">';
438 if (!empty($arrayfields[
'b.clos'][
'checked'])) {
439 print
'<td class="liste_titre center">';
441 'opened'=>$langs->trans(
"Opened"),
442 'closed'=>$langs->trans(
"Closed")
444 print
$form->selectarray(
"search_status", $array, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'', 1);
448 if (!empty($arrayfields[
'balance'][
'checked'])) {
449 print
'<td class="liste_titre"></td>';
452 print
'<td class="liste_titre maxwidthsearch">';
453 $searchpicto =
$form->showFilterButtons();
460 print
'<tr class="liste_titre">';
461 if (!empty($arrayfields[
'b.ref'][
'checked'])) {
462 print_liste_field_titre($arrayfields[
'b.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'b.ref',
'', $param,
'', $sortfield, $sortorder);
464 if (!empty($arrayfields[
'b.label'][
'checked'])) {
465 print_liste_field_titre($arrayfields[
'b.label'][
'label'], $_SERVER[
"PHP_SELF"],
'b.label',
'', $param,
'', $sortfield, $sortorder);
467 if (!empty($arrayfields[
'accountype'][
'checked'])) {
468 print_liste_field_titre($arrayfields[
'accountype'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder);
470 if (!empty($arrayfields[
'b.number'][
'checked'])) {
471 print_liste_field_titre($arrayfields[
'b.number'][
'label'], $_SERVER[
"PHP_SELF"],
'b.number',
'', $param,
'', $sortfield, $sortorder);
473 if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
474 print_liste_field_titre($arrayfields[
'b.account_number'][
'label'], $_SERVER[
"PHP_SELF"],
'b.account_number',
'', $param,
'', $sortfield, $sortorder);
476 if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
477 print_liste_field_titre($arrayfields[
'b.fk_accountancy_journal'][
'label'], $_SERVER[
"PHP_SELF"],
'b.fk_accountancy_journal',
'', $param,
'', $sortfield, $sortorder);
479 if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
480 print_liste_field_titre($arrayfields[
'b.currency_code'][
'label'], $_SERVER[
"PHP_SELF"],
'b.currency_code',
'', $param,
'', $sortfield, $sortorder,
'center ');
482 if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
483 print_liste_field_titre($arrayfields[
'toreconcile'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
486 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
488 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
489 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
490 print $hookmanager->resPrint;
491 if (!empty($arrayfields[
'b.datec'][
'checked'])) {
492 print_liste_field_titre($arrayfields[
'b.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"b.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
494 if (!empty($arrayfields[
'b.tms'][
'checked'])) {
495 print_liste_field_titre($arrayfields[
'b.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"b.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
497 if (!empty($arrayfields[
'b.clos'][
'checked'])) {
498 print_liste_field_titre($arrayfields[
'b.clos'][
'label'], $_SERVER[
"PHP_SELF"],
'b.clos',
'', $param,
'', $sortfield, $sortorder,
'center ');
500 if (!empty($arrayfields[
'balance'][
'checked'])) {
501 print_liste_field_titre($arrayfields[
'balance'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
503 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
507 $totalarray = array();
508 $totalarray[
'nbfield'] = 0;
509 $totalarray[
'val'] = array(
'balance'=>0);
513 $lastcurrencycode =
'';
515 foreach ($accounts as $key => $type) {
522 $result = $objecttmp->fetch($key);
524 $solde = $objecttmp->solde(1);
526 if (!empty($lastcurrencycode) && $lastcurrencycode != $objecttmp->currency_code) {
527 $lastcurrencycode =
'various';
529 if ($lastcurrencycode !=
'various') {
530 $lastcurrencycode = $objecttmp->currency_code;
533 print
'<tr class="oddeven">';
536 if (!empty($arrayfields[
'b.ref'][
'checked'])) {
537 print
'<td class="nowraponall">'.$objecttmp->getNomUrl(1).
'</td>';
539 $totalarray[
'nbfield']++;
544 if (!empty($arrayfields[
'b.label'][
'checked'])) {
545 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objecttmp->label).
'">'.
dol_escape_htmltag($objecttmp->label).
'</td>';
547 $totalarray[
'nbfield']++;
552 if (!empty($arrayfields[
'accountype'][
'checked'])) {
553 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($objecttmp->type_lib[$objecttmp->type]).
'">';
554 print $objecttmp->type_lib[$objecttmp->type];
557 $totalarray[
'nbfield']++;
562 if (!empty($arrayfields[
'b.number'][
'checked'])) {
563 print
'<td>'.dol_escape_htmltag($objecttmp->number).
'</td>';
565 $totalarray[
'nbfield']++;
570 if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
571 print
'<td class="tdoverflowmax250">';
572 if (
isModEnabled(
'accounting') && !empty($objecttmp->account_number)) {
574 $accountingaccount->fetch(
'', $objecttmp->account_number, 1);
575 print
'<span title="'.dol_escape_htmltag($accountingaccount->account_number.
' - '.$accountingaccount->label).
'">';
576 print $accountingaccount->getNomUrl(0, 1, 1,
'', 0);
579 print
'<span title="'.dol_escape_htmltag($objecttmp->account_number).
'">'.$objecttmp->account_number.
'</span>';
583 $totalarray[
'nbfield']++;
588 if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
589 print
'<td class="tdoverflowmax125">';
591 if (empty($objecttmp->fk_accountancy_journal)) {
595 $accountingjournal->fetch($objecttmp->fk_accountancy_journal);
596 print $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
603 $totalarray[
'nbfield']++;
608 if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
609 print
'<td class="center nowraponall">';
610 print $objecttmp->currency_code;
613 $totalarray[
'nbfield']++;
618 if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
619 $conciliate = $objecttmp->canBeConciliated();
622 if ($conciliate == -2) {
623 $labeltoshow = $langs->trans(
"CashAccount");
624 } elseif ($conciliate == -3) {
625 $labeltoshow = $langs->trans(
"Closed");
626 } elseif (empty($objecttmp->rappro)) {
627 $labeltoshow = $langs->trans(
"ConciliationDisabled");
630 print
'<td class="center tdoverflowmax125"'.($labeltoshow ?
' title="'.dol_escape_htmltag($labeltoshow).
'"' :
'').
'>';
631 if ($conciliate == -2) {
632 print
'<span class="opacitymedium">'.$langs->trans(
"CashAccount").
'</span>';
633 } elseif ($conciliate == -3) {
634 print
'<span class="opacitymedium">'.$langs->trans(
"Closed").
'</span>';
635 } elseif (empty($objecttmp->rappro)) {
636 print
'<span class="opacitymedium">'.$langs->trans(
"ConciliationDisabled").
'</span>';
638 $result = $objecttmp->load_board($user, $objecttmp->id);
642 print
'<a href="'.DOL_URL_ROOT.
'/compta/bank/bankentries_list.php?action=reconcile&sortfield=b.datev,b.dateo,b.rowid&sortorder=asc,asc,asc&id='.$objecttmp->id.
'&search_account='.$objecttmp->id.
'&search_conciliated=0&contextpage=banktransactionlist">';
643 print
'<span class="badge badge-info classfortooltip" title="'.dol_htmlentities($langs->trans(
"TransactionsToConciliate")).
'">';
644 print $result->nbtodo;
647 if ($result->nbtodolate) {
648 print
'<span title="'.dol_htmlentities($langs->trans(
"Late")).
'" class="classfortooltip badge badge-danger marginleftonlyshort">';
649 print
'<i class="fa fa-exclamation-triangle"></i> '.$result->nbtodolate;
657 $totalarray[
'nbfield']++;
662 if (is_array($objecttmp->array_options)) {
663 $obj =
new stdClass();
664 foreach ($objecttmp->array_options as $k => $v) {
668 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
670 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
671 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $objecttmp);
672 print $hookmanager->resPrint;
674 if (!empty($arrayfields[
'b.datec'][
'checked'])) {
675 print
'<td class="center nowraponall">';
679 $totalarray[
'nbfield']++;
683 if (!empty($arrayfields[
'b.tms'][
'checked'])) {
684 print
'<td class="center nowraponall">';
688 $totalarray[
'nbfield']++;
693 if (!empty($arrayfields[
'b.clos'][
'checked'])) {
694 print
'<td class="center">'.$objecttmp->getLibStatut(5).
'</td>';
696 $totalarray[
'nbfield']++;
701 if (!empty($arrayfields[
'balance'][
'checked'])) {
702 print
'<td class="nowraponall right">';
703 print
'<a href="'.DOL_URL_ROOT.
'/compta/bank/bankentries_list.php?id='.$objecttmp->id.
'">';
704 print
'<span class="amount">'.price($solde, 0, $langs, 1, -1, -1, $objecttmp->currency_code).
'</span>';
708 $totalarray[
'nbfield']++;
711 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'balance';
713 $totalarray[
'val'][
'balance'] += $solde;
717 print
'<td class="nowrap center">';
718 if ($massactionbutton || $massaction) {
720 if (in_array($objecttmp->id, $arrayofselected)) {
723 print
'<input id="cb'.$objecttmp->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objecttmp->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
727 $totalarray[
'nbfield']++;
732 if (empty($total[$objecttmp->currency_code])) {
733 $total[$objecttmp->currency_code] = $solde;
735 $total[$objecttmp->currency_code] += $solde;
744 foreach ($arrayfields as $key => $val) {
745 if (!empty($val[
'checked'])) {
749 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
753 if ($lastcurrencycode !=
'various') {
755 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';