30require
'../../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/tva.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
36if (isModEnabled(
'accounting')) {
37 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
39if (isModEnabled(
'accounting')) {
40 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
42if (isModEnabled(
'categorie')) {
43 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
47$langs->loadLangs(array(
'banks',
'categories',
'accountancy',
'compta'));
49$action =
GETPOST(
'action',
'aZ09');
50$massaction =
GETPOST(
'massaction',
'alpha');
51$show_files =
GETPOST(
'show_files',
'int');
52$confirm =
GETPOST(
'confirm',
'alpha');
53$toselect =
GETPOST(
'toselect',
'array');
54$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'bankaccountlist';
57$search_ref =
GETPOST(
'search_ref',
'alpha');
58$search_label =
GETPOST(
'search_label',
'alpha');
59$search_number =
GETPOST(
'search_number',
'alpha');
60$search_status =
GETPOST(
'search_status') ?
GETPOST(
'search_status',
'alpha') :
'opened';
61$optioncss =
GETPOST(
'optioncss',
'alpha');
63$search_category_list =
"";
64if (isModEnabled(
'categorie')) {
65 $search_category_list =
GETPOST(
"search_category_".Categorie::TYPE_ACCOUNT.
"_list",
"array");
71 $socid = $user->socid;
74$diroutputmassaction = $conf->bank->dir_output.
'/temp/massgeneration/'.$user->id;
76$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
77$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
78$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
79$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
80if (empty($page) || $page == -1) {
83$offset = $limit * $page;
87 $sortfield =
'b.label';
96$hookmanager->initHooks(array(
'bankaccountlist'));
99$extrafields->fetch_name_optionals_label($object->table_element);
100$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
103$fieldstosearchall = array(
108$checkedtypetiers = 0;
110 'b.ref'=>array(
'label'=>$langs->trans(
"BankAccounts"),
'checked'=>1,
'position'=>10),
111 'b.label'=>array(
'label'=>$langs->trans(
"Label"),
'checked'=>1,
'position'=>12),
112 'accountype'=>array(
'label'=>$langs->trans(
"Type"),
'checked'=>1,
'position'=>14),
113 'b.number'=>array(
'label'=>$langs->trans(
"AccountIdShort"),
'checked'=>1,
'position'=>16),
114 'b.account_number'=>array(
'label'=>$langs->trans(
"AccountAccounting"),
'checked'=>(isModEnabled(
'accounting')),
'position'=>18),
115 'b.fk_accountancy_journal'=>array(
'label'=>$langs->trans(
"AccountancyJournal"),
'checked'=>(isModEnabled(
'accounting')),
'position'=>20),
116 'toreconcile'=>array(
'label'=>$langs->trans(
"TransactionsToConciliate"),
'checked'=>1,
'position'=>50),
117 'b.currency_code'=>array(
'label'=>$langs->trans(
"Currency"),
'checked'=>0,
'position'=>22),
118 'b.datec'=>array(
'label'=>$langs->trans(
"DateCreation"),
'checked'=>0,
'position'=>500),
119 'b.tms'=>array(
'label'=>$langs->trans(
"DateModificationShort"),
'checked'=>0,
'position'=>500),
120 'b.clos'=>array(
'label'=>$langs->trans(
"Status"),
'checked'=>1,
'position'=>1000),
121 'balance'=>array(
'label'=>$langs->trans(
"Balance"),
'checked'=>1,
'position'=>1010),
124include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
129$permissiontoadd = $user->rights->banque->modifier;
130$permissiontodelete = $user->rights->banque->configurer;
133if ($user->hasRight(
'accounting',
'chartofaccount')) {
145if (
GETPOST(
'cancel',
'alpha')) {
149if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
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';
163 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
168 $search_category_list = array();
172 $objectclass =
'Account';
173 $objectlabel =
'FinancialAccount';
174 $uploaddir = $conf->banque->dir_output;
175 include DOL_DOCUMENT_ROOT .
'/core/actions_massactions.inc.php';
184$title = $langs->trans(
'BankAccounts');
185$help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
193$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";
195if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
196 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
197 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
201$parameters = array();
202$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
203$sql .= $hookmanager->resPrint;
204$sql = preg_replace(
'/,\s*$/',
'', $sql);
208$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account as b";
209if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
210 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (b.rowid = ef.fk_object)";
212$sql .=
" WHERE b.entity IN (".getEntity(
'bank_account').
")";
213if ($search_status ==
'opened') {
214 $sql .=
" AND clos = 0";
216if ($search_status ==
'closed') {
217 $sql .=
" AND clos = 1";
219if ($search_ref !=
'') {
222if ($search_label !=
'') {
225if ($search_number !=
'') {
229$searchCategoryBankList = $search_category_list;
230$searchCategoryBankOperator = 0;
231if (!empty($searchCategoryBankList)) {
232 $searchCategoryBankSqlList = array();
233 $listofcategoryid =
'';
234 foreach ($searchCategoryBankList as $searchCategoryBank) {
235 if (intval($searchCategoryBank) == -2) {
236 $searchCategoryBankSqlList[] =
"NOT EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX.
"categorie_account as ck WHERE b.rowid = ck.fk_account)";
237 } elseif (intval($searchCategoryBank) > 0) {
238 if ($searchCategoryBankOperator == 0) {
239 $searchCategoryBankSqlList[] =
" EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX.
"categorie_account as ck WHERE b.rowid = ck.fk_account AND ck.fk_categorie = ".((int) $searchCategoryBank).
")";
241 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryBank);
245 if ($listofcategoryid) {
246 $searchCategoryBankSqlList[] =
" EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX.
"categorie_account as ck WHERE b.rowid = ck.fk_account AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
248 if ($searchCategoryBankOperator == 1) {
249 if (!empty($searchCategoryBankSqlList)) {
250 $sql .=
" AND (".implode(
' OR ', $searchCategoryBankSqlList).
")";
253 if (!empty($searchCategoryBankSqlList)) {
254 $sql .=
" AND (".implode(
' AND ', $searchCategoryBankSqlList).
")";
259include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
261$parameters = array();
262$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
263$sql .= $hookmanager->resPrint;
266$nbtotalofrecords =
'';
269 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
270 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
271 $resql = $db->query($sqlforcount);
273 $objforcount = $db->fetch_object($resql);
274 $nbtotalofrecords = $objforcount->nbtotalofrecords;
279 if (($page * $limit) > $nbtotalofrecords) {
287$sql .= $db->order($sortfield, $sortorder);
289 $sql .= $db->plimit($limit + 1, $offset);
292$resql = $db->query($sql);
294 $num = $db->num_rows($resql);
297 $objp = $db->fetch_object($resql);
298 $accounts[$objp->rowid] = $objp->courant;
311$arrayofselected = is_array($toselect) ? $toselect : array();
315 $param .=
'&mode='.urlencode($mode);
317if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
318 $param .=
'&contextpage='.urlencode($contextpage);
320if ($limit > 0 && $limit != $conf->liste_limit) {
321 $param .=
'&limit='.((int) $limit);
323if ($optioncss !=
'') {
324 $param .=
'&optioncss='.urlencode($optioncss);
326if ($search_ref !=
'') {
327 $param .=
'&search_ref='.urlencode($search_ref);
329if ($search_label !=
'') {
330 $param .=
'&search_label='.urlencode($search_label);
332if ($search_number !=
'') {
333 $param .=
'&search_number='.urlencode($search_number);
335if ($search_status !=
'') {
336 $param .=
'&search_status='.urlencode($search_status);
339 $param .=
'&show_files='.urlencode($show_files);
342include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
344$parameters = array(
'param' => &$param);
345$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
346$param .= $hookmanager->resPrint;
349$arrayofmassactions = array(
353if (!empty($permissiontodelete)) {
354 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
356if (isModEnabled(
'category') && $user->hasRight(
'banque',
'modifier')) {
357 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
359if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
360 $arrayofmassactions = array();
362$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
364print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
365if ($optioncss !=
'') {
366 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
368print
'<input type="hidden" name="token" value="'.newToken().
'">';
369print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
370print
'<input type="hidden" name="action" value="list">';
371print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
372print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
373print
'<input type="hidden" name="page" value="'.$page.
'">';
374print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
375print
'<input type="hidden" name="page_y" value="">';
376print
'<input type="hidden" name="search_status" value="'.$search_status.
'">';
377print
'<input type="hidden" name="mode" value="'.$mode.
'">';
381$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'));
382$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'));
384$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewFinancialAccount'),
'',
'fa fa-plus-circle',
'card.php?action=create',
'', $user->hasRight(
'banque',
'configurer'));
386print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit, 1);
388$topicmail =
"Information";
391$trackid =
'bank'.$object->id;
392include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
403if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire')) {
404 $moreforfilter .= $form->getFilterBox(Categorie::TYPE_ACCOUNT, $search_category_list);
408$parameters = array();
409$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
410if (empty($reshook)) {
411 $moreforfilter .= $hookmanager->resPrint;
413 $moreforfilter = $hookmanager->resPrint;
416if (!empty($moreforfilter)) {
417 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
418 print $moreforfilter;
419 $parameters = array();
420 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
421 print $hookmanager->resPrint;
425$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
426$selectedfields = ($mode !=
'kanban' ? $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
'')) :
'');
427$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
429print
'<div class="div-table-responsive">';
430print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
434print
'<tr class="liste_titre_filter">';
437 print
'<td class="liste_titre center maxwidthsearch">';
438 $searchpicto = $form->showFilterButtons(
'left');
443if (!empty($arrayfields[
'b.ref'][
'checked'])) {
444 print
'<td class="liste_titre">';
445 print
'<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
449if (!empty($arrayfields[
'b.label'][
'checked'])) {
450 print
'<td class="liste_titre">';
451 print
'<input class="flat" size="6" type="text" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
455if (!empty($arrayfields[
'accountype'][
'checked'])) {
456 print
'<td class="liste_titre">';
460if (!empty($arrayfields[
'b.number'][
'checked'])) {
461 print
'<td class="liste_titre">';
462 print
'<input class="flat" size="6" type="text" name="search_number" value="'.dol_escape_htmltag($search_number).
'">';
466if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
467 print
'<td class="liste_titre">';
471if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
472 print
'<td class="liste_titre">';
476if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
477 print
'<td class="liste_titre">';
481if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
482 print
'<td class="liste_titre">';
486include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
489$parameters = array(
'arrayfields'=>$arrayfields);
490$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
491print $hookmanager->resPrint;
493if (!empty($arrayfields[
'b.datec'][
'checked'])) {
494 print
'<td class="liste_titre">';
498if (!empty($arrayfields[
'b.tms'][
'checked'])) {
499 print
'<td class="liste_titre">';
503if (!empty($arrayfields[
'b.clos'][
'checked'])) {
504 print
'<td class="liste_titre center parentonrightofpage">';
506 'opened'=>$langs->trans(
"Opened"),
507 'closed'=>$langs->trans(
"Closed")
509 print $form->selectarray(
"search_status", $array, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'search_status minwidth75 maxwidth125 onrightofpage', 1);
513if (!empty($arrayfields[
'balance'][
'checked'])) {
514 print
'<td class="liste_titre"></td>';
518 print
'<td class="liste_titre center maxwidthsearch">';
519 $searchpicto = $form->showFilterButtons();
525$totalarray = array();
526$totalarray[
'nbfield'] = 0;
530print
'<tr class="liste_titre">';
533 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
534 $totalarray[
'nbfield']++;
536if (!empty($arrayfields[
'b.ref'][
'checked'])) {
537 print_liste_field_titre($arrayfields[
'b.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'b.ref',
'', $param,
'', $sortfield, $sortorder);
538 $totalarray[
'nbfield']++;
540if (!empty($arrayfields[
'b.label'][
'checked'])) {
541 print_liste_field_titre($arrayfields[
'b.label'][
'label'], $_SERVER[
"PHP_SELF"],
'b.label',
'', $param,
'', $sortfield, $sortorder);
542 $totalarray[
'nbfield']++;
544if (!empty($arrayfields[
'accountype'][
'checked'])) {
545 print_liste_field_titre($arrayfields[
'accountype'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder);
546 $totalarray[
'nbfield']++;
548if (!empty($arrayfields[
'b.number'][
'checked'])) {
549 print_liste_field_titre($arrayfields[
'b.number'][
'label'], $_SERVER[
"PHP_SELF"],
'b.number',
'', $param,
'', $sortfield, $sortorder);
550 $totalarray[
'nbfield']++;
552if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
553 print_liste_field_titre($arrayfields[
'b.account_number'][
'label'], $_SERVER[
"PHP_SELF"],
'b.account_number',
'', $param,
'', $sortfield, $sortorder);
554 $totalarray[
'nbfield']++;
556if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
557 print_liste_field_titre($arrayfields[
'b.fk_accountancy_journal'][
'label'], $_SERVER[
"PHP_SELF"],
'b.fk_accountancy_journal',
'', $param,
'', $sortfield, $sortorder);
558 $totalarray[
'nbfield']++;
560if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
561 print_liste_field_titre($arrayfields[
'b.currency_code'][
'label'], $_SERVER[
"PHP_SELF"],
'b.currency_code',
'', $param,
'', $sortfield, $sortorder,
'center ');
562 $totalarray[
'nbfield']++;
564if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
565 print_liste_field_titre($arrayfields[
'toreconcile'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
566 $totalarray[
'nbfield']++;
569include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
571$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
572$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
573print $hookmanager->resPrint;
574if (!empty($arrayfields[
'b.datec'][
'checked'])) {
575 print_liste_field_titre($arrayfields[
'b.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"b.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
576 $totalarray[
'nbfield']++;
578if (!empty($arrayfields[
'b.tms'][
'checked'])) {
579 print_liste_field_titre($arrayfields[
'b.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"b.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
580 $totalarray[
'nbfield']++;
582if (!empty($arrayfields[
'b.clos'][
'checked'])) {
583 print_liste_field_titre($arrayfields[
'b.clos'][
'label'], $_SERVER[
"PHP_SELF"],
'b.clos',
'', $param,
'', $sortfield, $sortorder,
'center ');
584 $totalarray[
'nbfield']++;
586if (!empty($arrayfields[
'balance'][
'checked'])) {
587 print_liste_field_titre($arrayfields[
'balance'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
588 $totalarray[
'nbfield']++;
592 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
593 $totalarray[
'nbfield']++;
601$savnbfield = $totalarray[
'nbfield'];
602$totalarray = array();
603$totalarray[
'nbfield'] = 0;
604$totalarray[
'val'] = array(
'balance'=>0);
607$lastcurrencycode =
'';
608$imaxinloop = ($limit ? min($num, $limit) : $num);
610foreach ($accounts as $key => $type) {
617 $result = $objecttmp->fetch($key);
619 $solde = $objecttmp->solde(1);
621 if (!empty($lastcurrencycode) && $lastcurrencycode != $objecttmp->currency_code) {
622 $lastcurrencycode =
'various';
624 if ($lastcurrencycode !=
'various') {
625 $lastcurrencycode = $objecttmp->currency_code;
628 if ($mode ==
'kanban') {
630 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
631 print
'<div class="box-flex-container kanban">';
635 if ($massactionbutton || $massaction) {
637 if (in_array($object->id, $arrayofselected)) {
642 print $objecttmp->getKanbanView(
'', array(
'selected' => $selected));
643 if ($i == ($imaxinloop - 1)) {
650 print
'<tr data-rowid="'.$objecttmp->id.
'" class="oddeven">';
654 print
'<td class="nowrap center">';
655 if ($massactionbutton || $massaction) {
657 if (in_array($objecttmp->id, $arrayofselected)) {
660 print
'<input id="cb'.$objecttmp->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objecttmp->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
664 $totalarray[
'nbfield']++;
668 if (!empty($arrayfields[
'b.ref'][
'checked'])) {
669 print
'<td class="nowraponall">'.$objecttmp->getNomUrl(1).
'</td>';
671 $totalarray[
'nbfield']++;
676 if (!empty($arrayfields[
'b.label'][
'checked'])) {
677 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objecttmp->label).
'">'.
dol_escape_htmltag($objecttmp->label).
'</td>';
679 $totalarray[
'nbfield']++;
684 if (!empty($arrayfields[
'accountype'][
'checked'])) {
685 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($objecttmp->type_lib[$objecttmp->type]).
'">';
686 print $objecttmp->type_lib[$objecttmp->type];
689 $totalarray[
'nbfield']++;
694 if (!empty($arrayfields[
'b.number'][
'checked'])) {
695 print
'<td>'.dol_escape_htmltag($objecttmp->number).
'</td>';
697 $totalarray[
'nbfield']++;
702 if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
703 print
'<td class="tdoverflowmax250">';
704 if (isModEnabled(
'accounting') && !empty($objecttmp->account_number)) {
706 $accountingaccount->fetch(
'', $objecttmp->account_number, 1);
707 print
'<span title="'.dol_escape_htmltag($accountingaccount->account_number.
' - '.$accountingaccount->label).
'">';
708 print $accountingaccount->getNomUrl(0, 1, 1,
'', 0);
711 print
'<span title="'.dol_escape_htmltag($objecttmp->account_number).
'">'.$objecttmp->account_number.
'</span>';
715 $totalarray[
'nbfield']++;
720 if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
721 print
'<td class="tdoverflowmax125">';
722 if (isModEnabled(
'accounting')) {
723 if (empty($objecttmp->fk_accountancy_journal)) {
727 $accountingjournal->fetch($objecttmp->fk_accountancy_journal);
728 print $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
735 $totalarray[
'nbfield']++;
740 if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
741 print
'<td class="center nowraponall">';
742 print $objecttmp->currency_code;
745 $totalarray[
'nbfield']++;
750 if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
751 $conciliate = $objecttmp->canBeConciliated();
754 if ($conciliate == -2) {
755 $labeltoshow = $langs->trans(
"CashAccount");
756 } elseif ($conciliate == -3) {
757 $labeltoshow = $langs->trans(
"Closed");
758 } elseif (empty($objecttmp->rappro)) {
759 $labeltoshow = $langs->trans(
"ConciliationDisabled");
762 print
'<td class="center tdoverflowmax125"'.($labeltoshow ?
' title="'.dol_escape_htmltag($labeltoshow).
'"' :
'').
'>';
763 if ($conciliate == -2) {
764 print
'<span class="opacitymedium">'.$langs->trans(
"CashAccount").
'</span>';
765 } elseif ($conciliate == -3) {
766 print
'<span class="opacitymedium">'.$langs->trans(
"Closed").
'</span>';
767 } elseif (empty($objecttmp->rappro)) {
768 print
'<span class="opacitymedium">'.$langs->trans(
"ConciliationDisabled").
'</span>';
770 $result = $objecttmp->load_board($user, $objecttmp->id);
771 if (is_numeric($result) && $result < 0) {
774 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">';
775 print
'<span class="badge badge-info classfortooltip" title="'.dol_htmlentities($langs->trans(
"TransactionsToConciliate")).
'">';
776 print $result->nbtodo;
779 if ($result->nbtodolate) {
780 print
'<span title="'.dol_htmlentities($langs->trans(
"Late")).
'" class="classfortooltip badge badge-danger marginleftonlyshort">';
781 print
'<i class="fa fa-exclamation-triangle"></i> '.$result->nbtodolate;
789 $totalarray[
'nbfield']++;
794 if (is_array($objecttmp->array_options)) {
796 foreach ($objecttmp->array_options as $k => $v) {
800 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
802 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
803 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $objecttmp, $action);
804 print $hookmanager->resPrint;
806 if (!empty($arrayfields[
'b.datec'][
'checked'])) {
807 print
'<td class="center nowraponall">';
811 $totalarray[
'nbfield']++;
815 if (!empty($arrayfields[
'b.tms'][
'checked'])) {
816 print
'<td class="center nowraponall">';
820 $totalarray[
'nbfield']++;
825 if (!empty($arrayfields[
'b.clos'][
'checked'])) {
826 print
'<td class="center">'.$objecttmp->getLibStatut(5).
'</td>';
828 $totalarray[
'nbfield']++;
833 if (!empty($arrayfields[
'balance'][
'checked'])) {
834 print
'<td class="nowraponall right">';
835 print
'<a href="'.DOL_URL_ROOT.
'/compta/bank/bankentries_list.php?id='.$objecttmp->id.
'">';
836 print
'<span class="amount">'.price(
price2num($solde,
'MT'), 0, $langs, 1, -1, -1, $objecttmp->currency_code).
'</span>';
840 $totalarray[
'nbfield']++;
843 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'balance';
845 $totalarray[
'val'][
'balance'] += $solde;
850 print
'<td class="nowrap center">';
851 if ($massactionbutton || $massaction) {
853 if (in_array($objecttmp->id, $arrayofselected)) {
856 print
'<input id="cb'.$objecttmp->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objecttmp->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
860 $totalarray[
'nbfield']++;
866 if (empty($total[$objecttmp->currency_code])) {
867 $total[$objecttmp->currency_code] = $solde;
869 $total[$objecttmp->currency_code] += $solde;
878 foreach ($arrayfields as $key => $val) {
879 if (!empty($val[
'checked'])) {
883 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
887if ($lastcurrencycode !=
'various') {
889 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
892print
'</table>'.
"\n";
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage bank accounts.
Class to manage accounting accounts.
Class to manage accounting journals.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.