Bug 32883 - Curbside pickups - Order "To be staged" by date and time of scheduled pickup
Summary: Curbside pickups - Order "To be staged" by date and time of scheduled pickup
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 30650
Blocks:
  Show dependency treegraph
 
Reported: 2023-02-03 19:13 UTC by Caroline Cyr La Rose
Modified: 2023-12-28 20:42 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.05


Attachments
Bug 32883: Correct cubside pickups ordering (1.31 KB, patch)
2023-02-06 15:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32883: Correct cubside pickups ordering (1.27 KB, patch)
2023-02-07 06:42 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 32883: Correct cubside pickups ordering (1.34 KB, patch)
2023-02-07 14:56 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 32883: Correct cubside pickups ordering (1.39 KB, patch)
2023-03-14 13:05 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 32883: (QA follow-up) Adjust ordering for pickups (892 bytes, patch)
2023-03-14 13:06 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2023-02-03 19:13:51 UTC
The entries in the "To be staged" tab in the curbside pickup module should be ordered by date and time of the scheduled pickup so that we can address the most pressing/the soonest first.

Right now, I'm not sure how they are ordered... Maybe in the order they were scheduled?

To test:
1. Enable the CurbsidePickup system preference
2. Set up curbside pickup for a library (e.g. Centerville)
   2.1. Go to Administration > Curbside pickup
   2.2. Click the tab for the library
   2.3. Fill out the form:
        - Enable: Check
        - Pickup interval: 10 (or other)
        - Maximum patrons per interval: 3 (or other)
        - Patron-scheduled pickup: leave unchecked
        - Enable for waiting holds only: leave unchecked
   2.4. Enter a couple of time periods (e.g.
        - Day: Sunday
        - From: 10:00
        - To: 12:00
   2.5. Click 'Add'
   2.6. Click 'Save configuration'
3. Schedule a pickup
   3.1. Go to Circulation > Curbside pickups
   3.2. Click 'Schedule pickup'
   3.3. Search for a patron name (e.g. Henry)
   3.4. Pick a date
   3.5. Pick a time (not the first one, e.g. 10:50)
   3.6. Click 'Submit'
4. Schedule a second pickup, in a time slot before the other one
   4.1. Search for a patron name (e.g. Edna)
   4.2. Pick the same date
   4.3. Pick a time before the time selected in step 3.5 (e.g. 10:10)
   4.4. Submit
5. Check the "To be staged" tab
   --> Pickups are not ordered from soonest to latest pickup time

I think the table should maybe be a datatable with column configuration, search boxes and the arrows to order a column, to match all other tables in Koha, with the default order on the 'Pickup date/time' column.
Comment 1 Jonathan Druart 2023-02-06 15:53:21 UTC
Created attachment 146283 [details] [review]
Bug 32883: Correct cubside pickups ordering

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 staged (mark as staged) date/time
=> patron is outside ordered by arrival date/time
=> delivered today ordered by *desc* delivered date/time
Comment 2 Jonathan Druart 2023-02-06 15:54:41 UTC
We could add DataTables to those tables, but this one line patch is fixing the default sort. It should be done on a separate bug in my opinion.
Comment 3 Caroline Cyr La Rose 2023-02-06 16:47:09 UTC
The patch works as advertised.

I'm not sure about the "Staged and ready" order... Shouldn't it still be by scheduled pickup time?

I've never used this IRL, so I'm not sure of the workflow, but I feel like I could prepare the pickups in any order (as I come to them on my holds shelf for example, or I picked them up on my holds shelf, put them on a cart and went to my desk to scan them), but I'd still want to see the most "pressing" at the top, so I can check if the patron is there...
Comment 4 Caroline Cyr La Rose 2023-02-06 17:02:04 UTC
I created bug 32890 for the datatables thing
Comment 5 Jonathan Druart 2023-02-07 06:42:23 UTC
Created attachment 146305 [details] [review]
Bug 32883: Correct cubside pickups ordering

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
Comment 6 Jonathan Druart 2023-02-07 06:42:55 UTC
(In reply to Caroline Cyr La Rose from comment #3)
> I'm not sure about the "Staged and ready" order... Shouldn't it still be by
> scheduled pickup time?

Yes, I think you are right. I modified the patch.
Comment 7 Caroline Cyr La Rose 2023-02-07 14:56:13 UTC
Created attachment 146334 [details] [review]
Bug 32883: Correct cubside pickups ordering

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>
Comment 8 Caroline Cyr La Rose 2023-02-07 14:56:47 UTC
Cool, thanks Jonathan!
Comment 9 Nick Clemens 2023-03-03 18:59:52 UTC
The "Patron is outside" tab is now order by "arrival" but we still only display "Pickup date/time"

I think we want to order by the pickup date/time - so even if the patron arrives early, they still get their pickup in their slot

We should show the arrival time, but that's not for this bug
Comment 10 Jonathan Druart 2023-03-07 10:02:16 UTC
Then I think the line should be:

{ order_by => [ { -desc => 'delivered_datetime' }, 'scheduled_pickup_datetime' ], }

I won't have time to work more on this soon unfortunately.
Comment 11 Nick Clemens 2023-03-14 13:05:59 UTC
Created attachment 148163 [details] [review]
Bug 32883: Correct cubside pickups ordering

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>
Comment 12 Nick Clemens 2023-03-14 13:06:01 UTC
Created attachment 148164 [details] [review]
Bug 32883: (QA follow-up) Adjust ordering for pickups

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 13 Tomás Cohen Arazi 2023-03-27 10:06:13 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 14 Matt Blenkinsop 2023-04-11 08:54:37 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 15 Lucas Gass 2023-04-24 17:02:43 UTC
Missing dependencies for 22.05.x, no backport.