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';
55$mode =
GETPOST(
'mode',
'alpha');
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;
75if ($user->hasRight(
'accounting',
'chartofaccount')) {
82$diroutputmassaction = $conf->bank->dir_output.
'/temp/massgeneration/'.$user->id;
84$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
85$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
86$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
87$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
88if (empty($page) || $page == -1) {
91$offset = $limit * $page;
95 $sortfield =
'b.label';
104$hookmanager->initHooks(array(
'bankaccountlist'));
107$extrafields->fetch_name_optionals_label($object->table_element);
108$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
111$fieldstosearchall = array(
116$checkedtypetiers = 0;
118 'b.ref'=>array(
'label'=>$langs->trans(
"BankAccounts"),
'checked'=>1,
'position'=>10),
119 'b.label'=>array(
'label'=>$langs->trans(
"Label"),
'checked'=>1,
'position'=>12),
120 'accountype'=>array(
'label'=>$langs->trans(
"Type"),
'checked'=>1,
'position'=>14),
121 'b.number'=>array(
'label'=>$langs->trans(
"AccountIdShort"),
'checked'=>1,
'position'=>16),
122 'b.account_number'=>array(
'label'=>$langs->trans(
"AccountAccounting"),
'checked'=>(isModEnabled(
'accounting')),
'position'=>18),
123 'b.fk_accountancy_journal'=>array(
'label'=>$langs->trans(
"AccountancyJournal"),
'checked'=>(isModEnabled(
'accounting')),
'position'=>20),
124 'toreconcile'=>array(
'label'=>$langs->trans(
"TransactionsToConciliate"),
'checked'=>1,
'position'=>50),
125 'b.currency_code'=>array(
'label'=>$langs->trans(
"Currency"),
'checked'=>0,
'position'=>22),
126 'b.datec'=>array(
'label'=>$langs->trans(
"DateCreation"),
'checked'=>0,
'position'=>500),
127 'b.tms'=>array(
'label'=>$langs->trans(
"DateModificationShort"),
'checked'=>0,
'position'=>500),
128 'b.clos'=>array(
'label'=>$langs->trans(
"Status"),
'checked'=>1,
'position'=>1000),
129 'balance'=>array(
'label'=>$langs->trans(
"Balance"),
'checked'=>1,
'position'=>1010),
132include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
137$permissiontoadd = $user->rights->banque->modifier;
138$permissiontodelete = $user->rights->banque->configurer;
144if (
GETPOST(
'cancel',
'alpha')) {
148if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
152$parameters = array(
'socid'=>$socid);
153$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
158if (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')) {
167 $search_category_list = array();
171 $objectclass =
'Account';
172 $objectlabel =
'FinancialAccount';
173 $uploaddir = $conf->banque->dir_output;
174 include DOL_DOCUMENT_ROOT .
'/core/actions_massactions.inc.php';
183$title = $langs->trans(
'BankAccounts');
188$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";
190if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
191 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
192 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
196$parameters = array();
197$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
198$sql .= $hookmanager->resPrint;
202$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account as b";
203if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
204 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (b.rowid = ef.fk_object)";
206$sql .=
" WHERE b.entity IN (".getEntity(
'bank_account').
")";
207if ($search_status ==
'opened') {
208 $sql .=
" AND clos = 0";
210if ($search_status ==
'closed') {
211 $sql .=
" AND clos = 1";
213if ($search_ref !=
'') {
216if ($search_label !=
'') {
219if ($search_number !=
'') {
223$searchCategoryBankList = $search_category_list;
224$searchCategoryBankOperator = 0;
225if (!empty($searchCategoryBankList)) {
226 $searchCategoryBankSqlList = array();
227 $listofcategoryid =
'';
228 foreach ($searchCategoryBankList as $searchCategoryBank) {
229 if (intval($searchCategoryBank) == -2) {
230 $searchCategoryBankSqlList[] =
"NOT EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX.
"categorie_account as ck WHERE b.rowid = ck.fk_account)";
231 } elseif (intval($searchCategoryBank) > 0) {
232 if ($searchCategoryBankOperator == 0) {
233 $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).
")";
235 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryBank);
239 if ($listofcategoryid) {
240 $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).
"))";
242 if ($searchCategoryBankOperator == 1) {
243 if (!empty($searchCategoryBankSqlList)) {
244 $sql .=
" AND (".implode(
' OR ', $searchCategoryBankSqlList).
")";
247 if (!empty($searchCategoryBankSqlList)) {
248 $sql .=
" AND (".implode(
' AND ', $searchCategoryBankSqlList).
")";
253include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
255$parameters = array();
256$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
257$sql .= $hookmanager->resPrint;
260$nbtotalofrecords =
'';
263 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
264 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
265 $resql = $db->query($sqlforcount);
267 $objforcount = $db->fetch_object($resql);
268 $nbtotalofrecords = $objforcount->nbtotalofrecords;
273 if (($page * $limit) > $nbtotalofrecords) {
280$sql .= $db->order($sortfield, $sortorder);
282 $sql .= $db->plimit($limit + 1, $offset);
285$resql = $db->query($sql);
287 $num = $db->num_rows($resql);
290 $objp = $db->fetch_object($resql);
291 $accounts[$objp->rowid] = $objp->courant;
301$help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
306$arrayofselected = is_array($toselect) ? $toselect : array();
310 $param .=
'&mode='.urlencode($mode);
312if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
313 $param .=
'&contextpage='.urlencode($contextpage);
315if ($limit > 0 && $limit != $conf->liste_limit) {
316 $param .=
'&limit='.((int) $limit);
318if ($search_ref !=
'') {
319 $param .=
'&search_ref='.urlencode($search_ref);
321if ($search_label !=
'') {
322 $param .=
'&search_label='.urlencode($search_label);
324if ($search_number !=
'') {
325 $param .=
'&search_number='.urlencode($search_number);
327if ($search_status !=
'') {
328 $param .=
'&search_status='.urlencode($search_status);
331 $param .=
'&show_files='.urlencode($show_files);
333if ($optioncss !=
'') {
334 $param .=
'&optioncss='.urlencode($optioncss);
337include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
339$parameters = array();
340$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
341$param .= $hookmanager->resPrint;
344$arrayofmassactions = array(
348if ($permissiontodelete) {
349 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
351if (isModEnabled(
'category') && $user->rights->banque->modifier) {
352 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
354if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
355 $arrayofmassactions = array();
357$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
359print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
360if ($optioncss !=
'') {
361 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
363print
'<input type="hidden" name="token" value="'.newToken().
'">';
364print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
365print
'<input type="hidden" name="action" value="list">';
366print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
367print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
368print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
370print
'<input type="hidden" name="page" value="'.$page.
'">';
371print
'<input type="hidden" name="search_status" value="'.$search_status.
'">';
372print
'<input type="hidden" name="mode" value="'.$mode.
'">';
376$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'));
377$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'));
378$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewFinancialAccount'),
'',
'fa fa-plus-circle',
'card.php?action=create',
'', $user->rights->banque->configurer);
380print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit, 1);
382$topicmail =
"Information";
385$trackid =
'bank'.$object->id;
386include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
397if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire')) {
398 $moreforfilter .= $form->getFilterBox(Categorie::TYPE_ACCOUNT, $search_category_list);
402$parameters = array();
403$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
404if (empty($reshook)) {
405 $moreforfilter .= $hookmanager->resPrint;
407 $moreforfilter = $hookmanager->resPrint;
410if (!empty($moreforfilter)) {
411 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
412 print $moreforfilter;
416$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
417$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
418$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
420print
'<div class="div-table-responsive">';
421print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
425print
'<tr class="liste_titre_filter">';
428 print
'<td class="liste_titre maxwidthsearch">';
429 $searchpicto = $form->showFilterButtons(
'left');
434if (!empty($arrayfields[
'b.ref'][
'checked'])) {
435 print
'<td class="liste_titre">';
436 print
'<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
440if (!empty($arrayfields[
'b.label'][
'checked'])) {
441 print
'<td class="liste_titre">';
442 print
'<input class="flat" size="6" type="text" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
446if (!empty($arrayfields[
'accountype'][
'checked'])) {
447 print
'<td class="liste_titre">';
451if (!empty($arrayfields[
'b.number'][
'checked'])) {
452 print
'<td class="liste_titre">';
453 print
'<input class="flat" size="6" type="text" name="search_number" value="'.dol_escape_htmltag($search_number).
'">';
457if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
458 print
'<td class="liste_titre">';
462if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
463 print
'<td class="liste_titre">';
467if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
468 print
'<td class="liste_titre">';
472if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
473 print
'<td class="liste_titre">';
477include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
480$parameters = array(
'arrayfields'=>$arrayfields);
481$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
482print $hookmanager->resPrint;
484if (!empty($arrayfields[
'b.datec'][
'checked'])) {
485 print
'<td class="liste_titre">';
489if (!empty($arrayfields[
'b.tms'][
'checked'])) {
490 print
'<td class="liste_titre">';
494if (!empty($arrayfields[
'b.clos'][
'checked'])) {
495 print
'<td class="liste_titre center parentonrightofpage">';
497 'opened'=>$langs->trans(
"Opened"),
498 'closed'=>$langs->trans(
"Closed")
500 print $form->selectarray(
"search_status", $array, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'search_status minwidth75 maxwidth125 onrightofpage', 1);
504if (!empty($arrayfields[
'balance'][
'checked'])) {
505 print
'<td class="liste_titre"></td>';
509 print
'<td class="liste_titre maxwidthsearch">';
510 $searchpicto = $form->showFilterButtons();
516$totalarray = array();
517$totalarray[
'nbfield'] = 0;
521print
'<tr class="liste_titre">';
523 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
524 $totalarray[
'nbfield']++;
526if (!empty($arrayfields[
'b.ref'][
'checked'])) {
527 print_liste_field_titre($arrayfields[
'b.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'b.ref',
'', $param,
'', $sortfield, $sortorder);
528 $totalarray[
'nbfield']++;
530if (!empty($arrayfields[
'b.label'][
'checked'])) {
531 print_liste_field_titre($arrayfields[
'b.label'][
'label'], $_SERVER[
"PHP_SELF"],
'b.label',
'', $param,
'', $sortfield, $sortorder);
532 $totalarray[
'nbfield']++;
534if (!empty($arrayfields[
'accountype'][
'checked'])) {
535 print_liste_field_titre($arrayfields[
'accountype'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder);
536 $totalarray[
'nbfield']++;
538if (!empty($arrayfields[
'b.number'][
'checked'])) {
539 print_liste_field_titre($arrayfields[
'b.number'][
'label'], $_SERVER[
"PHP_SELF"],
'b.number',
'', $param,
'', $sortfield, $sortorder);
540 $totalarray[
'nbfield']++;
542if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
543 print_liste_field_titre($arrayfields[
'b.account_number'][
'label'], $_SERVER[
"PHP_SELF"],
'b.account_number',
'', $param,
'', $sortfield, $sortorder);
544 $totalarray[
'nbfield']++;
546if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
547 print_liste_field_titre($arrayfields[
'b.fk_accountancy_journal'][
'label'], $_SERVER[
"PHP_SELF"],
'b.fk_accountancy_journal',
'', $param,
'', $sortfield, $sortorder);
548 $totalarray[
'nbfield']++;
550if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
551 print_liste_field_titre($arrayfields[
'b.currency_code'][
'label'], $_SERVER[
"PHP_SELF"],
'b.currency_code',
'', $param,
'', $sortfield, $sortorder,
'center ');
552 $totalarray[
'nbfield']++;
554if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
555 print_liste_field_titre($arrayfields[
'toreconcile'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
556 $totalarray[
'nbfield']++;
559include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
561$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
562$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
563print $hookmanager->resPrint;
564if (!empty($arrayfields[
'b.datec'][
'checked'])) {
565 print_liste_field_titre($arrayfields[
'b.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"b.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
566 $totalarray[
'nbfield']++;
568if (!empty($arrayfields[
'b.tms'][
'checked'])) {
569 print_liste_field_titre($arrayfields[
'b.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"b.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
570 $totalarray[
'nbfield']++;
572if (!empty($arrayfields[
'b.clos'][
'checked'])) {
573 print_liste_field_titre($arrayfields[
'b.clos'][
'label'], $_SERVER[
"PHP_SELF"],
'b.clos',
'', $param,
'', $sortfield, $sortorder,
'center ');
574 $totalarray[
'nbfield']++;
576if (!empty($arrayfields[
'balance'][
'checked'])) {
577 print_liste_field_titre($arrayfields[
'balance'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
578 $totalarray[
'nbfield']++;
581 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
582 $totalarray[
'nbfield']++;
587$savnbfield = $totalarray[
'nbfield'];
588$totalarray = array();
589$totalarray[
'nbfield'] = 0;
590$totalarray[
'val'] = array(
'balance'=>0);
594$lastcurrencycode =
'';
595$imaxinloop = ($limit ? min($num, $limit) : $num);
597foreach ($accounts as $key => $type) {
604 $result = $objecttmp->fetch($key);
606 $solde = $objecttmp->solde(1);
608 if (!empty($lastcurrencycode) && $lastcurrencycode != $objecttmp->currency_code) {
609 $lastcurrencycode =
'various';
611 if ($lastcurrencycode !=
'various') {
612 $lastcurrencycode = $objecttmp->currency_code;
615 if ($mode ==
'kanban') {
617 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
618 print
'<div class="box-flex-container kanban">';
621 print $objecttmp->getKanbanView(
'', array(
'selected' => in_array($object->id, $arrayofselected)));
622 if ($i == ($imaxinloop - 1)) {
627 print
'<tr class="oddeven">';
630 print
'<td class="nowrap center">';
631 if ($massactionbutton || $massaction) {
633 if (in_array($objecttmp->id, $arrayofselected)) {
636 print
'<input id="cb'.$objecttmp->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objecttmp->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
641 if (!empty($arrayfields[
'b.ref'][
'checked'])) {
642 print
'<td class="nowraponall">'.$objecttmp->getNomUrl(1).
'</td>';
644 $totalarray[
'nbfield']++;
649 if (!empty($arrayfields[
'b.label'][
'checked'])) {
650 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objecttmp->label).
'">'.
dol_escape_htmltag($objecttmp->label).
'</td>';
652 $totalarray[
'nbfield']++;
657 if (!empty($arrayfields[
'accountype'][
'checked'])) {
658 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($objecttmp->type_lib[$objecttmp->type]).
'">';
659 print $objecttmp->type_lib[$objecttmp->type];
662 $totalarray[
'nbfield']++;
667 if (!empty($arrayfields[
'b.number'][
'checked'])) {
668 print
'<td>'.dol_escape_htmltag($objecttmp->number).
'</td>';
670 $totalarray[
'nbfield']++;
675 if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
676 print
'<td class="tdoverflowmax250">';
677 if (isModEnabled(
'accounting') && !empty($objecttmp->account_number)) {
679 $accountingaccount->fetch(
'', $objecttmp->account_number, 1);
680 print
'<span title="'.dol_escape_htmltag($accountingaccount->account_number.
' - '.$accountingaccount->label).
'">';
681 print $accountingaccount->getNomUrl(0, 1, 1,
'', 0);
684 print
'<span title="'.dol_escape_htmltag($objecttmp->account_number).
'">'.$objecttmp->account_number.
'</span>';
688 $totalarray[
'nbfield']++;
693 if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
694 print
'<td class="tdoverflowmax125">';
695 if (isModEnabled(
'accounting')) {
696 if (empty($objecttmp->fk_accountancy_journal)) {
700 $accountingjournal->fetch($objecttmp->fk_accountancy_journal);
701 print $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
708 $totalarray[
'nbfield']++;
713 if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
714 print
'<td class="center nowraponall">';
715 print $objecttmp->currency_code;
718 $totalarray[
'nbfield']++;
723 if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
724 $conciliate = $objecttmp->canBeConciliated();
727 if ($conciliate == -2) {
728 $labeltoshow = $langs->trans(
"CashAccount");
729 } elseif ($conciliate == -3) {
730 $labeltoshow = $langs->trans(
"Closed");
731 } elseif (empty($objecttmp->rappro)) {
732 $labeltoshow = $langs->trans(
"ConciliationDisabled");
735 print
'<td class="center tdoverflowmax125"'.($labeltoshow ?
' title="'.dol_escape_htmltag($labeltoshow).
'"' :
'').
'>';
736 if ($conciliate == -2) {
737 print
'<span class="opacitymedium">'.$langs->trans(
"CashAccount").
'</span>';
738 } elseif ($conciliate == -3) {
739 print
'<span class="opacitymedium">'.$langs->trans(
"Closed").
'</span>';
740 } elseif (empty($objecttmp->rappro)) {
741 print
'<span class="opacitymedium">'.$langs->trans(
"ConciliationDisabled").
'</span>';
743 $result = $objecttmp->load_board($user, $objecttmp->id);
744 if (is_numeric($result) && $result < 0) {
747 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">';
748 print
'<span class="badge badge-info classfortooltip" title="'.dol_htmlentities($langs->trans(
"TransactionsToConciliate")).
'">';
749 print $result->nbtodo;
752 if ($result->nbtodolate) {
753 print
'<span title="'.dol_htmlentities($langs->trans(
"Late")).
'" class="classfortooltip badge badge-danger marginleftonlyshort">';
754 print
'<i class="fa fa-exclamation-triangle"></i> '.$result->nbtodolate;
762 $totalarray[
'nbfield']++;
767 if (is_array($objecttmp->array_options)) {
768 $obj =
new stdClass();
769 foreach ($objecttmp->array_options as $k => $v) {
773 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
775 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
776 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $objecttmp, $action);
777 print $hookmanager->resPrint;
779 if (!empty($arrayfields[
'b.datec'][
'checked'])) {
780 print
'<td class="center nowraponall">';
784 $totalarray[
'nbfield']++;
788 if (!empty($arrayfields[
'b.tms'][
'checked'])) {
789 print
'<td class="center nowraponall">';
793 $totalarray[
'nbfield']++;
798 if (!empty($arrayfields[
'b.clos'][
'checked'])) {
799 print
'<td class="center">'.$objecttmp->getLibStatut(5).
'</td>';
801 $totalarray[
'nbfield']++;
806 if (!empty($arrayfields[
'balance'][
'checked'])) {
807 print
'<td class="nowraponall right">';
808 print
'<a href="'.DOL_URL_ROOT.
'/compta/bank/bankentries_list.php?id='.$objecttmp->id.
'">';
809 print
'<span class="amount">'.price(
price2num($solde,
'MT'), 0, $langs, 1, -1, -1, $objecttmp->currency_code).
'</span>';
813 $totalarray[
'nbfield']++;
816 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'balance';
818 $totalarray[
'val'][
'balance'] += $solde;
823 print
'<td class="nowrap center">';
824 if ($massactionbutton || $massaction) {
826 if (in_array($objecttmp->id, $arrayofselected)) {
829 print
'<input id="cb'.$objecttmp->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objecttmp->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
834 $totalarray[
'nbfield']++;
839 if (empty($total[$objecttmp->currency_code])) {
840 $total[$objecttmp->currency_code] = $solde;
842 $total[$objecttmp->currency_code] += $solde;
851 foreach ($arrayfields as $key => $val) {
852 if (!empty($val[
'checked'])) {
856 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
860if ($lastcurrencycode !=
'various') {
862 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
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 accounts.
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 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.
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.