Bugzilla – Attachment 173202 Details for
Bug 38175
Improve bookings behavior with new status field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38175: Handle satus in item auto-assignment for bookings
Bug-38175-Handle-satus-in-item-auto-assignment-for.patch (text/plain), 2.66 KB, created by
Martin Renvoize (ashimema)
on 2024-10-23 10:11:02 UTC
(
hide
)
Description:
Bug 38175: Handle satus in item auto-assignment for bookings
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-23 10:11:02 UTC
Size:
2.66 KB
patch
obsolete
>From cb55275838f3a6837970ed91803e262918ac4d1d Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 23 Oct 2024 11:09:06 +0100 >Subject: [PATCH] Bug 38175: Handle satus in item auto-assignment for bookings > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Booking.pm | 45 ++++++++++++++++++++++++++------------------- > 1 file changed, 26 insertions(+), 19 deletions(-) > >diff --git a/Koha/Booking.pm b/Koha/Booking.pm >index e32b0f50358..2450465649b 100644 >--- a/Koha/Booking.pm >+++ b/Koha/Booking.pm >@@ -197,24 +197,31 @@ sub _assign_item_for_booking { > my $dtf = Koha::Database->new->schema->storage->datetime_parser; > > my $existing_bookings = $biblio->bookings( >- [ >- start_date => { >- '-between' => [ >- $dtf->format_datetime($start_date), >- $dtf->format_datetime($end_date) >- ] >- }, >- end_date => { >- '-between' => [ >- $dtf->format_datetime($start_date), >- $dtf->format_datetime($end_date) >- ] >- }, >- { >- start_date => { '<' => $dtf->format_datetime($start_date) }, >- end_date => { '>' => $dtf->format_datetime($end_date) } >- } >- ] >+ { >+ '-and' => [ >+ { >+ '-or' => [ >+ start_date => { >+ '-between' => [ >+ $dtf->format_datetime($start_date), >+ $dtf->format_datetime($end_date) >+ ] >+ }, >+ end_date => { >+ '-between' => [ >+ $dtf->format_datetime($start_date), >+ $dtf->format_datetime($end_date) >+ ] >+ }, >+ { >+ start_date => { '<' => $dtf->format_datetime($start_date) }, >+ end_date => { '>' => $dtf->format_datetime($end_date) } >+ } >+ ] >+ }, >+ { status => { '-not_in' => [ 'cancelled', 'completed' ] } } >+ ] >+ } > ); > > my $checkouts = >@@ -227,7 +234,7 @@ sub _assign_item_for_booking { > { '-not_in' => $checkouts->_resultset->get_column('itemnumber')->as_query } > ] > }, >- { rows => 1 } >+ { order_by => \'RAND()', rows => 1 } > ); > > my $itemnumber = $bookable_items->single->itemnumber; >-- >2.47.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 38175
:
172770
|
172771
|
172772
|
172773
|
172814
|
172815
|
172816
|
172817
|
172880
|
172881
|
172882
|
172883
|
172884
|
173172
|
173173
|
173174
|
173175
|
173176
|
173177
|
173178
|
173201
|
173202
|
173203
|
173346
|
173915