[Bug 16387] New: Incorrect loan period calculation when using decreaseLoanHighHolds feature
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Bug ID: 16387 Summary: Incorrect loan period calculation when using decreaseLoanHighHolds feature Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When a loan period is shortened due to using decreaseLoanHighHolds* the time is always set to the current time in X days, even if the original loan period is given in days and not in hours. It should default to 23:59 as is normal for loan periods given in days. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cbrannon@cdalibrary.org --- Comment #1 from Christopher Brannon <cbrannon@cdalibrary.org> --- I was just noticing this. I talked with Nick Clemens, and he thinks it might be this in circulation.pm: 1178 my $issuedate = DateTime->now( time_zone => C4::Context->tz() ); 1179 1180 my $calendar = Koha::Calendar->new( branchcode => $branch ); 1181 1182 my $itype = 1183 ( C4::Context->preference('item-level_itypes') ) 1184 ? $biblio->{'itype'} 1185 : $biblio->{'itemtype'}; 1186 1187 my $orig_due = C4::Circulation::CalcDateDue( $issuedate, $itype, $branch, $borrower ); 1188 1189 my $decreaseLoanHighHoldsDuration = C4::Context->preference('decreaseLoanHighHoldsDuration'); 1190 1191 my $reduced_datedue = $calendar->addDate( $issuedate, $decreaseLoanHighHoldsDuration ); 1192 1193 if ( DateTime->compare( $reduced_datedue, $orig_due ) == -1 ) { 1194 $return_data->{exceeded} = 1; 1195 $return_data->{duration} = $decreaseLoanHighHoldsDuration; 1196 $return_data->{due_date} = $reduced_datedue; Line 1196 is assigning the value in $reduced_datedue. Line 1191 is basing the value of $reduced_datedue from $issuedate Line 1178 is assigning $issuedate a value based on now(the time at this very moment). So somehow we need $reduced_datedue to use the same time as $orig_due, but only adjust the date, and not reference $issuedate. I would do this, but I barely understand what I am looking at, thanks to Nick's help. Hope this helps. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=17143 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |17143 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17143 [Bug 17143] Popup Notification for decreaseloanhighholds preference -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Academy -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 --- Comment #2 from Christopher Brannon <cbrannon@cdalibrary.org> --- I would love to see this resolved. I've even provided some clues to the problem. Any takers? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Lari Taskula <lari.taskula@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 --- Comment #3 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 58127 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58127&action=edit Bug 16387: Fix default shortened loan period time When a loan period is shortened due to using decreaseLoanHighHolds* the time is always set to the current time in X days, even if the original loan period is given in days and not in hours. It should default to 23:59 as is normal for loan periods given in days. As original due date time defaults to 23:59 when given in days, this patch modifies the hours and minutes of shortened due date to be equal to original due date. To test: 1. prove t/db_dependent/DecreaseLoanHighHolds.t -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Claire Gravely <claire_gravely@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |claire_gravely@hotmail.com --- Comment #4 from Claire Gravely <claire_gravely@hotmail.com> --- tests failed for me: t/db_dependent/DecreaseLoanHighHolds.t (Wstat: 768 Tests: 17 Failed: 3) Failed tests: 6-8 Non-zero exit status: 3 Files=1, Tests=17, 5 wallclock secs ( 0.04 usr 0.00 sys + 4.19 cusr 0.36 csys = 4.59 CPU) Result: FAIL -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Gracie <grace.mcky@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Gracie <grace.mcky@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58127|0 |1 is obsolete| | --- Comment #5 from Gracie <grace.mcky@gmail.com> --- Created attachment 59278 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59278&action=edit Bug 16387: Fix default shortened loan period time When a loan period is shortened due to using decreaseLoanHighHolds* the time is always set to the current time in X days, even if the original loan period is given in days and not in hours. It should default to 23:59 as is normal for loan periods given in days. As original due date time defaults to 23:59 when given in days, this patch modifies the hours and minutes of shortened due date to be equal to original due date. To test: 1. prove t/db_dependent/DecreaseLoanHighHolds.t Signed-off-by: Grace McKenzie <grace.mcky@gmail.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Gracie <grace.mcky@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |grace.mcky@gmail.com --- Comment #6 from Gracie <grace.mcky@gmail.com> --- The test plan passed for me t/db_dependent/DecreaseLoanHighHolds.t .. ok All tests successful. Files=1, Tests=14, 4 wallclock secs ( 0.05 usr 0.01 sys + 3.42 cusr 0.14 csys = 3.62 CPU) Result: PASS -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 --- Comment #7 from Gracie <grace.mcky@gmail.com> --- Created attachment 59285 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59285&action=edit Bug 17917: Fix path issue in t/db_dependent/check_sysprefs.t C4::Context->config('intranet') is returning different values based on whether it is a full t/db_dependent test or a specific check_sysprefs.t test run. Tests are only run in kohaclone, so it makes no sense to reference config at all. Brought in rel2abs logic to build a reasonable $root_dir. TEST PLAN --------- -- on a kohadevbox sudo apt-get update sudo apt-get upgrade -- need to make sure the koha-commonpackage is more current git checkout master git pull sudo koha-shell -c "prove t/db_dependent" kohadev -- this should have a check_sysprefs.t failure sudo koha-shell -c "prove t/db_dependent/check_sysprefs.t" kohadev -- this should strangely pass git checkout -b bug_17917 origin/master git bz apply 17917 sudo koha-shell -c "prove t/db_dependent" kohadev -- there will not be a check_sysprefs.t failure sudo koha-shell -c "prove t/db_dependent/check_sysprefs.t" kohadev -- this should pass -- run koha qa test tools Signed-off-by: Grace McKenzie <grace.mcky@gmail.com> Current status: Signed Off -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #59278|0 |1 is obsolete| | Attachment #59285|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 59619 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59619&action=edit Bug 16387: Fix default shortened loan period time When a loan period is shortened due to using decreaseLoanHighHolds* the time is always set to the current time in X days, even if the original loan period is given in days and not in hours. It should default to 23:59 as is normal for loan periods given in days. As original due date time defaults to 23:59 when given in days, this patch modifies the hours and minutes of shortened due date to be equal to original due date. To test: 1. prove t/db_dependent/DecreaseLoanHighHolds.t Signed-off-by: Grace McKenzie <grace.mcky@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Assignee|koha-bugs@lists.koha-commun |lari.taskula@jns.fi |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |kyle@bywatersolutions.com --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.04, thanks Lari! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Love the tests! This patch has been pushed to 16.11.x and will be in 16.11.04. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16387 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #11 from Julian Maurice <julian.maurice@biblibre.com> --- Pushed to 3.22.x for 3.22.17 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org