View | Details | Raw Unified | Return to bug 16116
Collapse All | Expand All

(-)a/C4/Serials.pm (-8 / +5 lines)
Lines 2325-2331 sub _get_next_date_week { Link Here
2325
    my ($subscription, $freqdata, $year, $month, $day) = @_;
2325
    my ($subscription, $freqdata, $year, $month, $day) = @_;
2326
2326
2327
    my ($wkno, $yr) = Week_of_Year($year, $month, $day);
2327
    my ($wkno, $yr) = Week_of_Year($year, $month, $day);
2328
    my $fa_dow = Day_of_Week(split /-/, $subscription->{firstacquidate});
2328
    my $fa_dow = Day_of_Week($year, $month, $day);
2329
2329
2330
    if ($subscription->{countissuesperunit} + 1 > $freqdata->{issuesperunit}){
2330
    if ($subscription->{countissuesperunit} + 1 > $freqdata->{issuesperunit}){
2331
        $subscription->{countissuesperunit} = 1;
2331
        $subscription->{countissuesperunit} = 1;
Lines 2350-2367 sub _get_next_date_month { Link Here
2350
    my ($subscription, $freqdata, $year, $month, $day) = @_;
2350
    my ($subscription, $freqdata, $year, $month, $day) = @_;
2351
2351
2352
    my $fa_day;
2352
    my $fa_day;
2353
    (undef, undef, $fa_day) = split /-/, $subscription->{firstacquidate};
2354
2353
2355
    if ($subscription->{countissuesperunit} + 1 > $freqdata->{issuesperunit}){
2354
    if ($subscription->{countissuesperunit} + 1 > $freqdata->{issuesperunit}){
2356
        $subscription->{countissuesperunit} = 1;
2355
        $subscription->{countissuesperunit} = 1;
2357
        ($year,$month,$day) = Add_Delta_YM($year,$month,$day, 0,
2356
        ($year,$month,$day) = Add_Delta_YM($year,$month,$day, 0,
2358
            $freqdata->{unitsperissue});
2357
            $freqdata->{unitsperissue});
2359
        my $days_in_month = Days_in_Month($year, $month);
2358
        my $days_in_month = Days_in_Month($year, $month);
2360
        $day = $fa_day <= $days_in_month ? $fa_day : $days_in_month;
2359
        $day = $day <= $days_in_month ? $day : $days_in_month;
2361
    } else {
2360
    } else {
2362
        # Try to guess the next day in month
2361
        # Try to guess the next day in month
2363
        my $days_in_month = Days_in_Month($year, $month);
2362
        my $days_in_month = Days_in_Month($year, $month);
2364
        my $delta_days = int(($days_in_month - ($fa_day - 1)) / $freqdata->{issuesperunit});
2363
        my $delta_days = int(($days_in_month - ($day - 1)) / $freqdata->{issuesperunit});
2365
        ($year,$month,$day) = Add_Delta_Days($year, $month, $day, $delta_days);
2364
        ($year,$month,$day) = Add_Delta_Days($year, $month, $day, $delta_days);
2366
        $subscription->{countissuesperunit}++;
2365
        $subscription->{countissuesperunit}++;
2367
    }
2366
    }
Lines 2377-2389 sub _get_next_date_year { Link Here
2377
    if ($subscription->{countissuesperunit} + 1 > $freqdata->{issuesperunit}){
2376
    if ($subscription->{countissuesperunit} + 1 > $freqdata->{issuesperunit}){
2378
        $subscription->{countissuesperunit} = 1;
2377
        $subscription->{countissuesperunit} = 1;
2379
        ($year) = Add_Delta_YM($year,$month,$day, $freqdata->{"unitsperissue"},0);
2378
        ($year) = Add_Delta_YM($year,$month,$day, $freqdata->{"unitsperissue"},0);
2380
        $month = $fa_month;
2381
        my $days_in_month = Days_in_Month($year, $month);
2379
        my $days_in_month = Days_in_Month($year, $month);
2382
        $day = $fa_day <= $days_in_month ? $fa_day : $days_in_month;
2380
        $day = $day <= $days_in_month ? $day : $days_in_month;
2383
    } else {
2381
    } else {
2384
        # Try to guess the next day in year
2382
        # Try to guess the next day in year
2385
        my $days_in_year = Days_in_Year($year,12); #Sum the days of all the months of this year
2383
        my $days_in_year = Days_in_Year($year,12); #Sum the days of all the months of this year
2386
        my $delta_days = int(($days_in_year - ($fa_day - 1)) / $freqdata->{issuesperunit});
2384
        my $delta_days = int(($days_in_year - ($day - 1)) / $freqdata->{issuesperunit});
2387
        ($year,$month,$day) = Add_Delta_Days($year, $month, $day, $delta_days);
2385
        ($year,$month,$day) = Add_Delta_Days($year, $month, $day, $delta_days);
2388
        $subscription->{countissuesperunit}++;
2386
        $subscription->{countissuesperunit}++;
2389
    }
2387
    }
2390
- 

Return to bug 16116