33require
'../../main.inc.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/compta/tva/class/tva.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/compta/sociales/class/chargesociales.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
48 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingaccount.class.php';
51 require_once DOL_DOCUMENT_ROOT.
'/accountancy/class/accountingjournal.class.php';
54 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
58$langs->loadLangs(array(
'banks',
'categories',
'accountancy',
'compta'));
60$action =
GETPOST(
'action',
'aZ09');
61$massaction =
GETPOST(
'massaction',
'alpha');
63$confirm =
GETPOST(
'confirm',
'alpha');
64$toselect =
GETPOST(
'toselect',
'array:int');
65$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'bankaccountlist';
68$search_ref =
GETPOST(
'search_ref',
'alpha');
69$search_label =
GETPOST(
'search_label',
'alpha');
70$search_number =
GETPOST(
'search_number',
'alpha');
71$search_status =
GETPOST(
'search_status',
'alpha');
72$optioncss =
GETPOST(
'optioncss',
'alpha');
74$search_category_list =
"";
76 $search_category_list =
GETPOST(
"search_category_".Categorie::TYPE_ACCOUNT.
"_list",
"array");
82 $socid = $user->socid;
85$diroutputmassaction =
$conf->bank->dir_output.
'/temp/massgeneration/'.$user->id;
88$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
89$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
91if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
95$offset = $limit * $page;
99 $sortfield =
'b.label';
108$hookmanager->initHooks(array(
'bankaccountlist'));
111$extrafields->fetch_name_optionals_label(
$object->table_element);
112$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
115$fieldstosearchall = array(
117 'b.label' =>
'Label',
120$checkedtypetiers = 0;
122 'b.ref' => array(
'label' => $langs->trans(
"BankAccounts"),
'checked' =>
'1',
'position' => 10),
123 'b.label' => array(
'label' => $langs->trans(
"Label"),
'checked' =>
'1',
'position' => 12),
124 'accountype' => array(
'label' => $langs->trans(
"Type"),
'checked' =>
'1',
'position' => 14),
125 'b.number' => array(
'label' => $langs->trans(
"AccountIdShort"),
'checked' =>
'1',
'position' => 16),
126 'b.account_number' => array(
'label' => $langs->trans(
"AccountAccounting"),
'checked' => (
string) (
int) (
isModEnabled(
'accounting')),
'position' => 18),
127 'b.fk_accountancy_journal' => array(
'label' => $langs->trans(
"AccountancyJournal"),
'checked' => (
string) (
int) (
isModEnabled(
'accounting')),
'position' => 20),
128 'toreconcile' => array(
'label' => $langs->trans(
"TransactionsToConciliate"),
'checked' =>
'1',
'position' => 50),
129 'b.currency_code' => array(
'label' => $langs->trans(
"Currency"),
'checked' =>
'0',
'position' => 22),
130 'b.datec' => array(
'label' => $langs->trans(
"DateCreation"),
'checked' =>
'0',
'position' => 500),
131 'b.tms' => array(
'label' => $langs->trans(
"DateModificationShort"),
'checked' =>
'0',
'position' => 500),
132 'b.clos' => array(
'label' => $langs->trans(
"Status"),
'checked' =>
'1',
'position' => 1000),
133 'balance' => array(
'label' => $langs->trans(
"Balance"),
'checked' =>
'1',
'position' => 1010),
136include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
141$permissiontoadd = $user->hasRight(
'banque',
'modifier');
142$permissiontodelete = $user->hasRight(
'banque',
'configurer');
145if ($user->hasRight(
'accounting',
'chartofaccount')) {
157if (
GETPOST(
'cancel',
'alpha')) {
161if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
165$parameters = array(
'socid' => $socid);
166$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
171if (empty($reshook)) {
172 include DOL_DOCUMENT_ROOT .
'/core/actions_changeselectedfields.inc.php';
175 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
180 $search_category_list = array();
184 $objectclass =
'Account';
185 $objectlabel =
'FinancialAccount';
186 $uploaddir =
$conf->bank->dir_output;
187 include DOL_DOCUMENT_ROOT .
'/core/actions_massactions.inc.php';
196$title = $langs->trans(
'BankAccounts');
197$help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
205$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_modification";
207if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
208 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
209 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
213$parameters = array();
214$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
215$sql .= $hookmanager->resPrint;
216$sql = preg_replace(
'/,\s*$/',
'', $sql);
220$sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_account as b";
221if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
222 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (b.rowid = ef.fk_object)";
224$sql .=
" WHERE b.entity IN (".getEntity(
'bank_account').
")";
225if ($search_status ===
'opened') {
226 $sql .=
" AND clos = 0";
228if ($search_status ===
'closed') {
229 $sql .=
" AND clos = 1";
231if ($search_ref !=
'') {
234if ($search_label !=
'') {
237if ($search_number !=
'') {
241$searchCategoryBankList = $search_category_list;
242$searchCategoryBankOperator = 0;
243if (!empty($searchCategoryBankList)) {
244 $searchCategoryBankSqlList = array();
245 $listofcategoryid =
'';
246 foreach ($searchCategoryBankList as $searchCategoryBank) {
247 if (intval($searchCategoryBank) == -2) {
248 $searchCategoryBankSqlList[] =
"NOT EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX.
"categorie_account as ck WHERE b.rowid = ck.fk_account)";
249 } elseif (intval($searchCategoryBank) > 0) {
250 if ($searchCategoryBankOperator == 0) {
251 $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).
")";
253 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryBank);
257 if ($listofcategoryid) {
258 $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).
"))";
260 if ($searchCategoryBankOperator == 1) {
261 if (!empty($searchCategoryBankSqlList)) {
262 $sql .=
" AND (".implode(
' OR ', $searchCategoryBankSqlList).
")";
265 if (!empty($searchCategoryBankSqlList)) {
266 $sql .=
" AND (".implode(
' AND ', $searchCategoryBankSqlList).
")";
271include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
273$parameters = array();
274$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
275$sql .= $hookmanager->resPrint;
278$nbtotalofrecords =
'';
281 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
282 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
283 $resql =
$db->query($sqlforcount);
285 $objforcount =
$db->fetch_object($resql);
286 $nbtotalofrecords = $objforcount->nbtotalofrecords;
291 if (($page * $limit) > (
int) $nbtotalofrecords) {
299$sql .=
$db->order($sortfield, $sortorder);
301 $sql .=
$db->plimit($limit + 1, $offset);
305$resql =
$db->query($sql);
307 $num =
$db->num_rows($resql);
310 $objp =
$db->fetch_object($resql);
311 $accounts[$objp->rowid] = $objp->courant;
321llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
324$arrayofselected = is_array($toselect) ? $toselect : array();
328 $param .=
'&mode='.urlencode($mode);
330if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
331 $param .=
'&contextpage='.urlencode($contextpage);
333if ($limit > 0 && $limit !=
$conf->liste_limit) {
334 $param .=
'&limit='.((int) $limit);
336if ($optioncss !=
'') {
337 $param .=
'&optioncss='.urlencode($optioncss);
339if ($search_ref !=
'') {
340 $param .=
'&search_ref='.urlencode($search_ref);
342if ($search_label !=
'') {
343 $param .=
'&search_label='.urlencode($search_label);
345if ($search_number !=
'') {
346 $param .=
'&search_number='.urlencode($search_number);
348if ($search_status !=
'' && $search_status !=
'-1') {
349 $param .=
'&search_status='.urlencode($search_status);
352 $param .=
'&show_files='.urlencode((
string) ($show_files));
355include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
357$parameters = array(
'param' => &$param);
358$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
359$param .= $hookmanager->resPrint;
362$arrayofmassactions = array(
366if (!empty($permissiontodelete)) {
367 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
369if (
isModEnabled(
'category') && $user->hasRight(
'banque',
'modifier')) {
370 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
372if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
373 $arrayofmassactions = array();
375$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
377print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
378if ($optioncss !=
'') {
379 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
381print
'<input type="hidden" name="token" value="'.newToken().
'">';
382print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
383print
'<input type="hidden" name="action" value="list">';
384print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
385print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
386print
'<input type="hidden" name="page" value="'.$page.
'">';
387print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
388print
'<input type="hidden" name="page_y" value="">';
389print
'<input type="hidden" name="search_status" value="'.$search_status.
'">';
390print
'<input type="hidden" name="mode" value="'.$mode.
'">';
394$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'));
395$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'));
396$newcardbutton .= dolGetButtonTitleSeparator();
397$newcardbutton .= dolGetButtonTitle($langs->trans(
'NewFinancialAccount'),
'',
'fa fa-plus-circle',
'card.php?action=create',
'', $user->hasRight(
'banque',
'configurer'));
399print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'bank_account', 0, $newcardbutton,
'', $limit, 1);
401$topicmail =
"Information";
404$trackid =
'bank'.$object->id;
405include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
416if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
417 $moreforfilter .= $form->getFilterBox(Categorie::TYPE_ACCOUNT, $search_category_list);
421$parameters = array();
422$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
423if (empty($reshook)) {
424 $moreforfilter .= $hookmanager->resPrint;
426 $moreforfilter = $hookmanager->resPrint;
429if (!empty($moreforfilter)) {
430 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
431 print $moreforfilter;
435$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
436$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
437$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
438$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
440print
'<div class="div-table-responsive">';
441print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
445print
'<tr class="liste_titre_filter">';
447if (
$conf->main_checkbox_left_column) {
448 print
'<td class="liste_titre center maxwidthsearch">';
449 $searchpicto = $form->showFilterButtons(
'left');
454if (!empty($arrayfields[
'b.ref'][
'checked'])) {
455 print
'<td class="liste_titre">';
456 print
'<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
460if (!empty($arrayfields[
'b.label'][
'checked'])) {
461 print
'<td class="liste_titre">';
462 print
'<input class="flat" size="6" type="text" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
466if (!empty($arrayfields[
'accountype'][
'checked'])) {
467 print
'<td class="liste_titre">';
471if (!empty($arrayfields[
'b.number'][
'checked'])) {
472 print
'<td class="liste_titre">';
473 print
'<input class="flat" size="6" type="text" name="search_number" value="'.dol_escape_htmltag($search_number).
'">';
477if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
478 print
'<td class="liste_titre">';
482if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
483 print
'<td class="liste_titre">';
487if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
488 print
'<td class="liste_titre">';
492if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
493 print
'<td class="liste_titre">';
497include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
500$parameters = array(
'arrayfields' => $arrayfields);
501$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
502print $hookmanager->resPrint;
504if (!empty($arrayfields[
'b.datec'][
'checked'])) {
505 print
'<td class="liste_titre">';
509if (!empty($arrayfields[
'b.tms'][
'checked'])) {
510 print
'<td class="liste_titre">';
514if (!empty($arrayfields[
'b.clos'][
'checked'])) {
515 print
'<td class="liste_titre center parentonrightofpage">';
517 'opened' => $langs->trans(
"Opened"),
518 'closed' => $langs->trans(
"Closed")
520 print $form->selectarray(
"search_status", $array, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'search_status minwidth75 maxwidth125 onrightofpage', 1);
524if (!empty($arrayfields[
'balance'][
'checked'])) {
525 print
'<td class="liste_titre"></td>';
528if (!
$conf->main_checkbox_left_column) {
529 print
'<td class="liste_titre center maxwidthsearch">';
530 $searchpicto = $form->showFilterButtons();
541print
'<tr class="liste_titre">';
543if (
$conf->main_checkbox_left_column) {
544 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
547if (!empty($arrayfields[
'b.ref'][
'checked'])) {
549 print_liste_field_titre($arrayfields[
'b.ref'][
'label'], $_SERVER[
"PHP_SELF"],
'b.ref',
'', $param,
'', $sortfield, $sortorder);
552if (!empty($arrayfields[
'b.label'][
'checked'])) {
553 print_liste_field_titre($arrayfields[
'b.label'][
'label'], $_SERVER[
"PHP_SELF"],
'b.label',
'', $param,
'', $sortfield, $sortorder);
556if (!empty($arrayfields[
'accountype'][
'checked'])) {
557 print_liste_field_titre($arrayfields[
'accountype'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder);
560if (!empty($arrayfields[
'b.number'][
'checked'])) {
561 print_liste_field_titre($arrayfields[
'b.number'][
'label'], $_SERVER[
"PHP_SELF"],
'b.number',
'', $param,
'', $sortfield, $sortorder);
564if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
565 print_liste_field_titre($arrayfields[
'b.account_number'][
'label'], $_SERVER[
"PHP_SELF"],
'b.account_number',
'', $param,
'', $sortfield, $sortorder);
568if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
569 print_liste_field_titre($arrayfields[
'b.fk_accountancy_journal'][
'label'], $_SERVER[
"PHP_SELF"],
'b.fk_accountancy_journal',
'', $param,
'', $sortfield, $sortorder);
572if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
573 print_liste_field_titre($arrayfields[
'b.currency_code'][
'label'], $_SERVER[
"PHP_SELF"],
'b.currency_code',
'', $param,
'', $sortfield, $sortorder,
'center ');
576if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
577 print_liste_field_titre($arrayfields[
'toreconcile'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'center ');
581include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
583$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
584$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
585print $hookmanager->resPrint;
586if (!empty($arrayfields[
'b.datec'][
'checked'])) {
587 print_liste_field_titre($arrayfields[
'b.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"b.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
590if (!empty($arrayfields[
'b.tms'][
'checked'])) {
591 print_liste_field_titre($arrayfields[
'b.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"b.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
594if (!empty($arrayfields[
'b.clos'][
'checked'])) {
595 print_liste_field_titre($arrayfields[
'b.clos'][
'label'], $_SERVER[
"PHP_SELF"],
'b.clos',
'', $param,
'', $sortfield, $sortorder,
'center ');
598if (!empty($arrayfields[
'balance'][
'checked'])) {
599 print_liste_field_titre($arrayfields[
'balance'][
'label'], $_SERVER[
"PHP_SELF"],
'',
'', $param,
'', $sortfield, $sortorder,
'right ');
603if (!
$conf->main_checkbox_left_column) {
604 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
619$lastcurrencycode =
'';
620$imaxinloop = ($limit ? min($num, $limit) : $num);
622foreach ($accounts as $key => $type) {
629 $result = $objecttmp->fetch($key);
631 $solde = $objecttmp->solde(1);
633 if (!empty($lastcurrencycode) && $lastcurrencycode != $objecttmp->currency_code) {
634 $lastcurrencycode =
'various';
636 if ($lastcurrencycode !=
'various') {
637 $lastcurrencycode = $objecttmp->currency_code;
640 if ($mode ==
'kanban') {
642 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
643 print
'<div class="box-flex-container kanban">';
647 if ($massactionbutton || $massaction) {
649 if (in_array(
$object->id, $arrayofselected)) {
654 print $objecttmp->getKanbanView(
'', array(
'selected' => $selected));
655 if ($i == ($imaxinloop - 1)) {
662 print
'<tr data-rowid="'.$objecttmp->id.
'" class="oddeven row-with-select">';
665 if (
$conf->main_checkbox_left_column) {
666 print
'<td class="nowrap center">';
667 if ($massactionbutton || $massaction) {
669 if (in_array($objecttmp->id, $arrayofselected)) {
672 print
'<input id="cb'.$objecttmp->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objecttmp->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
680 if (!empty($arrayfields[
'b.ref'][
'checked'])) {
681 print
'<td class="nowraponall">'.$objecttmp->getNomUrl(1).
'</td>';
688 if (!empty($arrayfields[
'b.label'][
'checked'])) {
689 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objecttmp->label).
'">'.
dol_escape_htmltag($objecttmp->label).
'</td>';
696 if (!empty($arrayfields[
'accountype'][
'checked'])) {
697 print
'<td class="tdoverflowmax150" title="'.dol_escape_htmltag($objecttmp->type_lib[$objecttmp->type]).
'">';
698 print $objecttmp->type_lib[$objecttmp->type];
706 if (!empty($arrayfields[
'b.number'][
'checked'])) {
707 print
'<td>'.dol_escape_htmltag($objecttmp->number).
'</td>';
714 if (!empty($arrayfields[
'b.account_number'][
'checked'])) {
715 print
'<td class="tdoverflowmax250">';
717 if (empty($objecttmp->account_number)) {
721 $accountingaccount->fetch(0, $objecttmp->account_number, 1);
722 print
'<span title="'.dol_escape_htmltag($accountingaccount->account_number.
' - '.$accountingaccount->label).
'">';
723 print $accountingaccount->getNomUrl(0, 1, 1,
'', 0);
727 print
'<span title="'.dol_escape_htmltag($objecttmp->account_number).
'">'.$objecttmp->account_number.
'</span>';
736 if (!empty($arrayfields[
'b.fk_accountancy_journal'][
'checked'])) {
738 if (empty($objecttmp->fk_accountancy_journal)) {
742 $accountingjournal->fetch($objecttmp->fk_accountancy_journal);
743 $s = $accountingjournal->getNomUrl(0, 1, 1,
'', 1);
748 print
'<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute(
dol_string_nohtmltag($s)).
'">';
757 if (!empty($arrayfields[
'b.currency_code'][
'checked'])) {
758 print
'<td class="center nowraponall">';
759 print $objecttmp->currency_code;
767 if (!empty($arrayfields[
'toreconcile'][
'checked'])) {
768 $conciliate = $objecttmp->canBeConciliated();
771 if ($conciliate == -2) {
772 $labeltoshow = $langs->trans(
"CashAccount");
773 } elseif ($conciliate == -3) {
774 $labeltoshow = $langs->trans(
"Closed");
775 } elseif (empty($objecttmp->rappro)) {
776 $labeltoshow = $langs->trans(
"ConciliationDisabled");
779 print
'<td class="center tdoverflowmax125"'.($labeltoshow ?
' title="'.dolPrintHTML($labeltoshow).
'"' :
'').
'>';
780 if ($conciliate == -2) {
781 print
'<span class="opacitymedium" title="'.$langs->trans(
"CashAccount").
'">'.$langs->trans(
"Never").
'</span>';
782 } elseif ($conciliate == -3) {
783 print
'<span class="opacitymedium" title="'.$langs->trans(
"Closed").
'">'.$langs->trans(
"Never").
'</span>';
784 } elseif (empty($objecttmp->rappro)) {
785 print
'<span class="opacitymedium" title="'.$langs->trans(
"ConciliationDisabled").
'">'.$langs->trans(
"Never").
'</span>';
787 $result = $objecttmp->load_board($user, $objecttmp->id);
788 if (is_numeric($result) && $result < 0) {
791 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='.((int) $objecttmp->id).
'&search_account='.((int) $objecttmp->id).
'&search_conciliated=0&contextpage=banktransactionlist">';
792 print
'<span class="badge badge-info classfortooltip" title="'.dol_htmlentities($langs->trans(
"TransactionsToConciliate")).
'">';
793 print $result->nbtodo;
796 if ($result->nbtodolate) {
797 print
'<span title="'.dol_htmlentities($langs->trans(
"Late")).
'" class="classfortooltip badge badge-warning marginleftonlyshort">';
798 print
'<i class="fa fa-exclamation-triangle"></i> '.$result->nbtodolate;
811 if (is_array($objecttmp->array_options)) {
813 foreach ($objecttmp->array_options as $k => $v) {
819 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
821 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &
$totalarray);
822 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $objecttmp, $action);
823 print $hookmanager->resPrint;
825 if (!empty($arrayfields[
'b.datec'][
'checked'])) {
826 print
'<td class="center nowraponall">';
834 if (!empty($arrayfields[
'b.tms'][
'checked'])) {
835 print
'<td class="center nowraponall">';
844 if (!empty($arrayfields[
'b.clos'][
'checked'])) {
845 print
'<td class="center">'.$objecttmp->getLibStatut(5).
'</td>';
852 if (!empty($arrayfields[
'balance'][
'checked'])) {
853 print
'<td class="nowraponall right">';
854 print
'<a href="'.DOL_URL_ROOT.
'/compta/bank/bankentries_list.php?id='.$objecttmp->id.
'">';
855 print
'<span class="amount">'.price(
price2num($solde,
'MT'), 0, $langs, 1, -1, -1, $objecttmp->currency_code).
'</span>';
868 if (!
$conf->main_checkbox_left_column) {
869 print
'<td class="nowrap center">';
870 if ($massactionbutton || $massaction) {
872 if (in_array($objecttmp->id, $arrayofselected)) {
875 print
'<input id="cb'.$objecttmp->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$objecttmp->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
885 if (empty($total[$objecttmp->currency_code])) {
886 $total[$objecttmp->currency_code] = $solde;
888 $total[$objecttmp->currency_code] += $solde;
897 foreach ($arrayfields as $key => $val) {
898 if (!empty($val[
'checked'])) {
902 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
906if ($lastcurrencycode !=
'various') {
908 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
911print
'</table>'.
"\n";
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage bank accounts.
Class to manage accounting accounts.
Class to manage accounting journals.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
isModEnabled($module)
Is Dolibarr module enabled.
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.