Quantcast

[Bug 18356] New: Prediction pattern wrong, skips years, for some year based frequencies

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 18356] New: Prediction pattern wrong, skips years, for some year based frequencies

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18356

            Bug ID: 18356
           Summary: Prediction pattern wrong, skips years, for some year
                    based frequencies
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Serials
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]
                CC: [hidden email]

To reproduce:
Set a frequency with:
Unit: Year
Issues per unit: 9
Units per issue: 1

OR

Unit: Year
Issues per unit: 12
Units per issue: 1


Notice the prediction pattern works for about 1 cycle, then crossed to next
year, then jumps a year:

No. 82  03/01/2017      
No. 83  03/31/2017      
No. 84  04/30/2017      
No. 85  05/30/2017      
No. 86  06/29/2017      
No. 87  07/29/2017      
No. 88  08/28/2017      
No. 89  09/27/2017      
No. 90  10/27/2017      
No. 91  11/26/2017      
No. 92  12/26/2017      
No. 93  01/25/2018  
No. 94  03/01/2019 WRONG!!
No. 95  03/31/2019      
No. 96  04/30/2019      
No. 97  05/30/2019      
No. 98  06/29/2019      
No. 99  07/29/2019      
No. 100         08/28/2019      
No. 101         09/27/2019      
No. 102         10/27/2019      
No. 103         11/26/2019      
No. 104         12/26/2019      
No. 105         01/25/2020      
No. 106         03/01/2021 WRONG!!

Seems to be a problem in some cases when we call:

($year) = Add_Delta_YM($year,$month,$day, $freqdata->{"unitsperissue"},0);

As this call will always add a year, it ends up in:
/usr/share/perl5/Date/Calc/PP.pm
sub DateCalc_add_year_month

Where we add $year + $freqdata->{"unitsperissue"} and return 1 if it is greater
than 1

Suspecting the pass of $freqdata->{"unitsperissue"} is incorrect

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 18356] Prediction pattern wrong, skips years, for some year based frequencies

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18356

Nick Clemens <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 18356] Prediction pattern wrong, skips years, for some year based frequencies

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18356

Marc VĂ©ron <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 18356] Prediction pattern wrong, skips years, for some year based frequencies

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18356

Jason Palmer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 18356] Prediction pattern wrong, skips years, for some year based frequencies

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18356

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
           Assignee|[hidden email]-commun |[hidden email]
                   |ity.org                     |
             Status|NEW                         |ASSIGNED

--- Comment #1 from Marcel de Rooy <[hidden email]> ---
Found similar things. Taking a look..

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 18356] Prediction pattern wrong, skips years, for some year based frequencies

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18356

--- Comment #2 from Marcel de Rooy <[hidden email]> ---
Created attachment 63470
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63470&action=edit
Bug 18356: Extend GetNextDate.t, add GetFictiveIssueNumber.t (unit=year)

This patch deals with tests for yearly frequencies.

Adjust/extend GetNextDate.t:
[1] Adjust mixup of units/issues in a description.
[2] Add testing +2 years on 29-2 of leap year for freq 1 issue/2 years.
[3] Add tests for freq 9 issues/year. We also include testing the operation
    of rounding dates to first acquisition day and month when close enough.

Add GetFictiveIssueNumber.t:
[1] Two subtests are provided for irregular frequencies (very trivial) and
    for year frequencies (with three specific test cases).

Test plan:
[1] Run t/db_dependent/Serials/GetNextDate.t
[2] Run t/db_dependent/Serials/GetFictiveIssueNumber.t

Note: Without the second patch both tests should fail. This shows the need
of the adjustments in the second patch.

Signed-off-by: Marcel de Rooy <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 18356] Prediction pattern wrong, skips years, for some year based frequencies

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18356

--- Comment #3 from Marcel de Rooy <[hidden email]> ---
Created attachment 63471
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=63471&action=edit
Bug 18356: Fix date calculations for yearly frequencies in Serials

The problem as described on BZ 18356 is a combination of an error in
GetFictiveIssueNumber and GetNextDate for unit==year.

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.

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 year cycle, we 'round' up to
firstacqui day and month as long as we are close enough. Otherwise we just
add the number of calculated days, since we can safely assume that the
publish dates have been adjusted manually.

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 <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 18356] Prediction pattern wrong, skips years, for some year based frequencies

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18356

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |Needs Signoff
   Patch complexity|---                         |Small patch

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 18356] Prediction pattern wrong, skips years, for some year based frequencies

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18356

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |18607


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18607
[Bug 18607] Fix date calculations for monthly frequencies in Serials
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Bug 18356] Prediction pattern wrong, skips years, for some year based frequencies

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18356

Marcel de Rooy <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Signoff               |BLOCKED

--- Comment #4 from Marcel de Rooy <[hidden email]> ---
Still thinking about an adjustment. Please wait.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Loading...