X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Frecur_Common.pm;h=ec17c1662c05a034f01eb67d18142e32f550bf2a;hb=4ad8b72c0dde10d4907298277181ddfaa99dafb6;hp=8ed9eb6af50ec8017ef78354a8a815425752d5fd;hpb=9b6b116d4a492cb0edc31e53abf1fdb43be42d0e;p=freeside.git diff --git a/FS/FS/part_pkg/recur_Common.pm b/FS/FS/part_pkg/recur_Common.pm index 8ed9eb6af..ec17c1662 100644 --- a/FS/FS/part_pkg/recur_Common.pm +++ b/FS/FS/part_pkg/recur_Common.pm @@ -26,11 +26,12 @@ sub calc_recur_Common { 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'); @@ -47,14 +48,12 @@ sub calc_recur_Common { $$sdate = timelocal(0, 0, 0, $cutoff_day, $mon, $year); }#$recur_method eq 'subscription' + $charges -= $self->calc_discount( $cust_pkg, $sdate, $details, $param ); - $charges -= $self->calc_discount( $cust_pkg, $sdate, $details, $param ); - - }#$recur_method eq 'prorate' - + }#$recur_method eq 'prorate' or ... }#increment_next_bill - $charges; + return $charges; }