]> git.koha-community.org Git - koha.git/commit
Bug 30947: Simplify CanBookBeIssued date handling
authorJoonas Kylmälä <joonas.kylmala@iki.fi>
Sat, 11 Jun 2022 10:50:06 +0000 (10:50 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 23 Jun 2022 14:38:44 +0000 (11:38 -0300)
commit9b4b43656ebe693b1445611d4d80b808cb7c6263
tree915474685c8ed3b718207a2d5cd1ce0c52f6f46c
parent3025373b69016bb9ea6ce120f847aec143f4a1a9
Bug 30947: Simplify CanBookBeIssued date handling

1) This removes support for passing string dates to CanBookBeIssued. The
function didn't publicly even document support for string dates, only
DateTime objects.

2) We get a $duedate always at least from CalcDateDue so having

 $issuingimpossible{INVALID_DATE} = output_pref($duedate);

was unneccesary and thus removed.

3) The check "duedate cannot be before now" was needlessly complex: if
the due date really cannot be before now we should check seconds too
and warn the librarian! Thus the truncation to minutes can be dropped
safely.

To test:
 1) prove t/db_dependent/Circulation.t
 2) prove t/db_dependent/Illrequests.t
 3) Enable OnSiteCheckouts and disable SpecifyDueDate syspref. Create
 on-site checkout for any patron and verify the due date is your
 current date at 23:59, you can check the exact minute with sql:
  > select * from issues

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Circulation.pm
Koha/Illrequest.pm
circ/circulation.pl
t/db_dependent/Circulation.t