X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fvoip_sqlradacct.pm;h=299d5c1d02560404ddeed2f83ab1667bbb7c281a;hp=b4f0cf9b576c5a90c3a4763b777b2fa1f4ce37bc;hb=674cb2d9d7105f4cc2871539b2e9f7088cdaa750;hpb=92adead1404db357a11b58f38c2b4403381a2809 diff --git a/FS/FS/part_pkg/voip_sqlradacct.pm b/FS/FS/part_pkg/voip_sqlradacct.pm index b4f0cf9b5..299d5c1d0 100644 --- a/FS/FS/part_pkg/voip_sqlradacct.pm +++ b/FS/FS/part_pkg/voip_sqlradacct.pm @@ -16,28 +16,23 @@ $DEBUG = 1; 'disabled' => 1, #they're sucked into our CDR table now instead 'name' => 'VoIP rating by plan of CDR records in an SQL RADIUS radacct table', 'shortname' => 'VoIP/telco CDR rating (external RADIUS)', + 'inherit_fields' => [ 'global_Mixin' ], 'fields' => { - 'setup_fee' => { 'name' => 'Setup fee for this package', - 'default' => 0, - }, - 'recur_fee' => { 'name' => 'Base recurring fee for this package', - 'default' => 0, - }, - 'unused_credit' => { 'name' => 'Credit the customer for the unused portion'. - ' of service at cancellation', - 'type' => 'checkbox', - }, 'ratenum' => { 'name' => 'Rate plan', - 'type' => 'select', - 'select_table' => 'rate', - 'select_key' => 'ratenum', - 'select_label' => 'ratename', + 'type' => 'select-rate', }, }, - 'fieldorder' => [qw( setup_fee recur_fee unused_credit ratenum ignore_unrateable )], + 'fieldorder' => [qw( ratenum ignore_unrateable )], 'weight' => 40, ); +sub price_info { + my $self = shift; + my $str = $self->SUPER::price_info(@_); + $str .= " plus usage" if $str; + $str; +} + sub calc_setup { my($self, $cust_pkg ) = @_; $self->option('setup_fee'); @@ -136,7 +131,8 @@ sub calc_recur { # find the price and add detail to the invoice ### - $included_min{$regionnum} = $rate_detail->min_included + $included_min{$regionnum} = + ($rate_detail->min_included * $cust_pkg->quantity || 1) unless exists $included_min{$regionnum}; my $granularity = $rate_detail->sec_granularity; @@ -181,9 +177,9 @@ sub calc_recur { } -sub is_free { - 0; -} +sub can_discount { 0; } + +sub is_free { 0; } sub base_recur { my($self, $cust_pkg) = @_;