Bug 32883: Correct cubside pickups ordering
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 6 Feb 2023 15:48:54 +0000 (16:48 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 27 Mar 2023 09:49:33 +0000 (11:49 +0200)
They are displayed by date of creation, it's not what we want for "to be
staged" for instance, where it needs to be ordered by date/time of
scheduled pickup.

Test plan:
Create several curbside pickups, to have some in the different tabs
Confirm that the order is the one you expect.
=> to be staged ordered by pickup date/time
=> stage and ready ordered by pickup date/time
=> patron is outside ordered by arrival date/time
=> delivered today ordered by *desc* delivered date/time

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
circ/curbside_pickups.pl

index a2e06d7..fcdc99d 100755 (executable)
@@ -159,7 +159,8 @@ $template->param(
     curbside_pickups => Koha::CurbsidePickups->search(
         {
             branchcode => $branchcode,
-        }
+        },
+        { order_by => [ { -desc => 'delivered_datetime' }, 'arrival_datetime', 'scheduled_pickup_datetime' ], }
       )->filter_by_scheduled_today,
 );