projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix recur_Common packages with setup discounts
[freeside.git]
/
FS
/
FS
/
part_pkg
/
voip_cdr.pm
diff --git
a/FS/FS/part_pkg/voip_cdr.pm
b/FS/FS/part_pkg/voip_cdr.pm
index
5f191f2
..
ada91c6
100644
(file)
--- a/
FS/FS/part_pkg/voip_cdr.pm
+++ b/
FS/FS/part_pkg/voip_cdr.pm
@@
-133,14
+133,14
@@
tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
'type' => 'checkbox',
},
'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',
},
'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_cdrtypenum' => { 'name' => 'Do not charge for CDRs where the CDR Type is set to: ',
@@
-149,7
+149,7
@@
tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
'ignore_disposition' => { 'name' => 'Do not charge for CDRs where the Disposition is set to any of these (comma-separated) values: ',
},
'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: ',
},
'skip_dst_prefix' => { 'name' => 'Do not charge for CDRs where the destination number starts with any of these values: ',
@@
-768,33
+768,33
@@
sub calc_usage {
if ( scalar(@call_details) == 1 ) {
$call_details =
if ( scalar(@call_details) == 1 ) {
$call_details =
-
[
'C',
- $call_details[0],
- $charge,
- $classnum,
- $phonenum,
- $cdr->accountcode,
- $cdr->startdate,
- $seconds,
- $regionname,
-
]
;
+
{ format =>
'C',
+
detail =>
$call_details[0],
+
amount =>
$charge,
+
classnum =>
$classnum,
+
phonenum =>
$phonenum,
+
accountcode =>
$cdr->accountcode,
+
startdate =>
$cdr->startdate,
+
duration =>
$seconds,
+
regionname =>
$regionname,
+
}
;
} else { #only used for $rating_method eq 'upstream' now
$csv->combine(@call_details);
$call_details =
} else { #only used for $rating_method eq 'upstream' now
$csv->combine(@call_details);
$call_details =
-
[
'C',
- $csv->string,
- $charge,
- $classnum,
- $phonenum,
- $cdr->accountcode,
- $cdr->startdate,
- $seconds,
- $regionname,
-
]
;
+
{ format =>
'C',
+
detail =>
$csv->string,
+
amount =>
$charge,
+
classnum =>
$classnum,
+
phonenum =>
$phonenum,
+
accountcode =>
$cdr->accountcode,
+
startdate =>
$cdr->startdate,
+
duration =>
$seconds,
+
regionname =>
$regionname,
+
}
;
}
}
- warn " adding details on charge to invoice: [ ".
- join(', ', @{$call_details} ). " ]"
- if ( $DEBUG && ref($call_details) );
+
#
warn " adding details on charge to invoice: [ ".
+
#
join(', ', @{$call_details} ). " ]"
+
#
if ( $DEBUG && ref($call_details) );
push @invoice_details_sort, [ $call_details, $cdr->calldate_unix ];
}
push @invoice_details_sort, [ $call_details, $cdr->calldate_unix ];
}
@@
-821,14
+821,9
@@
sub calc_usage {
} # $cust_svc
} # $cust_svc
- unshift @$details, [ 'C',
- FS::cdr::invoice_header($output_format),
- '',
- '',
- '',
- '',
- '',
- ]
+ unshift @$details, { format => 'C',
+ detail => FS::cdr::invoice_header($output_format),
+ }
if @$details && $rating_method ne 'upstream';
# if ( $spool_cdr && length($downstream_cdr) ) {
if @$details && $rating_method ne 'upstream';
# if ( $spool_cdr && length($downstream_cdr) ) {
@@
-899,6
+894,11
@@
sub check_chargable {
if $opt{'ignore_disposition'} =~ /\S/
&& grep { $cdr->disposition eq $_ } split(/\s*,\s*/, $opt{'ignore_disposition'});
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 ''
return "carrierid != $opt{'use_carrierid'}"
if length($opt{'use_carrierid'})
&& $cdr->carrierid ne $opt{'use_carrierid'} #ne otherwise 0 matches ''
@@
-912,11
+912,6
@@
sub check_chargable {
if length($opt{'ignore_cdrtypenum'})
&& $cdr->cdrtypenum eq $opt{'ignore_cdrtypenum'}; #eq 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'});
return "dcontext IN ( $opt{'skip_dcontext'} )"
if $opt{'skip_dcontext'} =~ /\S/
&& grep { $cdr->dcontext eq $_ } split(/\s*,\s*/, $opt{'skip_dcontext'});