Bug 32627

Summary: Reprinting holds slips should not reset the expiration date
Product: Koha Reporter: Laura Escamilla <Laura.escamilla>
Component: Hold requestsAssignee: Emily Lamancusa (emlam) <emily.lamancusa>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: danyonsewell, ddaghita, emily.lamancusa, gmcharlt, kebliss, kyle, lucas
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.06,22.05.14
Circulation function:
Attachments: Bug 32627: Calculate expirationdate relative to waitingdate
Bug 32627: Calculate expirationdate relative to waitingdate
Bug 32627: Calculate expirationdate relative to waitingdate
Bug 32627: Calculate expirationdate relative to waitingdate

Description Laura Escamilla 2023-01-13 14:10:04 UTC
Occasionally, the slips in items waiting on the holds shelf tend to get pulled out. When this happens, library staff check in items to reprint the slips. Previous to the latest upgrade the holds expiration date would remain the same, but now the expiration date is being calculated based on the NEW date the item is checked in.
Comment 1 Emily Lamancusa (emlam) 2023-04-04 14:58:25 UTC
Created attachment 149130 [details] [review]
Bug 32627: Calculate expirationdate relative to waitingdate

Hold::set_waiting should calculate the MaxPickupDelay expiration date
based on waitingdate rather than the current date, to avoid resetting
the expirationdate on a hold that was already waiting.

To test:
1. Place a hold and check in the item so the hold will be set to Waiting
2. Confirm that the expiration date is correct based on the
   ReservesMaxPickupDelay setting
3. Adjust your system clock to one day later
4. Check in the item again and confirm the hold
5. Note that the expiration date has changed
7. Apply patch and restart_all
8. Repeat steps 1-4. Confirm that the expiration date is calculated
   correctly, and does not change when the item is checked in again
9. Reset your system clock to the current date
10. Set ExcludeHolidaysFromMaxPickupDelay to Use the Calendar
11. Add an upcoming holiday to the calendar
12. Repeat steps 1-4. Confirm the expiration date correctly accounts for
    the holiday, and does not change when the item is checked in again
Comment 2 Lucas Gass (lukeg) 2023-04-04 22:32:37 UTC
Created attachment 149148 [details] [review]
Bug 32627: Calculate expirationdate relative to waitingdate

Hold::set_waiting should calculate the MaxPickupDelay expiration date
based on waitingdate rather than the current date, to avoid resetting
the expirationdate on a hold that was already waiting.

To test:
1. Place a hold and check in the item so the hold will be set to Waiting
2. Confirm that the expiration date is correct based on the
   ReservesMaxPickupDelay setting
3. Adjust your system clock to one day later
4. Check in the item again and confirm the hold
5. Note that the expiration date has changed
7. Apply patch and restart_all
8. Repeat steps 1-4. Confirm that the expiration date is calculated
   correctly, and does not change when the item is checked in again
9. Reset your system clock to the current date
10. Set ExcludeHolidaysFromMaxPickupDelay to Use the Calendar
11. Add an upcoming holiday to the calendar
12. Repeat steps 1-4. Confirm the expiration date correctly accounts for
    the holiday, and does not change when the item is checked in again

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 3 ByWater Sandboxes 2023-04-06 17:52:07 UTC
Created attachment 149245 [details] [review]
Bug 32627: Calculate expirationdate relative to waitingdate

Hold::set_waiting should calculate the MaxPickupDelay expiration date
based on waitingdate rather than the current date, to avoid resetting
the expirationdate on a hold that was already waiting.

To test:
1. Place a hold and check in the item so the hold will be set to Waiting
2. Confirm that the expiration date is correct based on the
   ReservesMaxPickupDelay setting
3. Adjust your system clock to one day later
4. Check in the item again and confirm the hold
5. Note that the expiration date has changed
7. Apply patch and restart_all
8. Repeat steps 1-4. Confirm that the expiration date is calculated
   correctly, and does not change when the item is checked in again
9. Reset your system clock to the current date
10. Set ExcludeHolidaysFromMaxPickupDelay to Use the Calendar
11. Add an upcoming holiday to the calendar
12. Repeat steps 1-4. Confirm the expiration date correctly accounts for
    the holiday, and does not change when the item is checked in again

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 4 Kyle M Hall (khall) 2023-04-28 17:17:28 UTC
Created attachment 150403 [details] [review]
Bug 32627: Calculate expirationdate relative to waitingdate

Hold::set_waiting should calculate the MaxPickupDelay expiration date
based on waitingdate rather than the current date, to avoid resetting
the expirationdate on a hold that was already waiting.

To test:
1. Place a hold and check in the item so the hold will be set to Waiting
2. Confirm that the expiration date is correct based on the
   ReservesMaxPickupDelay setting
3. Adjust your system clock to one day later
4. Check in the item again and confirm the hold
5. Note that the expiration date has changed
7. Apply patch and restart_all
8. Repeat steps 1-4. Confirm that the expiration date is calculated
   correctly, and does not change when the item is checked in again
9. Reset your system clock to the current date
10. Set ExcludeHolidaysFromMaxPickupDelay to Use the Calendar
11. Add an upcoming holiday to the calendar
12. Repeat steps 1-4. Confirm the expiration date correctly accounts for
    the holiday, and does not change when the item is checked in again

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Tomás Cohen Arazi (tcohen) 2023-05-12 14:20:49 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 6 Matt Blenkinsop 2023-05-15 12:42:22 UTC
Nice work everyone!

Pushed to stable for 22.11.x
Comment 7 Lucas Gass (lukeg) 2023-06-15 19:11:18 UTC
Backported to 22.05.x for upcoming 22.05.14
Comment 8 Danyon Sewell 2023-07-20 04:14:32 UTC
Not backporting for 21.11.x
Comment 9 davedaghita 2023-09-11 21:56:07 UTC
did this get backported to 22.11,08, noticed issue after Labor day when reprinting slips.
Comment 10 Katrin Fischer 2023-09-12 07:26:57 UTC
(In reply to Dave from comment #9)
> did this get backported to 22.11,08, noticed issue after Labor day when
> reprinting slips.

Hi Dave, if you scroll to the top there is the field: Version(s) released in. This fix was in 22.11.06
Comment 11 davedaghita 2023-09-12 14:03:31 UTC
(In reply to Katrin Fischer from comment #10)
> (In reply to Dave from comment #9)
> > did this get backported to 22.11,08, noticed issue after Labor day when
> > reprinting slips.
> 
> Hi Dave, if you scroll to the top there is the field: Version(s) released
> in. This fix was in 22.11.06

Hi Katrin, Thank you, I overlooked that field.