From 5d08e11c1504246d869c1433679e53967cf9ac4b Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 19 Oct 2021 13:03:07 +0000 Subject: [PATCH] Bug 29271: Fix cash register report results This patch changes accounts.inc to use the credit/debit type codes directly rather than needlessly fetching the credit_type/debit_type object jsut to get the code. This allows the BLOCK to work on non-object lines We also only pass a debit or credit type to csv (accountline cannot be both) empty-line.inc is also removed in favor of correcting the markup one more column added to total line To test: 1 - Add some debits and credits to accounts 2 - Browse to Reports->Cash register 3 - Select transaction type 'All transactions' 4 - Output to screen 5 - Run report 6 - Note transaction types column is empty 7 - Output to a file 8 - Run report 9 - Open file and note: amount column is out of place extra line before total 10 - Apply patch 11 - Repeat and note display and export are correct Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc | 8 ++++---- .../prog/en/modules/reports/cash_register_stats.tt | 9 ++------- .../prog/en/modules/reports/csv/cash_register_stats.tt | 11 ++++------- koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc | 8 ++++---- reports/cash_register_stats.pl | 5 ++--- 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc index e57195717c..ca749fb7c9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc @@ -1,16 +1,16 @@ [%- BLOCK account_type_description -%] [%- IF account.credit_type_code -%] - [%- PROCESS credit_type_description credit_type = account.credit_type -%] + [%- PROCESS credit_type_description credit_type_code = account.credit_type_code -%] [%- ELSIF account.debit_type_code -%] - [%- PROCESS debit_type_description debit_type = account.debit_type -%] + [%- PROCESS debit_type_description debit_type_code = account.debit_type_code -%] [%- END -%] [%- PROCESS account_status_description account=account -%] [%- END -%] [%- BLOCK debit_type_description -%] - [%- SWITCH debit_type.code -%] + [%- SWITCH debit_type_code -%] [%- CASE 'ACCOUNT' -%]Account creation fee [%- CASE 'ACCOUNT_RENEW' -%]Account renewal fee [%- CASE 'LOST' -%]Lost item @@ -30,7 +30,7 @@ [%- END -%] [%- BLOCK credit_type_description -%] - [%- SWITCH credit_type.code -%] + [%- SWITCH credit_type_code -%] [%- CASE 'PAYMENT' -%]Payment [%- CASE 'WRITEOFF' -%]Writeoff [%- CASE 'FORGIVEN' -%]Forgiven diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt index 545689a977..5efef32043 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt @@ -16,6 +16,7 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'cat-search.inc' %] +[% INCLUDE 'accounts.inc' %]