[Bug 12671] New: Guess next serial date when there are several issues per unit
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Bug ID: 12671 Summary: Guess next serial date when there are several issues per unit Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Serials Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: colin.campbell@ptfs-europe.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 30291 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=30291&action=edit Bug 12671: Refactor GetNextDate -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 --- Comment #2 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 30292 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=30292&action=edit Bug 12671: Guess next serial date when there are several issues per unit This guess uses the following algorithm 1/ Get the number of days remaining from first issue of this unit of time until the end of the unit of time (using 7 days for week, 28 for month and 365 for year) 2/ Divide it by the number of issues per unit 3/ Take the integer part of the result, this is the number of days to add to previous serial published date This patch also try to guess the date of the first issue of a unit of time. Before that, it was: - for week: monday of week - for month: 1st day of month - for year: 1st day of year Now it uses firstacquidate. Example: firstacquidate = 1970-01-07 (wednesday) unit = week issuesperunit = 2 (2 issues per week) From wednesday to sunday, there are 4 days so we add 2 days to get the next date. The next dates should be: - 1970-01-09 (+ 2 days) - 1970-01-14 (wednesday of next week) - 1970-01-16 (+ 2 days) - ... and so on Test plan: 1/ Go to numbering pattern creation page (Serials -> Manager numbering patterns -> New numbering pattern) 2/ In "Test prediction pattern" fieldset, set subscription length to 50 issues (this avoid to compute the next 1000 dates, which can take time) 3/ Fill first issue publication date 4/ Choose the frequency you want to test 5/ click on "Test pattern" button 6/ Check that the dates are correct 7/ Repeat steps 3-7 until you think you have tested enough cases Interesting frequencies to test: - 1/day - 1/week - 2/week - 6/week (firstacquidate should be monday or tuesday, or the generated dates will be the same for all the week) - 1/month - 2/month - 3/month - 1/year - 2/year - 3/year -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 --- Comment #3 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 34658 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34658&action=edit Bug 12671: Guess next serial date when there are several issues per unit. Added support for real month and year lenghts. When getting the next frequency number, use the real number of days for each month and each year. Unit tests updated. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |olli-antti.kivilahti@jns.fi --- Comment #4 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Thanks for the awesome patch! I am pushing this to production and getting feedback from our Serials people. We are just inserting our subscriptions using the Koha's serials-module. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #30291|0 |1 is obsolete| | --- Comment #5 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 34659 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34659&action=edit Bug 12671: Refactor GetNextDate A much needed refactoring. Thanks for seeing the effort through. Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #30292|0 |1 is obsolete| | --- Comment #6 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 34660 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34660&action=edit Bug 12671: Guess next serial date when there are several issues per unit This guess uses the following algorithm 1/ Get the number of days remaining from first issue of this unit of time until the end of the unit of time (using 7 days for week, 28 for month and 365 for year) 2/ Divide it by the number of issues per unit 3/ Take the integer part of the result, this is the number of days to add to previous serial published date This patch also try to guess the date of the first issue of a unit of time. Before that, it was: - for week: monday of week - for month: 1st day of month - for year: 1st day of year Now it uses firstacquidate. Example: firstacquidate = 1970-01-07 (wednesday) unit = week issuesperunit = 2 (2 issues per week) From wednesday to sunday, there are 4 days so we add 2 days to get the next date. The next dates should be: - 1970-01-09 (+ 2 days) - 1970-01-14 (wednesday of next week) - 1970-01-16 (+ 2 days) - ... and so on Test plan: 1/ Go to numbering pattern creation page (Serials -> Manager numbering patterns -> New numbering pattern) 2/ In "Test prediction pattern" fieldset, set subscription length to 50 issues (this avoid to compute the next 1000 dates, which can take time) 3/ Fill first issue publication date 4/ Choose the frequency you want to test 5/ click on "Test pattern" button 6/ Check that the dates are correct 7/ Repeat steps 3-7 until you think you have tested enough cases Interesting frequencies to test: - 1/day - 1/week - 2/week - 6/week (firstacquidate should be monday or tuesday, or the generated dates will be the same for all the week) - 1/month - 2/month - 3/month - 1/year - 2/year - 3/year ---------------- Sign off report: ---------------- -Followed the test plan. Unit tests work. Also trying some more strange frequencies with our librarians: 5/year, 43/year, 10/year. -Received all serials for a subscription and found no errors. -Received some serials with frequency 2/month pre-patch, getting publication date as 1st of every month for each magazine. Having applied the patch, publication dates started working mid-subscription for new magazines. -Works well and fine! Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> --- Changed status to signed off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Status|Signed Off |Patch doesn't apply --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am sorry, patches no longer apply on current master: Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 12671: Guess next serial date when there are several issues per unit. Added support for real month and year lenghts. fatal: sha1 information is lacking or useless (C4/Serials.pm). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 12671: Guess next serial date when there are several issues per unit. Added support for real month and year lenghts. The copy of the patch that failed is found in: /home/katrin/kohaclone/.git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-12671-Guess-next-serial-date-when-there-are-se-UWVsuV.patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34659|0 |1 is obsolete| | --- Comment #9 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 36924 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36924&action=edit Bug 12671: Refactor GetNextDate Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34660|0 |1 is obsolete| | --- Comment #10 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 36925 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36925&action=edit Bug 12671: Guess next serial date when there are several issues per unit Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34658|0 |1 is obsolete| | --- Comment #11 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 36926 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36926&action=edit Bug 12671: Guess next serial date when there are several issues per unit. Added support for real month and year lenghts. Rebased on master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off --- Comment #12 from Julian Maurice <julian.maurice@biblibre.com> --- Patches applied well on master, but were in the wrong order. Anyway, patches rebased and reordered. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 --- Comment #13 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- This works well in production for 4 months already. Somebody should push this to master asap! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #36924|0 |1 is obsolete| | Attachment #36925|0 |1 is obsolete| | Attachment #36926|0 |1 is obsolete| | --- Comment #14 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 37340 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37340&action=edit [PASSED QA] Bug 12671: Refactor GetNextDate A much needed refactoring. Thanks for seeing the effort through. Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 --- Comment #15 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 37341 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37341&action=edit [PASSED QA] Bug 12671: Guess next serial date when there are several issues per unit This guess uses the following algorithm 1/ Get the number of days remaining from first issue of this unit of time until the end of the unit of time (using 7 days for week, 28 for month and 365 for year) 2/ Divide it by the number of issues per unit 3/ Take the integer part of the result, this is the number of days to add to previous serial published date This patch also try to guess the date of the first issue of a unit of time. Before that, it was: - for week: monday of week - for month: 1st day of month - for year: 1st day of year Now it uses firstacquidate. Example: firstacquidate = 1970-01-07 (wednesday) unit = week issuesperunit = 2 (2 issues per week) From wednesday to sunday, there are 4 days so we add 2 days to get the next date. The next dates should be: - 1970-01-09 (+ 2 days) - 1970-01-14 (wednesday of next week) - 1970-01-16 (+ 2 days) - ... and so on Test plan: 1/ Go to numbering pattern creation page (Serials -> Manager numbering patterns -> New numbering pattern) 2/ In "Test prediction pattern" fieldset, set subscription length to 50 issues (this avoid to compute the next 1000 dates, which can take time) 3/ Fill first issue publication date 4/ Choose the frequency you want to test 5/ click on "Test pattern" button 6/ Check that the dates are correct 7/ Repeat steps 3-7 until you think you have tested enough cases Interesting frequencies to test: - 1/day - 1/week - 2/week - 6/week (firstacquidate should be monday or tuesday, or the generated dates will be the same for all the week) - 1/month - 2/month - 3/month - 1/year - 2/year - 3/year ---------------- Sign off report: ---------------- -Followed the test plan. Unit tests work. Also trying some more strange frequencies with our librarians: 5/year, 43/year, 10/year. -Received all serials for a subscription and found no errors. -Received some serials with frequency 2/month pre-patch, getting publication date as 1st of every month for each magazine. Having applied the patch, publication dates started working mid-subscription for new magazines. -Works well and fine! Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 37342 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=37342&action=edit [PASSED QA] Bug 12671: Guess next serial date when there are several issues per unit. Added support for real month and year lenghts. When getting the next frequency number, use the real number of days for each month and each year. Unit tests updated. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Passed QA |Pushed to Master --- Comment #17 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. Good job Julian! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12671 Janet McGowan <janet.mcgowan@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |janet.mcgowan@ptfs-europe.c | |om -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org