Bug 29271: (QA follow-up) Fetch and send descriptions to template

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2021-10-20 14:06:29 +00:00 committed by Kyle Hall
parent 9f09902947
commit f33e07f305
3 changed files with 10 additions and 9 deletions

View file

@ -1,16 +1,16 @@
[%- BLOCK account_type_description -%] [%- BLOCK account_type_description -%]
<span> <span>
[%- IF account.credit_type_code -%] [%- 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 -%] [%- 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 -%] [%- END -%]
[%- PROCESS account_status_description account=account -%] [%- PROCESS account_status_description account=account -%]
</span> </span>
[%- END -%] [%- END -%]
[%- BLOCK debit_type_description -%] [%- BLOCK debit_type_description -%]
[%- SWITCH debit_type_code -%] [%- SWITCH debit_type.code -%]
[%- CASE 'ACCOUNT' -%]Account creation fee [%- CASE 'ACCOUNT' -%]Account creation fee
[%- CASE 'ACCOUNT_RENEW' -%]Account renewal fee [%- CASE 'ACCOUNT_RENEW' -%]Account renewal fee
[%- CASE 'LOST' -%]Lost item [%- CASE 'LOST' -%]Lost item
@ -30,7 +30,7 @@
[%- END -%] [%- END -%]
[%- BLOCK credit_type_description -%] [%- BLOCK credit_type_description -%]
[%- SWITCH credit_type_code -%] [%- SWITCH credit_type.code -%]
[%- CASE 'PAYMENT' -%]Payment [%- CASE 'PAYMENT' -%]Payment
[%- CASE 'WRITEOFF' -%]Writeoff [%- CASE 'WRITEOFF' -%]Writeoff
[%- CASE 'FORGIVEN' -%]Forgiven [%- CASE 'FORGIVEN' -%]Forgiven

View file

@ -16,7 +16,6 @@
<body id="cash_register_stats" class="rep"> <body id="cash_register_stats" class="rep">
[% INCLUDE 'header.inc' %] [% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %] [% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'accounts.inc' %]
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb"> <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
<ol> <ol>
@ -179,7 +178,7 @@
<td>[% loopresul.branchname | html %]</td> <td>[% loopresul.branchname | html %]</td>
<td>[% loopresul.date | $KohaDates %]</td> <td>[% loopresul.date | $KohaDates %]</td>
<td>[% loopresul.timestamp | $KohaDates with_hours = 1 %]</td> <td>[% loopresul.timestamp | $KohaDates with_hours = 1 %]</td>
<td>[% PROCESS account_type_description account=loopresul %]</td> <td>[% loopresul.type_description | html %]</td>
<td>[% loopresul.note | html %]</td> <td>[% loopresul.note | html %]</td>
<td style="text-align:right;">[% loopresul.amount | $Price %]</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> <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loopresul.biblionumber | uri %]">[% loopresul.title | html %]</a></td>

View file

@ -103,10 +103,10 @@ if ($do_it) {
} }
my $query = " 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.surname AS bsurname, bo.firstname AS bfirstname, m.surname AS msurname, m.firstname AS mfirstname,
bo.cardnumber, br.branchname, bo.borrowernumber, 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.timestamp, 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, al.timestamp,
bi.title, bi.biblionumber, i.barcode, i.itype bi.title, bi.biblionumber, i.barcode, i.itype
FROM accountlines al FROM accountlines al
LEFT JOIN borrowers bo ON (al.borrowernumber = bo.borrowernumber) 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 branches br ON (br.branchcode = m.branchcode )
LEFT JOIN items i ON (i.itemnumber = al.itemnumber) LEFT JOIN items i ON (i.itemnumber = al.itemnumber)
LEFT JOIN biblio bi ON (bi.biblionumber = i.biblionumber) 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 ? WHERE CAST(al.date AS DATE) BETWEEN ? AND ?
$whereTType $whereTType
$whereBranchCode $whereBranchCode
@ -167,7 +169,7 @@ if ($do_it) {
$row->{branchname}, $row->{branchname},
$row->{date}, $row->{date},
$row->{timestamp}, $row->{timestamp},
$row->{credit_type_code} || $row->{debit_type_code}, $row->{type_description},
$row->{note}, $row->{note},
$row->{amount}, $row->{amount},
$row->{title}, $row->{title},