Bug 13255 - On-site checkout due date wrong if SpecifyDueDate is disabled
Summary: On-site checkout due date wrong if SpecifyDueDate is disabled
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low blocker
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 10860
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-14 13:42 UTC by Owen Leonard
Modified: 2019-06-27 09:24 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 13255: On-site checkout due date wrong if SpecifyDueDate is disabled (2.87 KB, patch)
2014-11-14 16:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13255: On-site checkout due date wrong if SpecifyDueDate is disabled (2.93 KB, patch)
2014-11-19 19:05 UTC, Mirko Tietgen
Details | Diff | Splinter Review
[PASSED QA] Bug 13255: On-site checkout due date wrong if SpecifyDueDate is disabled (3.04 KB, patch)
2014-11-19 19:47 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2014-11-14 13:42:07 UTC
If you have the SpecifyDueDate preference disabled and check something out as an on-site checkout the due date seems to follow the default circulation rule rather than restricted the checkout to that day.
Comment 1 Owen Leonard 2014-11-14 14:38:33 UTC
Tying the on-site checkout due date to the template doesn't look like it can work if the SpecifyDueDate preference is turned off. circulation.pl won't even consider the date which gets passed if SpecifyDueDate is off:

circulation.pl line 160:

my $duedatespec_allow = C4::Context->preference('SpecifyDueDate');
if($duedatespec_allow){
    if ($duedatespec) {
        if ($duedatespec =~ C4::Dates->regexp('syspref')) {
                $datedue = dt_from_string($duedatespec);

Because of this it's probably better to calculate the custom due date for on-site checkouts in circulation.pl based on the onsite_checkout checkbox value.
Comment 2 Jonathan Druart 2014-11-14 16:18:31 UTC Comment hidden (obsolete)
Comment 3 Mirko Tietgen 2014-11-19 19:05:39 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2014-11-19 19:47:45 UTC
Created attachment 33695 [details] [review]
[PASSED QA] Bug 13255: On-site checkout due date wrong if SpecifyDueDate is disabled

If you have the SpecifyDueDate preference disabled and check something
out as an on-site checkout the due date seems to follow the default
circulation rule rather than restricted the checkout to that day.

Test plan:
0/ Disable SpecifyDueDate and enable OnSiteCheckouts
1/ Check an item out to a patron and check the 'On-site checkout'
checkbox
2/ Verify (screen and DB) that the due date is correct (today 23:59)

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes tests and QA script.
Comment 5 Tomás Cohen Arazi (tcohen) 2014-11-20 00:47:51 UTC
Patch pushed to master.

Thanks Jonathan!