Bugzilla – Attachment 133403 Details for
Bug 24865
Customize the accountlines description
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24865: (QA follow-up) Remove hardcoded notice name from protected_letters
Bug-24865-QA-follow-up-Remove-hardcoded-notice-nam.patch (text/plain), 2.25 KB, created by
Marcel de Rooy
on 2022-04-19 11:59:55 UTC
(
hide
)
Description:
Bug 24865: (QA follow-up) Remove hardcoded notice name from protected_letters
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-04-19 11:59:55 UTC
Size:
2.25 KB
patch
obsolete
>From 73ef62a6ae66079ee7b441b322d9097ebbc3de66 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 19 Apr 2022 11:48:14 +0000 >Subject: [PATCH] Bug 24865: (QA follow-up) Remove hardcoded notice name from > protected_letters >Content-Type: text/plain; charset=utf-8 > >If the letter has been removed, fall back to itemnumber/due date. (Title is >no longer fetched.) We may assume that the notice is present. > >Note: The option to 'protect' a notice may need some more thought. Perhaps >it needs to be an attribute on itself. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Tested by deleting notice, running fines again. >--- > C4/Overdues.pm | 5 +++-- > tools/letter.pl | 5 +---- > 2 files changed, 4 insertions(+), 6 deletions(-) > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index afa270651d..6375ffc271 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -599,7 +599,7 @@ sub UpdateFine { > } else { > if ( $amount ) { # Don't add new fines with an amount of 0 > my $patron = Koha::Patrons->find( $borrowernumber ); >- my $desc = C4::Letters::GetPreparedLetter( >+ my $letter = eval { C4::Letters::GetPreparedLetter( > module => 'circulation', > letter_code => 'OVERDUE_FINE_DESC', > message_transport_type => 'print', >@@ -609,7 +609,8 @@ sub UpdateFine { > borrowers => $borrowernumber, > items => $itemnum, > }, >- )->{content}; >+ ) }; >+ my $desc = $letter ? $letter->{content} : "Item $itemnum - due $due"; > > my $account = Koha::Account->new({ patron_id => $borrowernumber }); > $accountline = $account->add_debit( >diff --git a/tools/letter.pl b/tools/letter.pl >index d46ddd25d6..1b6f39ae89 100755 >--- a/tools/letter.pl >+++ b/tools/letter.pl >@@ -56,10 +56,7 @@ use Koha::Patron::Attribute::Types; > sub protected_letters { > my $dbh = C4::Context->dbh; > my $codes = $dbh->selectall_arrayref(q{SELECT DISTINCT letter_code FROM message_transports}); >- return { >- OVERDUE_FINE_DESC => 1, >- map { $_->[0] => 1 } @{$codes} >- }; >+ return { map { $_->[0] => 1 } @{$codes} }; > } > > our $input = CGI->new; >-- >2.20.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 24865
:
130749
|
131286
|
133344
|
133402
| 133403