From 2e87e5eedf1873bde6eca96d0edbdea3f76e1961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Tue, 14 Mar 2017 14:29:08 +0100 Subject: [PATCH] Bug 18263: Make use of syspref 'CurrencyFormat' for Account and Pay fines tables On Home > Patrons > Accounts for... and Home > Patrons > Pay fines for..., make the amounts display as defined in syspref 'CurrencyFormat' To test: - Apply patch - Give a patron a high fine or credit (e.g. 12345.67) - Got to pages Home > Patrons > Accounts for... and Home > Patrons > Pay fines - Verify that amounts display following syspref 'CurrencyFormat' (e.g. 12'345.67 for syspref set to 360'000.00 (CH) Signed-off-by: Mirko Tietgen Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit db467287d174827e52c322cb86d75b8628df52fe) Signed-off-by: Katrin Fischer (cherry picked from commit 3db9848f1acb904f67312c55a35fd262c46829aa) Signed-off-by: Julian Maurice --- .../prog/en/modules/members/boraccount.tt | 9 +++++---- .../intranet-tmpl/prog/en/modules/members/pay.tt | 11 ++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index 8097c06f82..97dae70c0c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -1,5 +1,6 @@ [% USE Koha %] [% USE KohaDates %] +[% USE Price %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Account for [% INCLUDE 'patron-title.inc' %] [% INCLUDE 'doc-head-close.inc' %] @@ -103,8 +104,8 @@ $(document).ready(function() { [%- IF account.description %], [% account.description %][% END %]  [% IF ( account.itemnumber ) %]View item [% END %][% account.title |html %] [% account.note | html_line_break %] - [% IF ( account.amountcredit ) %][% ELSE %][% END %][% account.amount %] - [% IF ( account.amountoutstandingcredit ) %][% ELSE %][% END %][% account.amountoutstanding %] + [% IF ( account.amountcredit ) %][% ELSE %][% END %][% account.amount | $Price %] + [% IF ( account.amountoutstandingcredit ) %][% ELSE %][% END %][% account.amountoutstanding | $Price %] [% IF ( reverse_col ) %] [% IF ( account.payment ) %] @@ -128,9 +129,9 @@ $(document).ready(function() { Total due [% IF ( totalcredit ) %] - [% total %] + [% total | $Price %] [% ELSE %] - [% total %] + [% total | $Price %] [% END %] [% IF ( reverse_col ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt index cb635b1164..125cb10d84 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt @@ -1,5 +1,6 @@ [% USE Koha %] [% USE AuthorisedValues %] +[% USE Price %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › Pay Fines for [% borrower.firstname %] [% borrower.surname %] [% INCLUDE 'doc-head-close.inc' %] @@ -18,7 +19,7 @@ function enableCheckboxActions(){ $(document).ready(function(){ $('#pay-fines-form').preventDoubleFormSubmit(); $("#woall").click(function(event){ - var msg = _("Are you sure you want to write off %s in outstanding fines? This cannot be undone!").format( "[% total | format('%.2f') %]" ); + var msg = _("Are you sure you want to write off %s in outstanding fines? This cannot be undone!").format( "[% total | $Price %]" ); var answer = confirm(msg); if (!answer){ event.preventDefault(); @@ -86,7 +87,7 @@ function enableCheckboxActions(){ Total due: - [% total | format('%.2f') %] + [% total | $Price %] @@ -144,15 +145,15 @@ function enableCheckboxActions(){ [% line.accounttype %] [% line.notify_id %] [% line.notify_level %] - [% line.amount | format('%.2f') %] - [% line.amountoutstanding | format('%.2f') %] + [% line.amount | $Price %] + [% line.amountoutstanding | $Price %] [% END %] [% IF ( account_grp.total ) %] Sub total: - [% account_grp.total | format('%.2f') %] + [% account_grp.total | $Price %] [% END %] [% END %]