Comment 5 for bug 1533424

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

In 3.11.1, setting a duration rule of 00:00:00 also results in the due date being set to 23:59:59 for the current day.

We have laptops we checkout for the day for in library use. It would be great if the due date could be set to the circulation lib closing time.

Having them due that night at 23:59:59 works ok, but it would be better if it was the closing time for communication with the customer. It would make it a little easier to send out a notice of some sort immediately if wanted. (So far our only overdue's have been because staff don't check them in at closing though... cannot really solve that in Evergreen.)

What if the duration rule had an extra flag for due at close, or truncate to close time to handle this?

The duration part of the duration rule gets stored in the action.circulation object. Looks like we could adjust the circ->duration so it works out to being due at closing. Or adjust the due date afterwards to set it to closing. Adjusting the circ->duration might mess up renewals though... so probably it would be best to check after the due date has been generated?

=====
Notes on how the due date logic works and where the code is at.

* sub build_checkout_circ_object in Circulate.pm builds the circulation object.

* sub create_due_date in Circulate.pm performs the initial setting of the due date based on the duration rule and hard due date.
https://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm;hb=HEAD#l2459

* sub apply_modified_due_date in Circulate.pm seems like it handles adjusting due dates for closed days.
https://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm;hb=HEAD#l2349

* The trigger push_due_date_trg runs action.push_circ_due_time to push the due dates to the end of the day.
https://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/sql/Pg/090.schema.action.sql;hb=HEAD#l188

Related to Thomas's possible work around, bug #1178802 , forces ceiling dates for hard due dates to be set to end of day in the admin interface. Not sure if this was moved to the Angular interface if it exists or not. But that seems to rule out manually setting hard due dates with a specific hour... unless you bypass the interface.