From: Mike Rylander Date: Wed, 3 Jun 2020 21:41:02 +0000 (-0400) Subject: Improve existing slot detection in the CurbsideSlot reactor X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b2771dc516d884475184cf7199cd6177b16ccad4;p=working%2FEvergreen.git Improve existing slot detection in the CurbsideSlot reactor Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/CurbsideSlot.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/CurbsideSlot.pm index e95b09f9c4..763e041b55 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/CurbsideSlot.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/CurbsideSlot.pm @@ -23,7 +23,18 @@ sub handler { my $e = new_editor(xact => 1); my $h = $$env{target}; - my ($slot) = $e->search_action_curbside({patron => $h->usr, org => $h->pickup_lib, slot => undef}); + + # see if there's an undelivered appointment in the future + my ($slot) = $e->search_action_curbside({ + patron => $h->usr, + org => $h->pickup_lib, + delivered => undef, + '-or' => [ + { slot => { '>=' => 'now' } }, + { slot => undef } + ] + }); + if (!$slot) { $slot = Fieldmapper::action::curbside->new; $slot->org($h->pickup_lib);