Browse Source
The problem as described on BZ 18356 is a combination of an error in GetFictiveIssueNumber and GetNextDate for unit==year. [1] In GetNextDate the Add_Delta_YM calculation should be applied only to frequencies based on years per unit. In the case of multiple units per year we calculate the number of days to add. And if we have reached the end of a cycle, we correct the rounding applied in the cycle. NOTE 1: We obsolete the idea here of rebasing dates on firstacqui. In case of manual adjustments, we probably do not want it. And otherwise we do not need it anymore due to the correction at the end of a cycle. NOTE 2: The calls to Add_Delta_YM are intentionally not corrected for leap years. Say you start at 2016-02-29. If you use 1/yr or 1/2yr, you will switch to the Feb 28th in the following years. In 2020 there will be no switch to Feb 29 again; if someone should need it, please use a manual adjustment. This is probably highly exceptional. [2] In GetFictiveIssueNumber the year should be decreased by one if you have more units per year and you did not yet reach firstacqui day and month. This affects calculations in GetNextDate with irregularities. NOTE 1: I added a wrapper around Date::Calc::N_Delta_YMD in order to improve its results; this will especially be needed when we use it later for month units. NOTE 2: In case of manual adjustments this calculation does not really make sense. Another report should deal with improving irregularities. Test plan: [1] Verify that both GetNextDate.t as well as GetFictiveIssueNumber.t pass. [2] Look at the prediction pattern for a few frequencies. For example: 1 iss/y, 1 iss/2y, 5 iss/y. 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> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>17.11.x
1 changed files with 41 additions and 16 deletions
Loading…
Reference in new issue