From f9176a88bb61bbc541941eace40fa09bd7f02e13 Mon Sep 17 00:00:00 2001 From: Arthur Suzuki Date: Wed, 18 Jun 2025 07:53:55 +0000 Subject: [PATCH] Bug 40159: Fix prediction pattern when editing an ongoing subscription Test plan : - Without the patch, create a subscription for a record with weekly or monthly subscription length and a first acquisition date long ago. - Receive at least one issue for this subscription. - Edit the subscription and set the next acquisition date to today. - Check that testing the prediction pattern doesnt show the number of issues set in the subscription length (less issues). - Apply patch - Test the prediction pattern again, it will show the proper number of issues. --- serials/showpredictionpattern.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/serials/showpredictionpattern.pl b/serials/showpredictionpattern.pl index 19d414ccba0..ccfcba3f1af 100755 --- a/serials/showpredictionpattern.pl +++ b/serials/showpredictionpattern.pl @@ -155,14 +155,14 @@ while ( $i < 1000 ) { last; } elsif ( $subtype eq "weeks" && $date - && Delta_Days( split( /-/, $date ), Add_Delta_Days( split( /-/, $firstacquidate ), 7 * $sublength - 1 ) ) < + && Delta_Days( split( /-/, $date ), Add_Delta_Days( split( /-/, $nextacquidate ), 7 * $sublength - 1 ) ) < 0 ) { last; } elsif ( $subtype eq "months" && $date - && ( Delta_Days( split( /-/, $date ), Add_Delta_YM( split( /-/, $firstacquidate ), 0, $sublength ) ) - 1 ) - < 0 ) + && ( Delta_Days( split( /-/, $date ), Add_Delta_YM( split( /-/, $nextacquidate ), 0, $sublength ) ) - 1 ) < + 0 ) { last; } -- 2.39.5