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

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 30 22:41:09 CEST 2017


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: koha-bugs at lists.koha-community.org
          Reporter: nick at bywatersolutions.com
        QA Contact: testopia at bugs.koha-community.org
                CC: colin.campbell at ptfs-europe.com

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.


More information about the Koha-bugs mailing list