[Bug 25020] New: Extending due dates to a specified date should preserve time portion of original due date
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Bug ID: 25020 Summary: Extending due dates to a specified date should preserve time portion of original due date Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org When using the tool 'batch extend due dates' the time portion of a checkout is lost when setting a specific date. To recreate: 1 - Checkout an item 2 - Note the date due has time of 23:59 3 - Checkout an item and specify the time in the checkout 4 - Note it displays 5 - Use Tools->Batch extend due date 6 - Enter params to capture the two issues you just made 7 - Extend to a specified date 8 - Note checkouts are now due at 00:00:00 -- 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=25020 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |24846 CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |kelly@bywatersolutions.com, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com, tomascohen@gmail.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24846 [Bug 24846] Add a tool to bulk edit due dates -- 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=25020 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.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=25020 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 102085 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102085&action=edit Bug 25020: Preserve time part when batch extending due dates When selecting a new hard due date, we should keep the time part of the original checkouts. Test plan: 1 - Checkout an item specifying a date due 2 - Checkout an item without specifying a date due 3 - Use Tools->Batch extend due date 4 - Select a hard due date 5 - On the confirmation screen you should see that the time part has been kept 6 - Confirm 7 - Make sure the correct values hava been inserted in DB 8 - Try now using the other option, give a number of days 9 - Repeat 4-7 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102085|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 102123 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102123&action=edit Bug 25020: Preserve time part when batch extending due dates When selecting a new hard due date, we should keep the time part of the original checkouts. Test plan: 1 - Checkout an item specifying a date due 2 - Checkout an item without specifying a date due 3 - Use Tools->Batch extend due date 4 - Select a hard due date 5 - On the confirmation screen you should see that the time part has been kept 6 - Confirm 7 - Make sure the correct values hava been inserted in DB 8 - Try now using the other option, give a number of days 9 - Repeat 4-7 Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102123|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102250 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102250&action=edit Bug 25020: Preserve time part when batch extending due dates When selecting a new hard due date, we should keep the time part of the original checkouts. Test plan: 1 - Checkout an item specifying a date due 2 - Checkout an item without specifying a date due 3 - Use Tools->Batch extend due date 4 - Select a hard due date 5 - On the confirmation screen you should see that the time part has been kept 6 - Confirm 7 - Make sure the correct values hava been inserted in DB 8 - Try now using the other option, give a number of days 9 - Repeat 4-7 Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102251 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102251&action=edit [OPTIONAL] Bug 25020: (QA follow-up) Add some tests This patch adds a new method Koha::Checkout->shift_due_date that accepts the same parameters we provide in the form. It catches bad scenarios (type errors, passing both parameters when only one is accepted, and so on). Date manipulation is tested so time is kept and resulting dates are correct. The controller script is cleaned a bit to use the introduced method. I do this because: - We really need tests for this and doing it with selenium is no-end - I see a use for this new method for encapsulating behaviours, for example we might want to add Calendar support for the 'days' use case, and having the method here assures we will have tests, etc. To test: 1. Apply this patches 2. Repeat the original test plan => SUCCESS: Everything works as expected 3. Run: $ kshell k$ prove t/db_dependent/Koha/Checkout.t => SUCCESS: Tests pass! 4. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- @RM I've added my two cents there as I see this is going to get more 'features' sooner than later. Feel free to ditch the follow-up. The original patch is PQA even if I think we should go with something more like the follow-up. Cheers -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=24608 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Thanks for the follow-up Tomas. A quick note, I think this kind of tests is overkill and not needed: + Koha::Exceptions::WrongParameter->throw( + "'hard_due_date' must be a DateTime object" + ) unless $hard_due_date->isa('DateTime'); + + $due_date = $hard_due_date->clone->set( + hour => $due_date->hour, + minute => $due_date->minute, + second => $due_date->second + ); + } + else { + Koha::Exceptions::WrongParameter->throw( + "'days' must be an integer" + ) unless looks_like_number($days); + $due_date->add( days => $days ); Developers will get an error anyway if $days is not an integer (DateTime will raise its own meaningful exception), or $hard_due_date is not a DateTime. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102251|0 |1 is obsolete| | --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Comment on attachment 102251 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102251 [OPTIONAL] Bug 25020: (QA follow-up) Add some tests Moved to bug 25039 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25039 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25039 [Bug 25039] Move new due calculation to Koha::Checkout -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|20.05.00 |20.05.00, 19.11.05 released in| | CC| |joy@bywatersolutions.com --- Comment #9 from Joy Nelson <joy@bywatersolutions.com> --- Backported to 19.11.x branch for 19.11.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |25101 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25101 [Bug 25101] Add ability to skip previewing results when batch extending due dates -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.05.00, 19.11.05 |20.05.00, 19.11.05, released in| |19.05.10 Status|Pushed to stable |Pushed to oldstable CC| |lucas@bywatersolutions.com --- Comment #10 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 19.05.c for 19.05.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Hayley Mapley <hayleymapley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Pushed to oldoldstable Version(s)|20.05.00, 19.11.05, |20.05.00, 19.11.05, released in|19.05.10 |19.05.10, 18.11.16 CC| |hayleymapley@catalyst.net.n | |z --- Comment #11 from Hayley Mapley <hayleymapley@catalyst.net.nz> --- Backported to 18.11.x for 18.11.16 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25020 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26552 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org