Bugzilla – Attachment 77596 Details for
Bug 21167
Price should be correctly formatted on printed fee receipt and invoice
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21167: Fix price formatting on printed fee invoice and receipt
Bug-21167-Fix-price-formatting-on-printed-fee-invo.patch (text/plain), 8.64 KB, created by
Katrin Fischer
on 2018-08-08 21:36:07 UTC
(
hide
)
Description:
Bug 21167: Fix price formatting on printed fee invoice and receipt
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-08-08 21:36:07 UTC
Size:
8.64 KB
patch
obsolete
>From e6678709910e0ce0ffa50256b7cac04dde191727 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Wed, 8 Aug 2018 19:26:47 +0000 >Subject: [PATCH] Bug 21167: Fix price formatting on printed fee invoice and > receipt > >The prices were not formatted correctly on the printed receipts >for fines and payments in the patron account. > >This patch introduces the use of the Price TT plugin to those >templates. > >Also: >- Fixes a few capitalization errors >- Removes spaces in front of : >- Updates accounttype-to-description list to the one used > in other templats as a lot of values were missing (Credit etc.) > >To test: >- Create several fines, use some .00 and some with other values >- Pay some fines >- Create a manual credit >- Use print button for all of those (credit, fee, payment) >- Verify that: > - prices ending in .00 are displayed without the decimal part > - instead of Credit only C is shown in the description >- Apply patch >- Print invoices and receipts again >- Verify that: > - prices are now formatted according to CurrencyFormat system > preference, decimal part always included > - verify that correct description for Credit is shown >--- > .../prog/en/modules/members/printfeercpt.tt | 41 ++++++++++++++-------- > .../prog/en/modules/members/printinvoice.tt | 39 ++++++++++++-------- > members/printfeercpt.pl | 7 ++-- > 3 files changed, 54 insertions(+), 33 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt >index 1e9ad5b..d20cd49 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt >@@ -2,6 +2,7 @@ > [% USE Koha %] > [% USE KohaDates %] > [% USE Branches %] >+[% USE Price %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Print receipt for [% patron.cardnumber %]</title> >@@ -35,7 +36,7 @@ > <tr> > <th colspan=4 > > Received with thanks from [% patron.firstname %] [% patron.surname %] <br /> >- Card number : [% patron.cardnumber %]<br /> >+ Card number: [% patron.cardnumber %]<br /> > </th> > </tr> > <tr> >@@ -50,29 +51,39 @@ > <td>[% account.date | $KohaDates %]</td> > <td> > [% SWITCH account.accounttype %] >- [% CASE 'Pay' %]Payment, thanks >- [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) >- [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) >- [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) >- [% CASE 'N' %]New Card >- [% CASE 'F' %]Fine >- [% CASE 'A' %]Account management fee >- [% CASE 'M' %]Sundry >- [% CASE 'L' %]Lost Item >- [% CASE 'W' %]Writeoff >- [% CASE %][% account.accounttype %] >+ [% CASE 'Pay' %]Payment, thanks >+ [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) >+ [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) >+ [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) >+ [% CASE 'N' %]New card >+ [% CASE 'F' %]Fine >+ [% CASE 'A' %]Account management fee >+ [% CASE 'M' %]Sundry >+ [% CASE 'L' %]Lost item >+ [% CASE 'W' %]Writeoff >+ [% CASE 'FU' %]Accruing fine >+ [% CASE 'HE' %]Hold waiting too long >+ [% CASE 'Rent' %]Rental fee >+ [% CASE 'FOR' %]Forgiven >+ [% CASE 'LR' %]Lost item fee refund >+ [% CASE 'PF' %]Processing fee >+ [% CASE 'PAY' %]Payment >+ [% CASE 'WO' %]Writeoff >+ [% CASE 'C' %]Credit >+ [% CASE 'CR' %]Credit >+ [% CASE %][% account.accounttype %] > [%- END -%] > [%- IF account.description %], [% account.description %][% END %] > </td> > <td>[% account.note %]</td> >- [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount %]</td> >+ [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | $Price %]</td> > </tr> > > [% END %] > <tfoot> > <tr> >- <td colspan="3">Total outstanding dues as on date : </td> >- [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total %]</td> >+ <td colspan="3">Total outstanding dues as on date: </td> >+ [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total | $Price %]</td> > </tr> > </tfoot> > </table> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt >index ec3ddf6..3ee59ce 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt >@@ -2,6 +2,7 @@ > [% USE Koha %] > [% USE Branches %] > [% USE KohaDates %] >+[% USE Price %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Print receipt for [% patron.cardnumber %]</title> >@@ -50,30 +51,40 @@ > <td>[% account.date | $KohaDates%]</td> > <td> > [% SWITCH account.accounttype %] >- [% CASE 'Pay' %]Payment, thanks >- [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) >- [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) >- [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) >- [% CASE 'N' %]New Card >- [% CASE 'F' %]Fine >- [% CASE 'A' %]Account management fee >- [% CASE 'M' %]Sundry >- [% CASE 'L' %]Lost Item >- [% CASE 'W' %]Writeoff >- [% CASE %][% account.accounttype %] >+ [% CASE 'Pay' %]Payment, thanks >+ [% CASE 'Pay00' %]Payment, thanks (cash via SIP2) >+ [% CASE 'Pay01' %]Payment, thanks (VISA via SIP2) >+ [% CASE 'Pay02' %]Payment, thanks (credit card via SIP2) >+ [% CASE 'N' %]New card >+ [% CASE 'F' %]Fine >+ [% CASE 'A' %]Account management fee >+ [% CASE 'M' %]Sundry >+ [% CASE 'L' %]Lost item >+ [% CASE 'W' %]Writeoff >+ [% CASE 'FU' %]Accruing fine >+ [% CASE 'HE' %]Hold waiting too long >+ [% CASE 'Rent' %]Rental fee >+ [% CASE 'FOR' %]Forgiven >+ [% CASE 'LR' %]Lost item fee refund >+ [% CASE 'PF' %]Processing fee >+ [% CASE 'PAY' %]Payment >+ [% CASE 'WO' %]Writeoff >+ [% CASE 'C' %]Credit >+ [% CASE 'CR' %]Credit >+ [% CASE %][% account.accounttype %] > [%- END -%] > [%- IF account.description %], [% account.description %][% END %] > </td> > <td>[% account.note %]</td> >- [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount %]</td> >- [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding %]</td> >+ [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | $Price %]</td> >+ [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding | $Price %]</td> > </tr> > > [% END %] > <tfoot> > <tr> > <td colspan="4">Total outstanding dues as on date: </td> >- [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total %]</td> >+ [% IF ( totalcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% total | $Price %]</td> > </tr> > </tfoot> > </table> >diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl >index a6f5fb1..4aa8bd0 100755 >--- a/members/printfeercpt.pl >+++ b/members/printfeercpt.pl >@@ -84,9 +84,8 @@ my %row = ( > 'amountcredit' => $accountline->{'amountcredit'}, > 'amountoutstandingcredit' => $accountline->{'amountoutstandingcredit'}, > 'description' => $accountline->{'description'}, >- 'amount' => sprintf( "%.2f", $accountline->{'amount'} ), >- 'amountoutstanding' => >- sprintf( "%.2f", $accountline->{'amountoutstanding'} ), >+ 'amount' => $accountline->{'amount'}, >+ 'amountoutstanding' => $accountline->{'amountoutstanding'}, > 'accountno' => $accountline->{'accountno'}, > accounttype => $accountline->{accounttype}, > 'note' => $accountline->{'note'}, >@@ -96,7 +95,7 @@ my %row = ( > $template->param( > patron => $patron, > finesview => 1, >- total => sprintf("%.2f",$total), >+ total => $total, > totalcredit => $totalcredit, > accounts => [$accountline], # FIXME There is always only 1 row! > ); >-- >2.1.4
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 21167
:
77518
|
77596
|
78209
|
78919
|
79020
|
79073
|
79074
|
79075
|
79076
|
79513
|
79514
|
79515