Bug 24239: Let the ILL module set ad hoc hard due dates
authorLari Taskula <lari.taskula@hypernova.fi>
Fri, 13 Dec 2019 12:17:55 +0000 (13:17 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 23 Jun 2022 18:30:06 +0000 (15:30 -0300)
commite9bab63e80412f3b9e2457ef0f76f6660c8d3d24
treeeed0265359b00c7a61f4656989329354e4c9aa8c
parent5b8e1d6f02eab714573c43fde7a79d2c1aa5a1b2
Bug 24239: Let the ILL module set ad hoc hard due dates

The Swedish Libris ILL backend lets librarians store a specific due date
when an ILL loan is received.

This patch set adds a new date_due column to the illrequets table that can be
used by the different backends to store a due date. If an illrequest has the
date due set, it will be used when the item is checked out instead of the calculation
using the circulation conditions.

To test:
- Apply the patch and make sure the atomic database update is run
- Use the FreeForm backend to add one ILL request. Take note  of the
  illrequest_id of the request you created. We refer to this as
  "x" below.
- Connect a biblio (with biblionumber y), that has an item with a
  barcode, to the ILL request directly in the database:
  UPDATE illrequests SET biblio_id = y WHERE illrequest_id = x;
- Next we set the due date, this would normally be done by or from the backend.
  UPDATE illrequests SET date_due = "2023-01-01" WHERE illrequest_id = x;
- Go to circulation and issue the barcode of the item to the
  patron associated with the FreeForm ILL request. Verify that the
  loan gets a due date of 2023-01-01.
- Ideally: return the item and issue it again through SIP2 and SCO,
  and verify that the due date is still 2023-01-01.
- Verify that there are no regressions, so that regular calculation
  of due dates still work.
- prove t/db_dependent/Circulation.t

(Patch description, test plan and partial code credits to Magnus Enger)

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(Patch description and test plan rewritten to reflect changes in development)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Circulation.pm