Bugzilla – Attachment 104843 Details for
Bug 24413
MarkLostItemsAsReturned functionality does not lift restrictions caused by long overdues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24413: Apply AutoRemoveOverduesRestrictions for lost items
Bug-24413-Apply-AutoRemoveOverduesRestrictions-for.patch (text/plain), 1.92 KB, created by
Jonathan Druart
on 2020-05-13 13:19:29 UTC
(
hide
)
Description:
Bug 24413: Apply AutoRemoveOverduesRestrictions for lost items
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-05-13 13:19:29 UTC
Size:
1.92 KB
patch
obsolete
>From f15a97edcd33417ab5c70a9eb3aef3409f885f48 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 17 Feb 2020 16:27:57 +0100 >Subject: [PATCH] Bug 24413: Apply AutoRemoveOverduesRestrictions for lost > items > >It's quite hard to know where this need to be fixed. >it can be either MarkIssueReturned or LostItem, depending on the >different cases we want to handle. > >This patch picked MarkIssueReturned, but maybe the similar code in >AddReturn needs to be removed then. > >This patch fixes the original issue report by bug 24413, but is >submitted for discussion >--- > C4/Circulation.pm | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 5f48cfc288..6d1edbeb4d 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2222,6 +2222,8 @@ sub MarkIssueReturned { > # FIXME Improve the return value and handle it from callers > $schema->txn_do(sub { > >+ my $patron = Koha::Patrons->find( $borrowernumber ); >+ > # Update the returndate value > if ( $returndate ) { > $issue->returndate( $returndate )->store->discard_changes; # update and refetch >@@ -2245,9 +2247,18 @@ sub MarkIssueReturned { > > if ( C4::Context->preference('StoreLastBorrower') ) { > my $item = Koha::Items->find( $itemnumber ); >- my $patron = Koha::Patrons->find( $borrowernumber ); > $item->last_returned_by( $patron ); > } >+ >+ # Remove any OVERDUES related debarment if the borrower has no overdues >+ if ( C4::Context->preference('AutoRemoveOverduesRestrictions') >+ && $patron->debarred >+ && !$patron->has_overdues >+ && @{ GetDebarments({ borrowernumber => $borrowernumber, type => 'OVERDUES' }) } >+ ) { >+ DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' }); >+ } >+ > }); > > return $issue_id; >-- >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 24413
:
99111
|
99369
|
102606
|
102607
|
104843
|
104844
|
104845
|
104859
|
104860
|
104861
|
105205
|
105206
|
105207
|
105323