Bugzilla – Attachment 106193 Details for
Bug 13961
Option to include patron's total amount of fines in notices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13961: Add currency format handling
Bug-13961-Add-currency-format-handling.patch (text/plain), 2.33 KB, created by
ByWater Sandboxes
on 2020-06-23 09:40:11 UTC
(
hide
)
Description:
Bug 13961: Add currency format handling
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2020-06-23 09:40:11 UTC
Size:
2.33 KB
patch
obsolete
>From 46c3bcf93d0b14b9cc4eb5c6bda70a54a4ed96e8 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@outlook.com> >Date: Mon, 30 Dec 2019 15:13:36 +0200 >Subject: [PATCH] Bug 13961: Add currency format handling > >Sponsored-by: Koha-Suomi Oy > >Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> >--- > C4/Letters.pm | 10 ++++++++-- > tools/letter.pl | 2 +- > 2 files changed, 9 insertions(+), 3 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 4fda2449ba..375cf34f13 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -40,6 +40,8 @@ use Koha::Notice::Templates; > use Koha::DateUtils qw( format_sqldatetime dt_from_string ); > use Koha::Patrons; > use Koha::Subscriptions; >+use Koha::Account::Lines; >+use Locale::Currency::Format; > > use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); > >@@ -632,11 +634,15 @@ sub GetPreparedLetter { > my $OPACBaseURL = C4::Context->preference('OPACBaseURL'); > $letter->{content} =~ s/<<OPACBaseURL>>/$OPACBaseURL/go; > >+ my $active_currency = Koha::Acquisition::Currencies->get_active; >+ my $currency_format = $active_currency->currency if defined($active_currency); >+ > my $borrowernumber = $tables->{borrowers}; > my $lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber }); > my ($totalfine) = $lines->total_outstanding; >- $totalfine = sprintf("%.2f", $totalfine); >- $letter->{content} =~ s/<<borrowers.totalfine>>/$totalfine/go; >+ my $totalfine_formatted = currency_format($currency_format, "$totalfine", FMT_SYMBOL); >+ $totalfine_formatted = sprintf("%.2f", $totalfine) unless $totalfine_formatted; >+ $letter->{content} =~ s/<<borrowers.account_balance>>/$totalfine_formatted/go; > > if ($want_librarian) { > # parsing librarian name >diff --git a/tools/letter.pl b/tools/letter.pl >index bceaa83262..2565a2867f 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -247,7 +247,7 @@ sub add_form { > {value => 'items.content', text => 'items.content'}, > {value => 'items.fine', text => 'items.fine'}, > add_fields('borrowers'), >- {value => 'borrowers.totalfine', text => 'borrowers.totalfine' }; >+ {value => 'borrowers.account_balance', text => 'borrowers.account_balance' }; > if ($module eq 'circulation') { > push @{$field_selection}, add_fields('opac_news'); > >-- >2.11.0
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 13961
:
41872
|
42077
|
42089
|
50517
|
98819
|
98820
|
98821
|
106192
|
106193
|
106194
|
106623
|
106624
|
116631
|
116632
|
116633
|
116634
|
116635
|
121854