package FS::part_pkg::recur_Common;
use strict;
-use vars qw( @ISA %recur_method );
+use vars qw( @ISA %info %recur_method );
use Tie::IxHash;
use Time::Local;
-use FS::part_pkg::prorate;
+use FS::part_pkg::prorate_Mixin;
-@ISA = qw(FS::part_pkg::prorate);
+@ISA = qw(FS::part_pkg::prorate_Mixin);
+
+%info = ( 'disabled' => 1 ); #recur_Common not a usable price plan directly
tie %recur_method, 'Tie::IxHash',
'anniversary' => 'Charge the recurring fee at the frequency specified above',
my $recur_method = $self->option('recur_method', 1) || 'anniversary';
- if ( $recur_method eq 'prorate' ) {
-
- $charges = $self->SUPER::calc_recur(@_);
-
- } else {
+ if ( $recur_method eq 'prorate'
+ or ($recur_method eq 'anniversary' and $self->option('sync_bill_date',1))
+ ) {
+ $charges = $self->calc_prorate(@_);
+ }
+ else {
$charges = $self->option('recur_fee');
$$sdate = timelocal(0, 0, 0, $cutoff_day, $mon, $year);
}#$recur_method eq 'subscription'
+ $charges -= $self->calc_discount( $cust_pkg, $sdate, $details, $param );
- }#$recur_method eq 'prorate'
-
+ }#$recur_method eq 'prorate' or ...
}#increment_next_bill
- $charges;
+ return $charges;
}