Bugzilla – Attachment 163212 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: (QA follow-up) Check if there are bookings before other calculations
Bug-35944-QA-follow-up-Check-if-there-are-bookings.patch (text/plain), 1.83 KB, created by
Nick Clemens (kidclamp)
on 2024-03-15 11:47:57 UTC
(
hide
)
Description:
Bug 35944: (QA follow-up) Check if there are bookings before other calculations
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-03-15 11:47:57 UTC
Size:
1.83 KB
patch
obsolete
>From 0e2ecaec2dd4181027897de2657fe2565b69b0e6 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 15 Mar 2024 11:35:38 +0000 >Subject: [PATCH] Bug 35944: (QA follow-up) Check if there are bookings before > other calculations > >--- > C4/Circulation.pm | 27 +++++++++++++++------------ > 1 file changed, 15 insertions(+), 12 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index e57e634d3c9..9e6a64817df 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3121,18 +3121,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( $item->bookings->count ){ >+ 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' ) { >-- >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