Bugzilla – Attachment 67568 Details for
Bug 19198
Renewal as issue causes too many error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19198 - Renewal as issue causes too many error
Bug-19198---Renewal-as-issue-causes-too-many-error.patch (text/plain), 5.81 KB, created by
Nick Clemens (kidclamp)
on 2017-10-03 17:44:10 UTC
(
hide
)
Description:
Bug 19198 - Renewal as issue causes too many error
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-10-03 17:44:10 UTC
Size:
5.81 KB
patch
obsolete
>From 864528fd6c0e4f3c1fe3b70d06338573ee0c9c04 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 29 Aug 2017 14:25:20 +0000 >Subject: [PATCH] Bug 19198 - Renewal as issue causes too many error > >This patch moves some code and prevents checking for too many checkouts >when performing a renewal via checkout > >To test: >1 - Set a rule to limit checkouts to a single issue, allowing renewal >2 - Issue an item to a patron >3 - Issue the same item >4 - In staff client you get a confirm to renew and a notice of Too Many >checkouts, don't confirm >5 - VIA Sip - you get a renewal response, but in logs the renewal fails >as a 'too >6 - Apply patch >7 - Via staff client you shoudl get renewal confirm with no too many >error >8 - SIP checkout should renew > >Signed-off-by: Lee Jamison <ldjamison@marywood.edu> >--- > C4/Circulation.pm | 102 +++++++++++++++++++++++++++--------------------------- > 1 file changed, 51 insertions(+), 51 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index eb0f6d5..a9345b8 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -834,6 +834,56 @@ sub CanBookBeIssued { > } > } > >+ # >+ # CHECK IF BOOK ALREADY ISSUED TO THIS BORROWER >+ # >+ if ( $issue && $issue->borrowernumber eq $borrower->{'borrowernumber'} ){ >+ >+ # Already issued to current borrower. >+ # If it is an on-site checkout if it can be switched to a normal checkout >+ # or ask whether the loan should be renewed >+ >+ if ( $issue->onsite_checkout >+ and C4::Context->preference('SwitchOnSiteCheckouts') ) { >+ $messages{ONSITE_CHECKOUT_WILL_BE_SWITCHED} = 1; >+ } else { >+ my ($CanBookBeRenewed,$renewerror) = CanBookBeRenewed( >+ $borrower->{'borrowernumber'}, >+ $item->{'itemnumber'}, >+ ); >+ if ( $CanBookBeRenewed == 0 ) { # no more renewals allowed >+ if ( $renewerror eq 'onsite_checkout' ) { >+ $issuingimpossible{NO_RENEWAL_FOR_ONSITE_CHECKOUTS} = 1; >+ } >+ else { >+ $issuingimpossible{NO_MORE_RENEWALS} = 1; >+ } >+ } >+ else { >+ $needsconfirmation{RENEW_ISSUE} = 1; >+ } >+ } >+ } >+ elsif ( $issue ) { >+ >+ # issued to someone else >+ >+ my $patron = Koha::Patrons->find( $issue->borrowernumber ); >+ >+ my ( $can_be_returned, $message ) = CanBookBeReturned( $item, C4::Context->userenv->{branch} ); >+ >+ unless ( $can_be_returned ) { >+ $issuingimpossible{RETURN_IMPOSSIBLE} = 1; >+ $issuingimpossible{branch_to_return} = $message; >+ } else { >+ $needsconfirmation{ISSUED_TO_ANOTHER} = 1; >+ $needsconfirmation{issued_firstname} = $patron->firstname; >+ $needsconfirmation{issued_surname} = $patron->surname; >+ $needsconfirmation{issued_cardnumber} = $patron->cardnumber; >+ $needsconfirmation{issued_borrowernumber} = $patron->borrowernumber; >+ } >+ } >+ > # JB34 CHECKS IF BORROWERS DON'T HAVE ISSUE TOO MANY BOOKS > # > my $switch_onsite_checkout = ( >@@ -843,7 +893,7 @@ sub CanBookBeIssued { > and $issue->borrowernumber == $borrower->{'borrowernumber'} ? 1 : 0 ); > my $toomany = TooMany( $borrower, $item->{biblionumber}, $item, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } ); > # if TooMany max_allowed returns 0 the user doesn't have permission to check out this book >- if ( $toomany ) { >+ if ( $toomany & !$needsconfirmation{RENEW_ISSUE} ) { > if ( $toomany->{max_allowed} == 0 ) { > $needsconfirmation{PATRON_CANT} = 1; > } >@@ -944,56 +994,6 @@ sub CanBookBeIssued { > } > } > >- # >- # CHECK IF BOOK ALREADY ISSUED TO THIS BORROWER >- # >- if ( $issue && $issue->borrowernumber eq $borrower->{'borrowernumber'} ){ >- >- # Already issued to current borrower. >- # If it is an on-site checkout if it can be switched to a normal checkout >- # or ask whether the loan should be renewed >- >- if ( $issue->onsite_checkout >- and C4::Context->preference('SwitchOnSiteCheckouts') ) { >- $messages{ONSITE_CHECKOUT_WILL_BE_SWITCHED} = 1; >- } else { >- my ($CanBookBeRenewed,$renewerror) = CanBookBeRenewed( >- $borrower->{'borrowernumber'}, >- $item->{'itemnumber'}, >- ); >- if ( $CanBookBeRenewed == 0 ) { # no more renewals allowed >- if ( $renewerror eq 'onsite_checkout' ) { >- $issuingimpossible{NO_RENEWAL_FOR_ONSITE_CHECKOUTS} = 1; >- } >- else { >- $issuingimpossible{NO_MORE_RENEWALS} = 1; >- } >- } >- else { >- $needsconfirmation{RENEW_ISSUE} = 1; >- } >- } >- } >- elsif ( $issue ) { >- >- # issued to someone else >- >- my $patron = Koha::Patrons->find( $issue->borrowernumber ); >- >- my ( $can_be_returned, $message ) = CanBookBeReturned( $item, C4::Context->userenv->{branch} ); >- >- unless ( $can_be_returned ) { >- $issuingimpossible{RETURN_IMPOSSIBLE} = 1; >- $issuingimpossible{branch_to_return} = $message; >- } else { >- $needsconfirmation{ISSUED_TO_ANOTHER} = 1; >- $needsconfirmation{issued_firstname} = $patron->firstname; >- $needsconfirmation{issued_surname} = $patron->surname; >- $needsconfirmation{issued_cardnumber} = $patron->cardnumber; >- $needsconfirmation{issued_borrowernumber} = $patron->borrowernumber; >- } >- } >- > unless ( $ignore_reserves ) { > # See if the item is on reserve. > my ( $restype, $res ) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ); >-- >2.1.4
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 19198
:
66584
|
66585
|
66670
|
66671
|
67111
|
67112
|
67113
|
67567
|
67568
|
67569
|
67571
|
67572
|
67573
|
67719
|
67720