Bugzilla – Attachment 78919 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-09-16 00:45:53 UTC
(
hide
)
Description:
Bug 21167: Fix price formatting on printed fee invoice and receipt
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-09-16 00:45:53 UTC
Size:
8.64 KB
patch
obsolete
>From 1727beba58af7d1328c47776202220d796017259 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 | 37 ++++++++++++------- > members/printfeercpt.pl | 7 ++-- > 3 files changed, 53 insertions(+), 32 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 1ac29c9..f57ef72 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt >@@ -3,6 +3,7 @@ > [% USE Koha %] > [% USE KohaDates %] > [% USE Branches %] >+[% USE Price %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Print receipt for [% patron.cardnumber | html %]</title> >@@ -36,7 +37,7 @@ > <tr> > <th colspan=4 > > Received with thanks from [% patron.firstname | html %] [% patron.surname | html %] <br /> >- Card number : [% patron.cardnumber | html %]<br /> >+ Card number: [% patron.cardnumber | html %]<br /> > </th> > </tr> > <tr> >@@ -51,29 +52,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 | html %] >+ [% 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 | html %] > [%- END -%] > [%- IF account.description %], [% account.description | html %][% END %] > </td> > <td>[% account.note | html %]</td> >- [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | html %]</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 | html %]</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 2b1e066..5e0ff19 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt >@@ -3,6 +3,7 @@ > [% USE Koha %] > [% USE Branches %] > [% USE KohaDates %] >+[% USE Price %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Print receipt for [% patron.cardnumber | html %]</title> >@@ -51,30 +52,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 | html %] >+ [% 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 | html %] > [%- END -%] > [%- IF account.description %], [% account.description | html %][% END %] > </td> > <td>[% account.note | html %]</td> > [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount | html %]</td> >- [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding | html %]</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 | html %]</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