Bugzilla – Attachment 163209 Details for
Bug 35944
Bookings is not taken into account in CanBookBeRenewed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35944: Add booking handling to CanBookBeRenewed
Bug-35944-Add-booking-handling-to-CanBookBeRenewed.patch (text/plain), 1.73 KB, created by
Nick Clemens (kidclamp)
on 2024-03-15 11:47:48 UTC
(
hide
)
Description:
Bug 35944: Add booking handling to CanBookBeRenewed
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-03-15 11:47:48 UTC
Size:
1.73 KB
patch
obsolete
>From 75d513127742d80fa43456c47df119e086b2143b Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 19 Feb 2024 12:31:07 +0000 >Subject: [PATCH] Bug 35944: Add booking handling to CanBookBeRenewed > >This patch adds a bookings check to CanBookBeRenewed > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Circulation.pm | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 13d1758f493..e57e634d3c9 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2997,8 +2997,8 @@ sub CanBookBeRenewed { > my $final_unseen_renewal = 0; > > # override_limit will override anything else except on_reserve >+ my $branchcode = _GetCircControlBranch( $item, $patron ); > unless ( $override_limit ){ >- my $branchcode = _GetCircControlBranch( $item, $patron ); > > ( $auto_renew, $soonest ) = _CanBookBeAutoRenewed({ > patron => $patron, >@@ -3120,6 +3120,21 @@ sub CanBookBeRenewed { > } > } > >+ # CHECK FOR BOOKINGS >+ my $startdate = >+ ( C4::Context->preference('RenewalPeriodBase') eq 'date_due' ) >+ ? dt_from_string( $issue->date_due, 'sql' ) >+ : dt_from_string(); >+ my $datedue = CalcDateDue( $startdate, $item->effective_itemtype, $branchcode, $patron, 'is a renewal' ); >+ if ( >+ my $booking = $item->find_booking( >+ { checkout_date => $startdate, due_date => $datedue, patron_id => $patron->borrowernumber } >+ ) >+ ) >+ { >+ return ( 0, 'booked' ) unless ( $booking->patron_id == $patron->borrowernumber ); >+ } >+ > if ( $auto_renew eq 'auto_too_soon' ) { > > # If its cron, tell it it's too soon for a an auto renewal >-- >2.30.2
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 35944
:
162407
|
162408
|
162417
|
162418
|
162423
|
162424
|
163201
|
163202
|
163203
|
163204
|
163205
|
163206
|
163208
| 163209 |
163210
|
163211
|
163212
|
163213