Bugzilla – Attachment 98820 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
0002-Bug-13961-Add-currency-format-handling.patch (text/plain), 2.27 KB, created by
Emmi Takkinen
on 2020-02-13 12:45:14 UTC
(
hide
)
Description:
Bug 13961: Add currency format handling
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2020-02-13 12:45:14 UTC
Size:
2.27 KB
patch
obsolete
>From 5c8090131b604de0de3266fa76e1ba189530f582 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 2/3] Bug 13961: Add currency format handling > >Sponsored-by: Koha-Suomi Oy >--- > 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 9d4a215551..df4eb67071 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -41,6 +41,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); > >@@ -634,11 +636,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 50ba30fe21..3a963e3780 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.17.1 >
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