X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fcdr_termination.pm;h=54bce2c1dbdd5a311696401d526fed28b52c8a7b;hb=38cd4a53e99e0583de526262b31a8b93debca4c7;hp=840da8224f2d95d8789cecdf43e0a06954aa3c8a;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/FS/FS/part_pkg/cdr_termination.pm b/FS/FS/part_pkg/cdr_termination.pm index 840da8224..54bce2c1d 100644 --- a/FS/FS/part_pkg/cdr_termination.pm +++ b/FS/FS/part_pkg/cdr_termination.pm @@ -16,7 +16,7 @@ tie my %temporalities, 'Tie::IxHash', %info = ( 'name' => 'VoIP rating of CDR records for termination partners.', 'shortname' => 'VoIP/telco CDR termination', - 'inherit_fields' => [ 'global_Mixin' ], + 'inherit_fields' => [ 'prorate_Mixin', 'global_Mixin' ], 'fields' => { #'cdr_column' => { 'name' => 'Column from CDR records', # 'type' => 'select', @@ -46,11 +46,6 @@ tie my %temporalities, 'Tie::IxHash', 'subscription', 'default' => '1', }, - 'add_full_period'=> { 'name' => 'When prorating first month, also bill '. - 'for one full period after that', - 'type' => 'checkbox', - }, - 'recur_method' => { 'name' => 'Recurring fee method', #'type' => 'radio', #'options' => \%recur_method, @@ -79,9 +74,9 @@ tie my %temporalities, 'Tie::IxHash', }, #cdr_column - 'fieldorder' => [qw( - recur_temporality recur_method cutoff_day - add_full_period + 'fieldorder' => [qw( recur_temporality recur_method cutoff_day ), + FS::part_pkg::prorate_Mixin::fieldorder, + qw( output_format usage_section summarize_usage usage_mandate ) ], @@ -90,11 +85,6 @@ tie my %temporalities, 'Tie::IxHash', ); -sub calc_setup { - my($self, $cust_pkg ) = @_; - $self->option('setup_fee'); -} - sub calc_recur { my $self = shift; my($cust_pkg, $sdate, $details, $param ) = @_; @@ -103,7 +93,7 @@ sub calc_recur { my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup return 0 - if $self->option('recur_temporality', 1) eq 'preceding' + if $self->recur_temporality eq 'preceding' && ( $last_bill eq '' || $last_bill == 0 ); # termination calculations @@ -192,7 +182,7 @@ sub calc_recur { # eotermiation calculation - $charges += $self->calc_recur_Common(@_); + $charges += ($cust_pkg->quantity || 1) * $self->calc_recur_Common(@_); $charges; }