Summary: | Current bookings are not counted in record side bar | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Circulation | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | Needs documenting --- | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
Severity: | normal | ||
Priority: | P5 - low | CC: | david, fridolin.somers, gmcharlt, kkrueger, kyle.m.hall, lucas, marie.hedbom, samalau |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This fixes the number of bookings shown for a record (in the sidebar menu for a record) and on a patron's details page (the Bookings tab). It now shows future and active bookings in the count, instead of just future bookings.
|
Version(s) released in: |
24.11.00,24.05.02
|
Circulation function: | bookings | ||
Bug Depends on: | 29002 | ||
Bug Blocks: | 37065 | ||
Attachments: |
Bug 36428: Add Bookings->filter_by_active and use it for display
Bug 36428: Add Bookings->filter_by_active and use it for display Bug 36428: Add Bookings->filter_by_active and use it for display Bug 36428: (QA follow-up) Remove filter_by_future Bug 36428: (QA follow-up) Add bookings_count class to patron details |
Description
Nick Clemens (kidclamp)
2024-03-26 12:58:25 UTC
Created attachment 167308 [details] [review] Bug 36428: Add Bookings->filter_by_active and use it for display Currently the bookings tab on a biblio details and patron details use 'filter_by_future' which lists upcoming bookings. Libraries would like to see upcoming, and active bookings in these cases, and we should add a filter for bookings that have not ended. NOTE: This removes the only uses of filter_by_future, but I preserve this for Martin's decision as the creator of the bookings module To test: 1 - Make an item bookable from the items tab on a record details 2 - Return to details view and place a booking 3 - Note sidebar says "Bookings (1)" 4 - Make the booking current from the DB: UPDATE bookings SET start_date=NOW() WHERE biblio_id={biblionumber}; 5 - Reload the page 6 - Note the count is now "Bookings (0)" 7 - View the patron's details page - note "Bookings (0)" and none listed 8 - Apply patch 9 - Reload biblio details, note Bookings(1) 10 - Reload patron details, note Bookings(1) and booking is listed 11 - End the booking: UPDATE bookings SET end_date=NOW() WHERE biblio_id={biblionumber}; 12 - Confirm booking no longer listed on biblio or patron details I followed through the test plan, but for step 12 the booking is still listed under the books section on the record details page (shows (0) in the sidebar though). Maybe something to do with differences between desktop and KTD server times? - KTD time: Fri May 31 06:51:09 PM UTC 2024 - Desktop time: Sat 01 Jun 2024 06:51:24 NZST Bookings table on the record details page: Item Patron Pickup library Start date End date Actions 39999000011418 (1) Mary Burton (23529000651225) Centerville 05/31/2024 05/31/2024 Edit Cancel Bookings database table: select * from bookings; +------------+-----------+-----------+---------+-------------------+---------------------+---------------------+ | booking_id | patron_id | biblio_id | item_id | pickup_library_id | start_date | end_date | +------------+-----------+-----------+---------+-------------------+---------------------+---------------------+ | 1 | 49 | 262 | 578 | CPL | 2024-05-31 18:39:03 | 2024-05-31 18:41:48 | +------------+-----------+-----------+---------+-------------------+---------------------+---------------------+ 1 row in set (0.001 sec) I have the same issue as David. After ending the booking, the patron details page works as expected, however, the record details page booking tab still shows the booking. It also shows 0 for me in the sidebar as expected. (In reply to David Nind from comment #2) > I followed through the test plan, but for step 12 the booking is still > listed under the books section on the record details page (shows (0) in the > sidebar though). > > Bookings table on the record details page: > > Item Patron Pickup library Start date > End date Actions > 39999000011418 (1) Mary Burton (23529000651225) Centerville 05/31/2024 > 05/31/2024 Edit Cancel This is expected -the bookings tab once loaded simply shows the most recent bookings, I only adjust the tab count and the patron page. I think it should be another bug to add a 'Show completed bookings' filter Created attachment 167694 [details] [review] Bug 36428: Add Bookings->filter_by_active and use it for display Currently the bookings tab on a biblio details and patron details use 'filter_by_future' which lists upcoming bookings. Libraries would like to see upcoming, and active bookings in these cases, and we should add a filter for bookings that have not ended. NOTE: This removes the only uses of filter_by_future, but I preserve this for Martin's decision as the creator of the bookings module To test: 1 - Make an item bookable from the items tab on a record details 2 - Return to details view and place a booking 3 - Note sidebar says "Bookings (1)" 4 - Make the booking current from the DB: UPDATE bookings SET start_date=NOW() WHERE biblio_id={biblionumber}; 5 - Reload the page 6 - Note the count is now "Bookings (0)" 7 - View the patron's details page - note "Bookings (0)" and none listed 8 - Apply patch 9 - Reload biblio details, note Bookings(1) 10 - Reload patron details, note Bookings(1) and booking is listed 11 - End the booking: UPDATE bookings SET end_date=NOW() WHERE biblio_id={biblionumber}; 12 - Confirm booking no longer listed on biblio or patron details Signed-off-by: Sam Lau <samalau@gmail.com> Created attachment 167929 [details] [review] Bug 36428: Add Bookings->filter_by_active and use it for display Currently the bookings tab on a biblio details and patron details use 'filter_by_future' which lists upcoming bookings. Libraries would like to see upcoming, and active bookings in these cases, and we should add a filter for bookings that have not ended. NOTE: This removes the only uses of filter_by_future, but I preserve this for Martin's decision as the creator of the bookings module To test: 1 - Make an item bookable from the items tab on a record details 2 - Return to details view and place a booking 3 - Note sidebar says "Bookings (1)" 4 - Make the booking current from the DB: UPDATE bookings SET start_date=NOW() WHERE biblio_id={biblionumber}; 5 - Reload the page 6 - Note the count is now "Bookings (0)" 7 - View the patron's details page - note "Bookings (0)" and none listed 8 - Apply patch 9 - Reload biblio details, note Bookings(1) 10 - Reload patron details, note Bookings(1) and booking is listed 11 - End the booking: UPDATE bookings SET end_date=NOW() WHERE biblio_id={biblionumber}; 12 - Confirm booking no longer listed on biblio or patron details Signed-off-by: Sam Lau <samalau@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 167930 [details] [review] Bug 36428: (QA follow-up) Remove filter_by_future I actually already started to remove this in another bug, but it makes sense to do it here where we're introducing the 'active' filter. I'm in agreement that this should probably always have been an 'active' rather than 'future' filtering. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 167931 [details] [review] Bug 36428: (QA follow-up) Add bookings_count class to patron details Somewhere along the line we lost the 'bookings_count' class in the bookings tab display on the patron details and circulation page. This patch restores is and as such also restores the correct count numbers on 'place booking' and 'cancel booking' actions on those pages. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Thanks all, glad to see this fixed. Passing QA Pushed for 24.11! Well done everyone, thank you! Backported to 24.05.x for upcoming 24.05.02 Looks like depends on Bug 35788 I've added a release note - I think I got this right. Please feel change if I didn't! I've also changed the status to "Needs documenting" - it doesn't look like it should be back ported to 23.11. |