30 require
'../../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/tva.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
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';
56 $search_ref =
GETPOST(
'search_ref',
'alpha');
57 $search_label =
GETPOST(
'search_label',
'alpha');
58 $search_number =
GETPOST(
'search_number',
'alpha');
59 $search_status =
GETPOST(
'search_status') ?
GETPOST(
'search_status',
'alpha') :
'opened';
60 $optioncss =
GETPOST(
'optioncss',
'alpha');
62 $search_category_list =
"";
64 $search_category_list =
GETPOST(
"search_category_".Categorie::TYPE_ACCOUNT.
"_list",
"array");
70 $socid = $user->socid;
74 if ($user->hasRight(
'accounting',
'chartofaccount')) {
81 $diroutputmassaction = $conf->bank->dir_output.
'/temp/massgeneration/'.$user->id;
83 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
84 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
85 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
87 if (empty($page) || $page == -1) {
90 $offset = $limit * $page;
91 $pageprev = $page - 1;
92 $pagenext = $page + 1;
94 $sortfield =
'b.label';
103 $hookmanager->initHooks(array(
'bankaccountlist'));
106 $extrafields->fetch_name_optionals_label($object->table_element);
107 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
110 $fieldstosearchall = array(
115 $checkedtypetiers = 0;
116 $arrayfields = array(
117 'b.ref'=>array(
'label'=>$langs->trans(
"BankAccounts"),
'checked'=>1,
'position'=>10),
118 'b.label'=>array(
'label'=>$langs->trans(
"Label"),
'checked'=>1,
'position'=>12),
119 'accountype'=>array(
'label'=>$langs->trans(
"Type"),
'checked'=>1,
'position'=>14),
120 'b.number'=>array(
'label'=>$langs->trans(
"AccountIdShort"),
'checked'=>1,
'position'=>16),
121 'b.account_number'=>array(
'label'=>$langs->trans(
"AccountAccounting"),
'checked'=>(
isModEnabled(
'accounting')),
'position'=>18),
122 'b.fk_accountancy_journal'=>array(
'label'=>$langs->trans(
"AccountancyJournal"),
'checked'=>(
isModEnabled(
'accounting')),
'position'=>20),
123 'toreconcile'=>array(
'label'=>$langs->trans(
"TransactionsToConciliate"),
'checked'=>1,
'position'=>50),
124 'b.currency_code'=>array(
'label'=>$langs->trans(
"Currency"),
'checked'=>0,
'position'=>22),
125 'b.datec'=>array(
'label'=>$langs->trans(
"DateCreation"),
'checked'=>0,
'position'=>500),
126 'b.tms'=>array(
'label'=>$langs->trans(
"DateModificationShort"),
'checked'=>0,
'position'=>500),
127 'b.clos'=>array(
'label'=>$langs->trans(
"Status"),
'checked'=>1,
'position'=>1000),
128 'balance'=>array(
'label'=>$langs->trans(
"Balance"),
'checked'=>1,
'position'=>1010),
131 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
136 $permissiontoadd = $user->rights->banque->modifier;
137 $permissiontodelete = $user->rights->banque->configurer;
143 if (
GETPOST(
'cancel',
'alpha')) {
147 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
151 $parameters = array(
'socid'=>$socid);
152 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
157 if (empty($reshook)) {
158 include DOL_DOCUMENT_ROOT .
'/core/actions_changeselectedfields.inc.php';
161 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
166 $search_category_list = array();
170 $objectclass =
'Account';
171 $objectlabel =
'FinancialAccount';
172 $uploaddir = $conf->banque->dir_output;
173 include DOL_DOCUMENT_ROOT .
'/core/actions_massactions.inc.php';
182 $title = $langs->trans(
'BankAccounts');
187 $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";
189 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
190 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
191 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
195 $parameters = array();
196 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
197 $sql .= $hookmanager->resPrint;
201 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account as b";
202 if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
203 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (b.rowid = ef.fk_object)";
205 $sql .=
" WHERE b.entity IN (".getEntity(
'bank_account').
")";
206 if ($search_status ==
'opened') {
207 $sql .=
" AND clos = 0";
209 if ($search_status ==
'closed') {
210 $sql .=
" AND clos = 1";
212 if ($search_ref !=
'') {
215 if ($search_label !=
'') {
218 if ($search_number !=
'') {
222 $searchCategoryBankList = $search_category_list;
223 $searchCategoryBankOperator = 0;
224 if (!empty($searchCategoryBankList)) {
225 $searchCategoryBankSqlList = array();
226 $listofcategoryid =
'';
227 foreach ($searchCategoryBankList as $searchCategoryBank) {
228 if (intval($searchCategoryBank) == -2) {
229 $searchCategoryBankSqlList[] =
"NOT EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX.
"categorie_account as ck WHERE b.rowid = ck.fk_account)";
230 } elseif (intval($searchCategoryBank) > 0) {
231 if ($searchCategoryBankOperator == 0) {
232 $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).
")";
234 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryBank);
238 if ($listofcategoryid) {
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 IN (".$db->sanitize($listofcategoryid).
"))";
241 if ($searchCategoryBankOperator == 1) {
242 if (!empty($searchCategoryBankSqlList)) {
243 $sql .=
" AND (".implode(
' OR ', $searchCategoryBankSqlList).
")";
246 if (!empty($searchCategoryBankSqlList)) {
247 $sql .=
" AND (".implode(
' AND ', $searchCategoryBankSqlList).
")";
252 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
254 $parameters = array();
255 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
256 $sql .= $hookmanager->resPrint;
260 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
262 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
263 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
264 $resql = $db->query($sqlforcount);
266 $objforcount = $db->fetch_object(
$resql);
279 $sql .= $db->order($sortfield, $sortorder);
281 $sql .= $db->plimit($limit + 1, $offset);
284 $resql = $db->query($sql);
286 $num = $db->num_rows(
$resql);
289 $objp = $db->fetch_object(
$resql);
290 $accounts[$objp->rowid] = $objp->courant;
300 $help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
305 $arrayofselected = is_array($toselect) ? $toselect : array();
308 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
309 $param .=
'&contextpage='.urlencode($contextpage);
311 if ($limit > 0 && $limit != $conf->liste_limit) {
312 $param .=
'&limit='.urlencode($limit);
314 if ($search_ref !=
'') {
315 $param .=
'&search_ref='.urlencode($search_ref);
317 if ($search_label !=
'') {
318 $param .=
'&search_label='.urlencode($search_label);
320 if ($search_number !=
'') {
321 $param .=
'&search_number='.urlencode($search_number);
323 if ($search_status !=
'') {
324 $param .=
'&search_status='.urlencode($search_status);
327 $param .=
'&show_files='.urlencode($show_files);
329 if ($optioncss !=
'') {
330 $param .=
'&optioncss='.urlencode($optioncss);
333 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
335 $parameters = array();
336 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
337 $param .= $hookmanager->resPrint;
340 $arrayofmassactions = array(
344 if ($permissiontodelete) {
345 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
347 if (
isModEnabled(
'category') && $user->rights->banque->modifier) {
348 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
350 if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
351 $arrayofmassactions = array();
353 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
355 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
356 if ($optioncss !=
'') {
357 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
359 print
'<input type="hidden" name="token" value="'.newToken().
'">';
360 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
361 print
'<input type="hidden" name="action" value="list">';
362 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
363 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
364 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
366 print
'<input type="hidden" name="page" value="'.$page.
'">';
367 print
'<input type="hidden" name="search_status" value="'.$search_status.
'">';
369 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewFinancialAccount'),
'',
'fa fa-plus-circle',
'card.php?action=create',
'', $user->rights->banque->configurer);
371 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit, 1);
373 $topicmail =
"Information";
376 $trackid =
'bank'.$object->id;
377 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
388 if (
isModEnabled(
'categorie') && $user->rights->categorie->lire) {
389 $moreforfilter .=
$form->getFilterBox(Categorie::TYPE_ACCOUNT, $search_category_list);
393 $parameters = array();
394 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
395 if (empty($reshook)) {
396 $moreforfilter .= $hookmanager->resPrint;
398 $moreforfilter = $hookmanager->resPrint;
401 if (!empty($moreforfilter)) {
402 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
403 print $moreforfilter;
407 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
408 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
409 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
411 print
'<div class="div-table-responsive">';
412 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
416 print
'<tr class="liste_titre">';
419 print
'<td class="liste_titre maxwidthsearch">';
420 $searchpicto =
$form->showFilterButtons(
'left');
425 if (!empty($arrayfields[
'b.ref'][
'checked'])) {
426 print
'<td class="liste_titre">';
427 print
'<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
431 if (!empty($arrayfields[
'b.label'][
'checked'])) {
432 print
'<td class="liste_titre">';
433 print
'<input class="flat" size="6" type="text" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
437 if (!empty($arrayfields[
'accountype'][
'checked'])) {
438 print
'<td class="liste_titre">';
442 if (!empty($arrayfields[
'b.number'][
'checked'])) {
443 print
'<td class="liste_titre">';
444 print
'<input class="flat" size="6" type="text" name="search_number" value="'.dol_escape_htmltag($search_number).
'">';
448 if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
449 print
'<td class="liste_titre">';
453 if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
454 print
'<td class="liste_titre">';
458 if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
459 print
'<td class="liste_titre">';
463 if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
464 print
'<td class="liste_titre">';
468 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
471 $parameters = array(
'arrayfields'=>$arrayfields);
472 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
473 print $hookmanager->resPrint;
475 if (!empty($arrayfields[
'b.datec'][
'checked'])) {
476 print
'<td class="liste_titre">';
480 if (!empty($arrayfields[
'b.tms'][
'checked'])) {
481 print
'<td class="liste_titre">';
485 if (!empty($arrayfields[
'b.clos'][
'checked'])) {
486 print
'<td class="liste_titre center">';
488 'opened'=>$langs->trans(
"Opened"),
489 'closed'=>$langs->trans(
"Closed")
491 print
$form->selectarray(
"search_status", $array, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'search_status maxwidth125 onrightofpage', 1);
495 if (!empty($arrayfields[
'balance'][
'checked'])) {
496 print
'<td class="liste_titre"></td>';
500 print
'<td class="liste_titre maxwidthsearch">';
501 $searchpicto =
$form->showFilterButtons();
509 print
'<tr class="liste_titre">';
511 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
513 if (!empty($arrayfields[
'b.ref'][
'checked'])) {
514 print_liste_field_titre($arrayfields[
'b.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'b.ref',
'', $param,
'', $sortfield, $sortorder);
516 if (!empty($arrayfields[
'b.label'][
'checked'])) {
517 print_liste_field_titre($arrayfields[
'b.label'][
'label'], $_SERVER[
"PHP_SELF"],
'b.label',
'', $param,
'', $sortfield, $sortorder);
519 if (!empty($arrayfields[
'accountype'][
'checked'])) {
520 print_liste_field_titre($arrayfields[
'accountype'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder);
522 if (!empty($arrayfields[
'b.number'][
'checked'])) {
523 print_liste_field_titre($arrayfields[
'b.number'][
'label'], $_SERVER[
"PHP_SELF"],
'b.number',
'', $param,
'', $sortfield, $sortorder);
525 if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
526 print_liste_field_titre($arrayfields[
'b.account_number'][
'label'], $_SERVER[
"PHP_SELF"],
'b.account_number',
'', $param,
'', $sortfield, $sortorder);
528 if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
529 print_liste_field_titre($arrayfields[
'b.fk_accountancy_journal'][
'label'], $_SERVER[
"PHP_SELF"],
'b.fk_accountancy_journal',
'', $param,
'', $sortfield, $sortorder);
531 if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
532 print_liste_field_titre($arrayfields[
'b.currency_code'][
'label'], $_SERVER[
"PHP_SELF"],
'b.currency_code',
'', $param,
'', $sortfield, $sortorder,
'center ');
534 if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
535 print_liste_field_titre($arrayfields[
'toreconcile'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
538 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
540 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
541 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
542 print $hookmanager->resPrint;
543 if (!empty($arrayfields[
'b.datec'][
'checked'])) {
544 print_liste_field_titre($arrayfields[
'b.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"b.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
546 if (!empty($arrayfields[
'b.tms'][
'checked'])) {
547 print_liste_field_titre($arrayfields[
'b.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"b.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
549 if (!empty($arrayfields[
'b.clos'][
'checked'])) {
550 print_liste_field_titre($arrayfields[
'b.clos'][
'label'], $_SERVER[
"PHP_SELF"],
'b.clos',
'', $param,
'', $sortfield, $sortorder,
'center ');
552 if (!empty($arrayfields[
'balance'][
'checked'])) {
553 print_liste_field_titre($arrayfields[
'balance'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
556 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
561 $totalarray = array();
562 $totalarray[
'nbfield'] = 0;
563 $totalarray[
'val'] = array(
'balance'=>0);
567 $lastcurrencycode =
'';
569 foreach ($accounts as $key => $type) {
576 $result = $objecttmp->fetch($key);
578 $solde = $objecttmp->solde(1);
580 if (!empty($lastcurrencycode) && $lastcurrencycode != $objecttmp->currency_code) {
581 $lastcurrencycode =
'various';
583 if ($lastcurrencycode !=
'various') {
584 $lastcurrencycode = $objecttmp->currency_code;
587 print
'<tr class="oddeven">';
590 print
'<td class="nowrap center">';
591 if ($massactionbutton || $massaction) {
593 if (in_array($objecttmp->id, $arrayofselected)) {
596 print
'<input id="cb'.$objecttmp->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objecttmp->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
601 if (!empty($arrayfields[
'b.ref'][
'checked'])) {
602 print
'<td class="nowraponall">'.$objecttmp->getNomUrl(1).
'</td>';
604 $totalarray[
'nbfield']++;
609 if (!empty($arrayfields[
'b.label'][
'checked'])) {
610 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objecttmp->label).
'">'.
dol_escape_htmltag($objecttmp->label).
'</td>';
612 $totalarray[
'nbfield']++;
617 if (!empty($arrayfields[
'accountype'][
'checked'])) {
618 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($objecttmp->type_lib[$objecttmp->type]).
'">';
619 print $objecttmp->type_lib[$objecttmp->type];
622 $totalarray[
'nbfield']++;
627 if (!empty($arrayfields[
'b.number'][
'checked'])) {
628 print
'<td>'.dol_escape_htmltag($objecttmp->number).
'</td>';
630 $totalarray[
'nbfield']++;
635 if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
636 print
'<td class="tdoverflowmax250">';
637 if (
isModEnabled(
'accounting') && !empty($objecttmp->account_number)) {
639 $accountingaccount->fetch(
'', $objecttmp->account_number, 1);
640 print
'<span title="'.dol_escape_htmltag($accountingaccount->account_number.
' - '.$accountingaccount->label).
'">';
641 print $accountingaccount->getNomUrl(0, 1, 1,
'', 0);
644 print
'<span title="'.dol_escape_htmltag($objecttmp->account_number).
'">'.$objecttmp->account_number.
'</span>';
648 $totalarray[
'nbfield']++;
653 if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
654 print
'<td class="tdoverflowmax125">';
656 if (empty($objecttmp->fk_accountancy_journal)) {
660 $accountingjournal->fetch($objecttmp->fk_accountancy_journal);
661 print $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
668 $totalarray[
'nbfield']++;
673 if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
674 print
'<td class="center nowraponall">';
675 print $objecttmp->currency_code;
678 $totalarray[
'nbfield']++;
683 if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
684 $conciliate = $objecttmp->canBeConciliated();
687 if ($conciliate == -2) {
688 $labeltoshow = $langs->trans(
"CashAccount");
689 } elseif ($conciliate == -3) {
690 $labeltoshow = $langs->trans(
"Closed");
691 } elseif (empty($objecttmp->rappro)) {
692 $labeltoshow = $langs->trans(
"ConciliationDisabled");
695 print
'<td class="center tdoverflowmax125"'.($labeltoshow ?
' title="'.dol_escape_htmltag($labeltoshow).
'"' :
'').
'>';
696 if ($conciliate == -2) {
697 print
'<span class="opacitymedium">'.$langs->trans(
"CashAccount").
'</span>';
698 } elseif ($conciliate == -3) {
699 print
'<span class="opacitymedium">'.$langs->trans(
"Closed").
'</span>';
700 } elseif (empty($objecttmp->rappro)) {
701 print
'<span class="opacitymedium">'.$langs->trans(
"ConciliationDisabled").
'</span>';
703 $result = $objecttmp->load_board($user, $objecttmp->id);
704 if (is_numeric($result) && $result < 0) {
707 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">';
708 print
'<span class="badge badge-info classfortooltip" title="'.dol_htmlentities($langs->trans(
"TransactionsToConciliate")).
'">';
709 print $result->nbtodo;
712 if ($result->nbtodolate) {
713 print
'<span title="'.dol_htmlentities($langs->trans(
"Late")).
'" class="classfortooltip badge badge-danger marginleftonlyshort">';
714 print
'<i class="fa fa-exclamation-triangle"></i> '.$result->nbtodolate;
722 $totalarray[
'nbfield']++;
727 if (is_array($objecttmp->array_options)) {
728 $obj =
new stdClass();
729 foreach ($objecttmp->array_options as $k => $v) {
733 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
735 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
736 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $objecttmp, $action);
737 print $hookmanager->resPrint;
739 if (!empty($arrayfields[
'b.datec'][
'checked'])) {
740 print
'<td class="center nowraponall">';
744 $totalarray[
'nbfield']++;
748 if (!empty($arrayfields[
'b.tms'][
'checked'])) {
749 print
'<td class="center nowraponall">';
753 $totalarray[
'nbfield']++;
758 if (!empty($arrayfields[
'b.clos'][
'checked'])) {
759 print
'<td class="center">'.$objecttmp->getLibStatut(5).
'</td>';
761 $totalarray[
'nbfield']++;
766 if (!empty($arrayfields[
'balance'][
'checked'])) {
767 print
'<td class="nowraponall right">';
768 print
'<a href="'.DOL_URL_ROOT.
'/compta/bank/bankentries_list.php?id='.$objecttmp->id.
'">';
769 print
'<span class="amount">'.price($solde, 0, $langs, 1, -1, -1, $objecttmp->currency_code).
'</span>';
773 $totalarray[
'nbfield']++;
776 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'balance';
778 $totalarray[
'val'][
'balance'] += $solde;
783 print
'<td class="nowrap center">';
784 if ($massactionbutton || $massaction) {
786 if (in_array($objecttmp->id, $arrayofselected)) {
789 print
'<input id="cb'.$objecttmp->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objecttmp->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
794 $totalarray[
'nbfield']++;
799 if (empty($total[$objecttmp->currency_code])) {
800 $total[$objecttmp->currency_code] = $solde;
802 $total[$objecttmp->currency_code] += $solde;
811 foreach ($arrayfields as $key => $val) {
812 if (!empty($val[
'checked'])) {
816 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
820 if ($lastcurrencycode !=
'various') {
822 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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.
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
$nbtotalofrecords
Count total nb of records.
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.