Lines 2330-2336
sub _get_next_date_week {
Link Here
|
2330 |
my ($subscription, $freqdata, $year, $month, $day) = @_; |
2330 |
my ($subscription, $freqdata, $year, $month, $day) = @_; |
2331 |
|
2331 |
|
2332 |
my ($wkno, $yr) = Week_of_Year($year, $month, $day); |
2332 |
my ($wkno, $yr) = Week_of_Year($year, $month, $day); |
2333 |
my $fa_dow = Day_of_Week(split /-/, $subscription->{firstacquidate}); |
2333 |
my $fa_dow = Day_of_Week($year, $month, $day); |
2334 |
|
2334 |
|
2335 |
if ($subscription->{countissuesperunit} + 1 > $freqdata->{issuesperunit}){ |
2335 |
if ($subscription->{countissuesperunit} + 1 > $freqdata->{issuesperunit}){ |
2336 |
$subscription->{countissuesperunit} = 1; |
2336 |
$subscription->{countissuesperunit} = 1; |
Lines 2355-2372
sub _get_next_date_month {
Link Here
|
2355 |
my ($subscription, $freqdata, $year, $month, $day) = @_; |
2355 |
my ($subscription, $freqdata, $year, $month, $day) = @_; |
2356 |
|
2356 |
|
2357 |
my $fa_day; |
2357 |
my $fa_day; |
2358 |
(undef, undef, $fa_day) = split /-/, $subscription->{firstacquidate}; |
|
|
2359 |
|
2358 |
|
2360 |
if ($subscription->{countissuesperunit} + 1 > $freqdata->{issuesperunit}){ |
2359 |
if ($subscription->{countissuesperunit} + 1 > $freqdata->{issuesperunit}){ |
2361 |
$subscription->{countissuesperunit} = 1; |
2360 |
$subscription->{countissuesperunit} = 1; |
2362 |
($year,$month,$day) = Add_Delta_YM($year,$month,$day, 0, |
2361 |
($year,$month,$day) = Add_Delta_YM($year,$month,$day, 0, |
2363 |
$freqdata->{unitsperissue}); |
2362 |
$freqdata->{unitsperissue}); |
2364 |
my $days_in_month = Days_in_Month($year, $month); |
2363 |
my $days_in_month = Days_in_Month($year, $month); |
2365 |
$day = $fa_day <= $days_in_month ? $fa_day : $days_in_month; |
2364 |
$day = $day <= $days_in_month ? $day : $days_in_month; |
2366 |
} else { |
2365 |
} else { |
2367 |
# Try to guess the next day in month |
2366 |
# Try to guess the next day in month |
2368 |
my $days_in_month = Days_in_Month($year, $month); |
2367 |
my $days_in_month = Days_in_Month($year, $month); |
2369 |
my $delta_days = int(($days_in_month - ($fa_day - 1)) / $freqdata->{issuesperunit}); |
2368 |
my $delta_days = int(($days_in_month - ($day - 1)) / $freqdata->{issuesperunit}); |
2370 |
($year,$month,$day) = Add_Delta_Days($year, $month, $day, $delta_days); |
2369 |
($year,$month,$day) = Add_Delta_Days($year, $month, $day, $delta_days); |
2371 |
$subscription->{countissuesperunit}++; |
2370 |
$subscription->{countissuesperunit}++; |
2372 |
} |
2371 |
} |
Lines 2382-2394
sub _get_next_date_year {
Link Here
|
2382 |
if ($subscription->{countissuesperunit} + 1 > $freqdata->{issuesperunit}){ |
2381 |
if ($subscription->{countissuesperunit} + 1 > $freqdata->{issuesperunit}){ |
2383 |
$subscription->{countissuesperunit} = 1; |
2382 |
$subscription->{countissuesperunit} = 1; |
2384 |
($year) = Add_Delta_YM($year,$month,$day, $freqdata->{"unitsperissue"},0); |
2383 |
($year) = Add_Delta_YM($year,$month,$day, $freqdata->{"unitsperissue"},0); |
2385 |
$month = $fa_month; |
|
|
2386 |
my $days_in_month = Days_in_Month($year, $month); |
2384 |
my $days_in_month = Days_in_Month($year, $month); |
2387 |
$day = $fa_day <= $days_in_month ? $fa_day : $days_in_month; |
2385 |
$day = $day <= $days_in_month ? $day : $days_in_month; |
2388 |
} else { |
2386 |
} else { |
2389 |
# Try to guess the next day in year |
2387 |
# Try to guess the next day in year |
2390 |
my $days_in_year = Days_in_Year($year,12); #Sum the days of all the months of this year |
2388 |
my $days_in_year = Days_in_Year($year,12); #Sum the days of all the months of this year |
2391 |
my $delta_days = int(($days_in_year - ($fa_day - 1)) / $freqdata->{issuesperunit}); |
2389 |
my $delta_days = int(($days_in_year - ($day - 1)) / $freqdata->{issuesperunit}); |
2392 |
($year,$month,$day) = Add_Delta_Days($year, $month, $day, $delta_days); |
2390 |
($year,$month,$day) = Add_Delta_Days($year, $month, $day, $delta_days); |
2393 |
$subscription->{countissuesperunit}++; |
2391 |
$subscription->{countissuesperunit}++; |
2394 |
} |
2392 |
} |
2395 |
- |
|
|