[freeside-commits] freeside/FS/FS/part_pkg voip_cdr.pm, 1.109, 1.110
Erik Levinson
levinse at wavetail.420.am
Wed Jan 12 18:49:25 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv13097/FS/FS/part_pkg
Modified Files:
voip_cdr.pm
Log Message:
International calling plans / region group billing, RT8951
Index: voip_cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/voip_cdr.pm,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -w -d -r1.109 -r1.110
--- voip_cdr.pm 24 Dec 2010 09:49:32 -0000 1.109
+++ voip_cdr.pm 13 Jan 2011 02:49:23 -0000 1.110
@@ -88,10 +88,9 @@
'select_label' => 'ratename',
},
- 'min_included' => { 'name' => 'Minutes included when using "single price per minute" rating method',
+ 'min_included' => { 'name' => 'Minutes included when using the "single price per minute" rating method or when using the "prefix" rating method ("region group" billing)',
},
-
'min_charge' => { 'name' => 'Charge per minute when using "single price per minute" rating method',
},
@@ -252,7 +251,8 @@
recur_method cutoff_day
add_full_period
cdr_svc_method
- rating_method ratenum min_charge sec_granularity
+ rating_method ratenum min_charge min_included
+ sec_granularity
ignore_unrateable
default_prefix
disable_src
@@ -333,6 +333,8 @@
my $disable_tollfree = $self->option('disable_tollfree');
my $ignore_unrateable = $self->option('ignore_unrateable', 'Hush!');
my $use_duration = $self->option('use_duration');
+ my $region_group = ($rating_method eq 'prefix' && $self->option('min_included') > 0);
+ my $region_group_included_min = $region_group ? $self->option('min_included') : 0;
my $output_format = $self->option('output_format', 'Hush!')
|| ( $rating_method eq 'upstream_simple'
@@ -674,8 +676,11 @@
$seconds += $charge_sec;
+ $region_group_included_min -= $minutes if $region_group;
+
$included_min{$regionnum}{$ratetimenum} -= $minutes;
- if ( $included_min{$regionnum}{$ratetimenum} <= 0 ) {
+ if ( $region_group_included_min <= 0
+ && $included_min{$regionnum}{$ratetimenum} <= 0 ) {
my $charge_min = 0 - $included_min{$regionnum}{$ratetimenum}; #XXX should preserve
#(display?) this
$included_min{$regionnum}{$ratetimenum} = 0;
More information about the freeside-commits
mailing list