From 018cfdf54b7301df2682f03c7a8f8a35e94fd361 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Apr 2020 16:14:37 +0200 Subject: [PATCH] FIX Field balance before and after sometimes not visible in bank entries --- htdocs/compta/bank/bankentries_list.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 43cfdef0b62..7b531d31bc0 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -108,14 +108,6 @@ $pagenext = $page + 1; if (!$sortorder) $sortorder = 'desc,desc,desc'; if (!$sortfield) $sortfield = 'b.datev,b.dateo,b.rowid'; -$mode_balance_ok = false; -//if (($sortfield == 'b.datev' || $sortfield == 'b.datev,b.dateo,b.rowid')) // TODO Manage balance when account not selected -if (($sortfield == 'b.datev' || $sortfield == 'b.datev,b.dateo,b.rowid')) -{ - $sortfield = 'b.datev,b.dateo,b.rowid'; - if ($id > 0 || !empty($ref) || $search_account > 0) $mode_balance_ok = true; -} - $object = new Account($db); if ($id > 0 || !empty($ref)) { @@ -130,6 +122,13 @@ if ($id > 0 || !empty($ref)) } } +$mode_balance_ok = false; +//if (($sortfield == 'b.datev' || $sortfield == 'b.datev,b.dateo,b.rowid')) // TODO Manage balance when account not selected +if (($sortfield == 'b.datev' || $sortfield == 'b.datev,b.dateo,b.rowid')) +{ + $sortfield = 'b.datev,b.dateo,b.rowid'; + if ($id > 0 || !empty($ref) || $search_account > 0) $mode_balance_ok = true; +} // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('banktransactionlist', $contextpage)); @@ -574,6 +573,7 @@ if ($page >= $nbtotalofpages) if ($page < 0) $page = 0; } + // If not account defined $mode_balance_ok=false if (empty($search_account)) $mode_balance_ok = false; // If a search is done $mode_balance_ok=false @@ -583,7 +583,7 @@ if (!empty($search_type)) $mode_balance_ok = false; if (!empty($search_debit)) $mode_balance_ok = false; if (!empty($search_credit)) $mode_balance_ok = false; if (!empty($search_thirdparty)) $mode_balance_ok = false; -if ($search_conciliated != '') $mode_balance_ok = false; +if ($search_conciliated != '' && $search_conciliated != '-1') $mode_balance_ok = false; if (!empty($search_num_releve)) $mode_balance_ok = false; $sql .= $db->plimit($limit + 1, $offset);