Bugzilla – Attachment 106624 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: Check that borrowernumber isn't a reference
0002-Bug-13961-Check-that-borrowernumber-isn-t-a-referenc.patch (text/plain), 1.80 KB, created by
Emmi Takkinen
on 2020-07-07 10:16:31 UTC
(
hide
)
Description:
Bug 13961: Check that borrowernumber isn't a reference
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2020-07-07 10:16:31 UTC
Size:
1.80 KB
patch
obsolete
>From 79b484c0dff661df03de19bc8eb67d67d1bc6ba5 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@outlook.com> >Date: Tue, 7 Jul 2020 10:32:36 +0300 >Subject: [PATCH 2/2] Bug 13961: Check that borrowernumber isn't a reference > >Some SendAlerts() tests in Letters.t failed due SQL::Abstract errors, >caused by HASH sometimes set as borrowernumber. > >Added code to check if borrowernumber is defined and it isn't a reference. >To test prove t/db_dependent/Letters.t > >Sponsored-by: Koha-Suomi Oy >--- > C4/Letters.pm | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 8951374b62..eb0d47013c 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -637,11 +637,13 @@ sub GetPreparedLetter { > my $currency_format = (defined($active_currency)) ? $active_currency->currency : undef; > > my $borrowernumber = $tables->{borrowers}; >- my $lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber }); >- my ($totalfine) = $lines->total_outstanding; >- 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($borrowernumber && !ref($borrowernumber)){ >+ my $lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber }); >+ my ($totalfine) = $lines->total_outstanding; >+ 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 >-- >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