Bug 13255

Summary: On-site checkout due date wrong if SpecifyDueDate is disabled
Product: Koha Reporter: Owen Leonard <oleonard>
Component: CirculationAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: blocker    
Priority: P5 - low CC: gmcharlt, jonathan.druart, kyle.m.hall, mirko, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 10860    
Bug Blocks:    
Attachments: Bug 13255: On-site checkout due date wrong if SpecifyDueDate is disabled
Bug 13255: On-site checkout due date wrong if SpecifyDueDate is disabled
[PASSED QA] Bug 13255: On-site checkout due date wrong if SpecifyDueDate is disabled

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 2014-11-20 00:47:51 UTC
Patch pushed to master.

Thanks Jonathan!