@@ -, +, @@
to template
---
koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc | 8 ++++----
.../prog/en/modules/reports/cash_register_stats.tt | 4 +---
reports/cash_register_stats.pl | 10 ++++++----
3 files changed, 11 insertions(+), 11 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc
+++ a/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_code = account.credit_type_code -%]
+ [%- PROCESS credit_type_description credit_type_code = account.credit_type -%]
[%- ELSIF account.debit_type_code -%]
- [%- PROCESS debit_type_description debit_type_code = account.debit_type_code -%]
+ [%- PROCESS debit_type_description debit_type_code = account.debit_type -%]
[%- 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
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt
@@ -16,7 +16,6 @@
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
-[% INCLUDE 'accounts.inc' %]
Home ›
Reports
@@ -159,8 +158,7 @@
[% loopresul.bfirstname | html %] [% loopresul.bsurname | html %] |
[% loopresul.branchname | html %] |
[% loopresul.date | $KohaDates %] |
-
[% loopresul.timestamp | $KohaDates with_hours = 1 %] |
-
[% PROCESS account_type_description account=loopresul %] |
+
[% loopresul.type_description | html %] |
[% loopresul.note | html %] |
[% loopresul.amount | $Price %] |
[% loopresul.title | html %] |
--- a/reports/cash_register_stats.pl
+++ a/reports/cash_register_stats.pl
@@ -103,10 +103,10 @@ if ($do_it) {
}
my $query = "
- SELECT round(amount,2) AS amount, description,
+ SELECT round(amount,2) AS amount, al.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, COALESCE(act.description,al.credit_type_code,adt.description,al.debit_type_code) AS type_description, al.amountoutstanding, al.note,
bi.title, bi.biblionumber, i.barcode, i.itype
FROM accountlines al
LEFT JOIN borrowers bo ON (al.borrowernumber = bo.borrowernumber)
@@ -114,6 +114,8 @@ if ($do_it) {
LEFT JOIN branches br ON (br.branchcode = m.branchcode )
LEFT JOIN items i ON (i.itemnumber = al.itemnumber)
LEFT JOIN biblio bi ON (bi.biblionumber = i.biblionumber)
+ LEFT JOIN account_credit_types act ON (al.credit_type_code = act.code)
+ LEFT JOIN account_debit_types adt ON (al.debit_type_code = adt.code)
WHERE CAST(al.date AS DATE) BETWEEN ? AND ?
$whereTType
$whereBranchCode
@@ -166,7 +168,7 @@ if ($do_it) {
$row->{bfirstname} . ' ' . $row->{bsurname},
$row->{branchname},
$row->{date},
- $row->{credit_type_code} || $row->{debit_type_code},
+ $row->{type_description},
$row->{note},
$row->{amount},
$row->{title},
@@ -175,7 +177,7 @@ if ($do_it) {
push (@rows, \@rowValues) ;
}
my @total;
- for (1..7){push(@total,"")};
+ for (1..6){push(@total,"")};
push(@total, $grantotal);
print $input->header(
-type => 'text/csv',
--