Bugzilla – Attachment 121854 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
Bug-13961-Check-that-borrowernumber-isnt-a-referen.patch (text/plain), 1.83 KB, created by
Salman Ali
on 2021-06-11 15:12:12 UTC
(
hide
)
Description:
Bug 13961: Check that borrowernumber isn't a reference
Filename:
MIME Type:
Creator:
Salman Ali
Created:
2021-06-11 15:12:12 UTC
Size:
1.83 KB
patch
obsolete
>From 6766320122121d3a1624be924527974c3d934efd 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] 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 >Signed-off-by: Salman Ali <salman@outaouais> >--- > C4/Letters.pm | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 81d70b8301..384f864d7e 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -675,11 +675,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.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