bug 2975: fix calculation of due dates by offline circ
authorGalen Charlton <gmcharlt@gmail.com>
Thu, 3 Mar 2011 19:52:46 +0000 (14:52 -0500)
committerChris Cormack <chrisc@catalyst.net.nz>
Mon, 7 Mar 2011 01:35:19 +0000 (14:35 +1300)
commit935635aba5dc0ab62f9476986cc418ae8c980b57
tree21beef20674d0f3f6b7ea554af635a3a26b4b74a
parentb2e7b5aacafe6bf887bbb7e8e92dabdc638b11e4
bug 2975: fix calculation of due dates by offline circ

Offline circ no longer tries to calculate the due date
directly, instead relying on the AddIssue and AddRenewal
APIs to do so.  This corrects a bug where the due date
would be calculated incorrectly if the item-level_itypes
system preference is turned on.

This change also has the effect of causing the issue date
for loans uploaded via offline circulation to be set
to the time stamp recorded by the offline circulation client.

Test plan:

* Turn on item-level_itypes
* Create an example item whose loan policy per
  the item's item type would be different from
  the default policy based on the bib-level type.
* Create a test KOC file with a loan of the test
  item and the checkout date artificially set
  to yesterday.
* Upload the file:
  - Before the fix, the due date would be set
    to the default due date.  Also, the issue date
    will be set to the date of the upload.
  - After the fix, the due date would be calculated
    correctly based on the item's item type.  Also,
    the issue date will be set to the date recorded
    by the offline circulation client.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
offline_circ/process_koc.pl