Bugzilla – Attachment 133084 Details for
Bug 29271
Cash register report not displaying or exporting correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[20.11] Bug 29271: Fix cash register report results
2011-Bug-29271-Fix-cash-register-report-results.patch (text/plain), 8.02 KB, created by
Katrin Fischer
on 2022-04-07 16:28:55 UTC
(
hide
)
Description:
[20.11] Bug 29271: Fix cash register report results
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2022-04-07 16:28:55 UTC
Size:
8.02 KB
patch
obsolete
>From 739a62d0ec7d47b10951b5f661db30c4e6f4486f Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 19 Oct 2021 13:03:07 +0000 >Subject: [PATCH] [20.11] 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 <andrew@bywatersolutions.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc | 8 ++++---- > .../prog/en/modules/reports/cash_register_stats.tt | 10 +++------- > .../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, 17 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 6c5450b0de..eee2031bae 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 -%] > <span> > [%- 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 -%] > </span> > [%- 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 fa6c521503..76644b3ab4 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 @@ > <body id="cash_register_stats" class="rep"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] >+[% INCLUDE 'accounts.inc' %] > > <div id="breadcrumbs"> > <a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> >@@ -158,13 +159,8 @@ > <td>[% loopresul.bfirstname | html %] [% loopresul.bsurname | html %]</td> > <td>[% loopresul.branchname | html %]</td> > <td>[% loopresul.date | $KohaDates %]</td> >- <td> >- [% IF loopresul.credit_type == "ACT" %] >- <span>All payments to the library</span> >- [% ELSE %] >- [%- PROCESS account_type_description account=loopresul -%] >- [% END %] >- </td> >+ <td>[% loopresul.timestamp | $KohaDates with_hours = 1 %]</td> >+ <td>[% PROCESS account_type_description account=loopresul %]</td> > <td>[% loopresul.note | html %]</td> > <td style="text-align:right;">[% loopresul.amount | $Price %]</td> > <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopresul.biblionumber | uri %]">[% loopresul.title | html %]</a></td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt >index 553eaa72cd..87664018b3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/csv/cash_register_stats.tt >@@ -1,9 +1,6 @@ > [%- USE ItemTypes -%] > [%- INCLUDE csv_headers/reports/cash_register_stats.tt -%] >-[%- INCLUDE empty_line.inc -%] >-[%- FOREACH row IN rows -%] >- [%- FOREACH field IN row; field IF !loop.last; ItemTypes.GetDescription(field) IF loop.last; sep IF !loop.last; END -%] >- [%- INCLUDE empty_line.inc -%] >-[%- END -%] >-TOTAL[%- INCLUDE empty_line.inc -%] >-[%- FOREACH field IN total; field; sep IF !loop.last; END -%] >+[%- FOREACH row IN rows %] >+ [% FOREACH field IN row; field IF !loop.last; ItemTypes.GetDescription(field) IF loop.last; sep IF !loop.last; END %] >+[%- END %] >+TOTAL[% sep %][%- FOREACH field IN total; field; sep IF !loop.last; END -%] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc >index 6c5450b0de..eee2031bae 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/accounts.inc >@@ -1,16 +1,16 @@ > [%- BLOCK account_type_description -%] > <span> > [%- 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 -%] > </span> > [%- 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/reports/cash_register_stats.pl b/reports/cash_register_stats.pl >index 76c05bd37d..d3cd4d3831 100755 >--- a/reports/cash_register_stats.pl >+++ b/reports/cash_register_stats.pl >@@ -166,8 +166,7 @@ if ($do_it) { > $row->{bfirstname} . ' ' . $row->{bsurname}, > $row->{branchname}, > $row->{date}, >- $row->{credit_type_code}, >- $row->{debit_type_code}, >+ $row->{credit_type_code} || $row->{debit_type_code}, > $row->{note}, > $row->{amount}, > $row->{title}, >@@ -176,7 +175,7 @@ if ($do_it) { > push (@rows, \@rowValues) ; > } > my @total; >- for (1..6){push(@total,"")}; >+ for (1..7){push(@total,"")}; > push(@total, $grantotal); > print $input->header( > -type => 'text/csv', >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29271
:
126498
|
126505
|
126548
|
126590
|
126611
|
126612
|
126613
|
126655
| 133084 |
133085
|
133086
|
133087