%info = (
'name' => 'VoIP rating by plan of CDR records in an internal (or external) SQL table',
'shortname' => 'VoIP/telco CDR rating (standard)',
- 'inherit_fields' => [ 'global_Mixin' ],
+ 'inherit_fields' => [ 'prorate_Mixin', 'global_Mixin' ],
'fields' => {
'suspend_bill' => { 'name' => 'Continue recurring billing while suspended',
'type' => 'checkbox',
'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,
'type' => 'checkbox',
},
- 'use_amaflags' => { 'name' => 'Do not charge for CDRs where the amaflags field is not set to "2" ("BILL"/"BILLING").',
+ 'use_amaflags' => { 'name' => 'Only charge for CDRs where the amaflags field is set to "2" ("BILL"/"BILLING").',
'type' => 'checkbox',
},
- 'use_carrierid' => { 'name' => 'Do not charge for CDRs where the Carrier ID is not set to: ',
+ 'use_carrierid' => { 'name' => 'Only charge for CDRs where the Carrier ID is set to: ',
},
- 'use_cdrtypenum' => { 'name' => 'Do not charge for CDRs where the CDR Type is not set to: ',
+ 'use_cdrtypenum' => { 'name' => 'Only charge for CDRs where the CDR Type is set to: ',
},
'ignore_cdrtypenum' => { 'name' => 'Do not charge for CDRs where the CDR Type is set to: ',
'ignore_disposition' => { 'name' => 'Do not charge for CDRs where the Disposition is set to any of these (comma-separated) values: ',
},
- 'disposition_in' => { 'name' => 'Do not charge for CDRs where the Disposition is not set to any of these (comma-separated) values: ',
+ 'disposition_in' => { 'name' => 'Only charge for CDRs where the Disposition is set to any of these (comma-separated) values: ',
},
'skip_dst_prefix' => { 'name' => 'Do not charge for CDRs where the destination number starts with any of these values: ',
},
'fieldorder' => [qw(
recur_temporality
- recur_method cutoff_day
- add_full_period
+ recur_method cutoff_day ),
+ FS::part_pkg::prorate_Mixin::fieldorder,
+ qw(
cdr_svc_method
rating_method ratenum intrastate_ratenum
min_charge min_included
$str;
}
-sub calc_setup {
- my($self, $cust_pkg ) = @_;
- $self->option('setup_fee');
-}
-
sub calc_recur {
my $self = shift;
my($cust_pkg, $sdate, $details, $param ) = @_;
$classnum,
$phonenum,
$cdr->accountcode,
+ $cdr->startdate,
$seconds,
$regionname,
];
$classnum,
$phonenum,
$cdr->accountcode,
+ $cdr->startdate,
$seconds,
$regionname,
];
if $opt{'ignore_disposition'} =~ /\S/
&& grep { $cdr->disposition eq $_ } split(/\s*,\s*/, $opt{'ignore_disposition'});
+ foreach(split(/\s*,\s*/, $opt{'skip_dst_prefix'})) {
+ return "dst starts with '$_'"
+ if length($_) && substr($cdr->dst,0,length($_)) eq $_;
+ }
+
return "carrierid != $opt{'use_carrierid'}"
if length($opt{'use_carrierid'})
&& $cdr->carrierid ne $opt{'use_carrierid'} #ne otherwise 0 matches ''
if length($opt{'ignore_cdrtypenum'})
&& $cdr->cdrtypenum eq $opt{'ignore_cdrtypenum'}; #eq otherwise 0 matches ''
- foreach(split(',',$opt{'skip_dst_prefix'})) {
- return "dst starts with '$_'"
- if length($_) && substr($cdr->dst,0,length($_)) eq $_;
- }
-
return "dcontext IN ( $opt{'skip_dcontext'} )"
if $opt{'skip_dcontext'} =~ /\S/
&& grep { $cdr->dcontext eq $_ } split(/\s*,\s*/, $opt{'skip_dcontext'});