Bugzilla – Attachment 116632 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.33 KB, created by
Emmi Takkinen
on 2021-02-10 07:36:42 UTC
(
hide
)
Description:
Bug 13961: Add currency format handling
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2021-02-10 07:36:42 UTC
Size:
2.33 KB
patch
obsolete
>From e3a40dcd488c56c9b83b446590266d2e8984abe8 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/5] 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 5d039a83e0..b5f62da3e2 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -42,6 +42,8 @@ use Koha::DateUtils qw( format_sqldatetime dt_from_string ); > use Koha::Patrons; > use Koha::SMTP::Servers; > use Koha::Subscriptions; >+use Koha::Account::Lines; >+use Locale::Currency::Format; > > use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); > >@@ -667,11 +669,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 968c79ace1..a0cafa5e6e 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.25.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