[Bug 18607] New: Fix date calculations for monthly frequencies in Serials
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Bug ID: 18607 Summary: Fix date calculations for monthly frequencies in Serials Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Serials Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org CC: colin.campbell@ptfs-europe.com Similar to bug 18356 -- 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=18607 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |18356 CC| |nick@bywatersolutions.com Status|NEW |ASSIGNED Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18356 [Bug 18356] Prediction pattern wrong, skips years, for some year based frequencies -- 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=18607 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |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=18607 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 63841 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63841&action=edit Bug 18607: Fix date calculations for monthly frequencies in Serials Similarly to the solution of bug 18356, this patch fixes the date calculation for monthly frequencies. The calculation in GetFictiveIssueNumber was that similar that we could merge the algorithm for months and years. Note that we add a wrapper around Date::Calc::N_Delta_YMD in order to improve its results. The calculation in _get_next_date_month is also very similar to the one in _get_next_date_year. I do not merge them here, but this could still be considered later on. At least consistency is achieved now between both routines. The connection with firstacquidate has been cut thru just like for year units. Test plan: [1] Edit an subscription. Check some monthly prediction patterns. [2] The next patch adjusts related unit tests. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 63842 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63842&action=edit Bug 18607: Adjusting unit tests for monthly serial frequencies The changes in the first patch require some corrections as well as additional test cases. GetNextDate.t: Since the calculation for multiple issues per unit has slightly changed, a few dates (day 15 or day 16) have been changed in the unit test; when we use 2/month, the algorithm now always adds 15 days. Added a few test descriptions in this regard too. GetFictiveIssueNumber.t: Add the monthly subtest with two test cases. In the first case we tests multiple units per issue, and in the second case we test multiple issues per unit (month). Test plan: [1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t [2] Run t/db_dependent/Serials/GetNextDate.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63841|0 |1 is obsolete| | --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 63843 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63843&action=edit Bug 18607: Fix date calculations for monthly frequencies in Serials Similarly to the solution of bug 18356, this patch fixes the date calculation for monthly frequencies. The calculation in GetFictiveIssueNumber was that similar that we could merge the algorithm for months and years. Note that we add a wrapper around Date::Calc::N_Delta_YMD in order to improve its results. The calculation in _get_next_date_month is also very similar to the one in _get_next_date_year. I do not merge them here, but this could still be considered later on. At least consistency is achieved now between both routines. The connection with firstacquidate has been cut thru just like for year units. Test plan: [1] Without this patch, look at the prediction pattern for a subscription with first issue on Feb 21 and 5 per month. The first issues will be 21, 22, 23, 24, 25. Then jumping to 21, 23, 25, etc. [2] Apply the patch. Look at the same prediction pattern. You will now see 6 day intervals and a new cycle starting on the 21st. So Feb 21, 27, Mar 5, 11, 17 and Mar 21, 27, etc. [3] Edit an subscription. Try a few other monthly frequencies. [4] The next patch adjusts related unit tests. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63842|0 |1 is obsolete| | --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 63844 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63844&action=edit Bug 18607: Adjusting unit tests for monthly serial frequencies The changes in the first patch require some corrections as well as additional test cases. GetNextDate.t: Since the calculation for multiple issues per unit has slightly changed, a few dates (day 15 or day 16) have been changed in the unit test; when we use 2/month, the algorithm now always adds 15 days. Added a few test descriptions in this regard too. GetFictiveIssueNumber.t: Add the monthly subtest with two test cases. In the first case we tests multiple units per issue, and in the second case we test multiple issues per unit (month). Test plan: [1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t [2] Run t/db_dependent/Serials/GetNextDate.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18697 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18697 [Bug 18697] Fix date calculations for day/week frequencies in Serials -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=18607 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |BLOCKED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63843|0 |1 is obsolete| | --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 63873 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63873&action=edit Bug 18607: Fix date calculations for monthly frequencies in Serials Similarly to the solution of bug 18356, this patch fixes the date calculation for monthly frequencies. The calculation in GetFictiveIssueNumber now makes use of the new _delta_units sub introduced on bug 18356. The calculation in _get_next_date_month is also very similar to the one in _get_next_date_year. I do not merge them here, but this could still be considered later on. At least consistency is achieved now between both routines. The connection with firstacquidate has been cut thru just like for year units. Test plan: [1] Without this patch, look at the prediction pattern for a subscription with first issue on Feb 21 and 5 per month. The first issues will be 21, 22, 23, 24, 25. Then jumping to 21, 23, 25, etc. [2] Apply the patch. Look at the same prediction pattern. You will now see 6 day intervals and a new cycle starting on the 21st. So Feb 21, 27, Mar 5, 11, 17 and Mar 21, 27, etc. [3] Edit an subscription. Try a few other monthly frequencies. [4] The next patch adjusts related unit tests. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63844|0 |1 is obsolete| | --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 63874 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63874&action=edit Bug 18607: Adjusting unit tests for monthly serial frequencies The changes in the first patch require some corrections as well as additional test cases. GetNextDate.t: Since the calculation for multiple issues per unit has slightly changed, a few dates (day 15 or day 16) have been changed in the unit test; when we use 2/month, the algorithm now always adds 15 days. Added a few test descriptions in this regard too. GetFictiveIssueNumber.t: Add the monthly subtest with two test cases. In the first case we tests multiple units per issue, and in the second case we test multiple issues per unit (month). Test plan: [1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t [2] Run t/db_dependent/Serials/GetNextDate.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18356 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|BLOCKED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Josef Moravec <josef.moravec@gmail.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=18607 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #63873|0 |1 is obsolete| | Attachment #63874|0 |1 is obsolete| | --- Comment #7 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 64023 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64023&action=edit [SIGNED-OFF] Bug 18607: Fix date calculations for monthly frequencies in Serials Similarly to the solution of bug 18356, this patch fixes the date calculation for monthly frequencies. The calculation in GetFictiveIssueNumber now makes use of the new _delta_units sub introduced on bug 18356. The calculation in _get_next_date_month is also very similar to the one in _get_next_date_year. I do not merge them here, but this could still be considered later on. At least consistency is achieved now between both routines. The connection with firstacquidate has been cut thru just like for year units. Test plan: [1] Without this patch, look at the prediction pattern for a subscription with first issue on Feb 21 and 5 per month. The first issues will be 21, 22, 23, 24, 25. Then jumping to 21, 23, 25, etc. [2] Apply the patch. Look at the same prediction pattern. You will now see 6 day intervals and a new cycle starting on the 21st. So Feb 21, 27, Mar 5, 11, 17 and Mar 21, 27, etc. [3] Edit an subscription. Try a few other monthly frequencies. [4] The next patch adjusts related unit tests. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 --- Comment #8 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 64024 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64024&action=edit [SIGNED-OFF] Bug 18607: Adjusting unit tests for monthly serial frequencies The changes in the first patch require some corrections as well as additional test cases. GetNextDate.t: Since the calculation for multiple issues per unit has slightly changed, a few dates (day 15 or day 16) have been changed in the unit test; when we use 2/month, the algorithm now always adds 15 days. Added a few test descriptions in this regard too. GetFictiveIssueNumber.t: Add the monthly subtest with two test cases. In the first case we tests multiple units per issue, and in the second case we test multiple issues per unit (month). Test plan: [1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t [2] Run t/db_dependent/Serials/GetNextDate.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Attachment #64023|0 |1 is obsolete| | Attachment #64024|0 |1 is obsolete| | Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #9 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 64315 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64315&action=edit Bug 18607: Fix date calculations for monthly frequencies in Serials Similarly to the solution of bug 18356, this patch fixes the date calculation for monthly frequencies. The calculation in GetFictiveIssueNumber now makes use of the new _delta_units sub introduced on bug 18356. The calculation in _get_next_date_month is also very similar to the one in _get_next_date_year. I do not merge them here, but this could still be considered later on. At least consistency is achieved now between both routines. The connection with firstacquidate has been cut thru just like for year units. Test plan: [1] Without this patch, look at the prediction pattern for a subscription with first issue on Feb 21 and 5 per month. The first issues will be 21, 22, 23, 24, 25. Then jumping to 21, 23, 25, etc. [2] Apply the patch. Look at the same prediction pattern. You will now see 6 day intervals and a new cycle starting on the 21st. So Feb 21, 27, Mar 5, 11, 17 and Mar 21, 27, etc. [3] Edit an subscription. Try a few other monthly frequencies. [4] The next patch adjusts related unit tests. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 64316 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64316&action=edit Bug 18607: Adjusting unit tests for monthly serial frequencies The changes in the first patch require some corrections as well as additional test cases. GetNextDate.t: Since the calculation for multiple issues per unit has slightly changed, a few dates (day 15 or day 16) have been changed in the unit test; when we use 2/month, the algorithm now always adds 15 days. Added a few test descriptions in this regard too. GetFictiveIssueNumber.t: Add the monthly subtest with two test cases. In the first case we tests multiple units per issue, and in the second case we test multiple issues per unit (month). Test plan: [1] Run t/db_dependent/Serials/GetFictiveIssueNumber.t [2] Run t/db_dependent/Serials/GetNextDate.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 17.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |fridolin.somers@biblibre.co | |m --- Comment #12 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.05.x, will be in 17.05.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- These patches have been pushed to 16.11.x and will be in 16.11.10. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #14 from Mason James <mtj@kohaaloha.com> --- Pushed to 16.05.x, for 16.05.15 release -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org