From bdb709263b4ecf28bf0d03319cf5ea6a990c33c5 Mon Sep 17 00:00:00 2001 From: phette23 Date: Wed, 29 Jan 2020 15:45:09 -0800 Subject: [PATCH] Bug #21791 - Add payment type on Cash register report (cash_register_stats.pl) To test: - create some accountlines transactions, some of which specify a payment_type + will need patron accounts to charge fines too etc. - view the cash register report under Reports > Statistics wizard - no payment type is listed - apply patch - run the report again, payment type column appears alongside transaction type - export results to CSV, payment type column is included --- .../en/includes/csv_headers/reports/cash_register_stats.tt | 2 +- .../prog/en/modules/reports/cash_register_stats.tt | 4 +++- reports/cash_register_stats.pl | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/reports/cash_register_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/reports/cash_register_stats.tt index a475c76d6c..3b87704911 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/reports/cash_register_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/reports/cash_register_stats.tt @@ -1 +1 @@ -[%- BLOCK -%]Manager name[% sep | html %]Patron cardnumber[% sep | html %]Patron name[% sep | html %]Transaction library[% sep | html %]Transaction date[% sep | html %]Transaction type[% sep |html %]Notes[% sep | html %]Amount[% sep | html %]Title[% sep | html %]Barcode[% sep | html %]Item type[%- END -%] +[%- BLOCK -%]Manager name[% sep | html %]Patron cardnumber[% sep | html %]Patron name[% sep | html %]Transaction library[% sep | html %]Transaction date[% sep | html %]Transaction type[% sep |html %]Payment type[% sep | html %]Notes[% sep | html %]Amount[% sep | html %]Title[% sep | html %]Barcode[% sep | html %]Item type[%- END -%] 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 cbcc27a056..46e88e629a 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 @@ -74,7 +74,7 @@ [% END %] [% END %] - + [% FOREACH credit_type IN credit_types %] [% IF transaction_type == credit_type.code %] @@ -134,6 +134,7 @@ Transaction library Transaction date Transaction type + Payment Type Notes Amount Bibliographic record title @@ -155,6 +156,7 @@ [%- PROCESS account_type_description account=loopresul -%] [% END %] + [% loopresul.payment_type | html %] [% loopresul.note | html %] [% loopresul.amount | $Price %] [% loopresul.title | html %] diff --git a/reports/cash_register_stats.pl b/reports/cash_register_stats.pl index 6fbbbfbf9b..f9d0659e53 100755 --- a/reports/cash_register_stats.pl +++ b/reports/cash_register_stats.pl @@ -99,7 +99,8 @@ if ($do_it) { SELECT round(amount,2) AS amount, description, bo.surname AS bsurname, bo.firstname AS bfirstname, m.surname AS msurname, m.firstname AS mfirstname, bo.cardnumber, br.branchname, bo.borrowernumber, - al.borrowernumber, DATE(al.date) as date, al.credit_type_code, al.debit_type_code, al.amountoutstanding, al.note, + al.borrowernumber, DATE(al.date) as date, al.credit_type_code, al.debit_type_code, + al.payment_type, al.amountoutstanding, al.note, bi.title, bi.biblionumber, i.barcode, i.itype FROM accountlines al LEFT JOIN borrowers bo ON (al.borrowernumber = bo.borrowernumber) @@ -160,6 +161,7 @@ if ($do_it) { $row->{date}, $row->{credit_type}, $row->{debit_type}, + $row->{payment_type}, $row->{note}, $row->{amount}, $row->{title}, -- 2.25.0