Bugzilla – Attachment 166134 Details for
Bug 27753
Automate resolution of return claim when checking in an item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27753: (QA follow-up) Check that item exists before using it
Bug-27753-QA-follow-up-Check-that-item-exists-befo.patch (text/plain), 3.26 KB, created by
Martin Renvoize (ashimema)
on 2024-05-03 14:16:51 UTC
(
hide
)
Description:
Bug 27753: (QA follow-up) Check that item exists before using it
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-05-03 14:16:51 UTC
Size:
3.26 KB
patch
obsolete
>From 8d6cc82fb2116e61c1ce7e0cc8508770838d2b8d Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 1 May 2024 09:57:49 +0100 >Subject: [PATCH] Bug 27753: (QA follow-up) Check that item exists before using > it > >We're actioning the change of claim status outside of any block that >checks the $item exists. As such we'll want to add that check in here. > >I did consider that this should live inside AddIssue, but on reflection >the librarian may want to not proceed with the issue given other return >values from the CanBookBeIssued call, but you still want the >AutoClaimReturn to fire regardless as you've now found the item. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > circ/circulation.pl | 52 ++++++++++++++++++++++----------------------- > 1 file changed, 26 insertions(+), 26 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index e0a732f7bd0..81e0f337aec 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -438,6 +438,32 @@ if (@$barcodes && $op eq 'cud-checkout') { > > delete $needsconfirmation->{'DEBT'} if ($debt_confirmed); > >+ if ( $item && C4::Context->preference('ClaimReturnedLostValue') ) { >+ my $autoClaimReturnCheckout = C4::Context->preference('AutoClaimReturnStatusOnCheckout'); >+ >+ my $claims = Koha::Checkouts::ReturnClaims->search( >+ { >+ itemnumber => $item->id, >+ } >+ ); >+ if ( $claims->count ) { >+ if ($autoClaimReturnCheckout) { >+ my $claim = $claims->next; >+ >+ my $patron_id = $patron->borrowernumber; >+ my $resolution = $autoClaimReturnCheckout; >+ >+ $claim->resolve( >+ { >+ resolution => $resolution, >+ resolved_by => $patron_id, >+ } >+ ); >+ $template_params->{CLAIM_RESOLUTION} = $claim; >+ } >+ } >+ } >+ > if( $item and ( !$blocker or $force_allow_issue ) ){ > my $confirm_required = 0; > unless($issueconfirmed){ >@@ -497,32 +523,6 @@ if (@$barcodes && $op eq 'cud-checkout') { > } > } > >- if ( C4::Context->preference('ClaimReturnedLostValue') ) { >- my $autoClaimReturnCheckout = C4::Context->preference('AutoClaimReturnStatusOnCheckout'); >- >- my $claims = Koha::Checkouts::ReturnClaims->search( >- { >- itemnumber => $item->id, >- } >- ); >- if ( $claims->count ) { >- if ($autoClaimReturnCheckout) { >- my $claim = $claims->next; >- >- my $patron_id = $patron->borrowernumber; >- my $resolution = $autoClaimReturnCheckout; >- >- $claim->resolve( >- { >- resolution => $resolution, >- resolved_by => $patron_id, >- } >- ); >- $template_params->{CLAIM_RESOLUTION} = $claim; >- } >- } >- } >- > if ($needsconfirmation->{RESERVE_WAITING} or $needsconfirmation->{RESERVED} or $needsconfirmation->{TRANSFERRED} or $needsconfirmation->{PROCESSING}){ > $template->param( > reserveborrowernumber => $needsconfirmation->{'resborrowernumber'}, >-- >2.44.0
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 27753
:
162517
|
163058
|
163059
|
163060
|
163061
|
163084
|
163085
|
163090
|
163469
|
163470
|
163474
|
163475
|
163476
|
163477
|
163479
|
163480
|
165911
|
165912
|
165914
|
165915
|
165916
|
165917
|
165918
|
165919
|
165920
|
165952
|
165953
|
165958
|
165959
|
166128
|
166129
|
166130
|
166131
|
166132
|
166133
| 166134 |
166135
|
166136
|
166137