X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Frecur_Common.pm;h=21a78c00a5aef19e7369cbfa08cb5278c698514b;hb=ced6be92d868addbed9ff93b39bbd6a1f634bcb7;hp=2739cbc8fadb563311267f110d79470466f4e926;hpb=3cb93a3aa0af9f004b7ee122bdf5c1daf5f1289c;p=freeside.git diff --git a/FS/FS/part_pkg/recur_Common.pm b/FS/FS/part_pkg/recur_Common.pm index 2739cbc8f..21a78c00a 100644 --- a/FS/FS/part_pkg/recur_Common.pm +++ b/FS/FS/part_pkg/recur_Common.pm @@ -4,9 +4,9 @@ use strict; 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 @@ -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,12 +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 ); - }#$recur_method eq 'prorate' - + }#$recur_method eq 'prorate' or ... }#increment_next_bill - $charges; + return $charges; }