projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a4ef172
)
in rated CDR packages, multiply included minutes by package quantity, #71003
author
Mark Wells
<mark@freeside.biz>
Thu, 26 May 2016 22:43:55 +0000
(15:43 -0700)
committer
Mark Wells
<mark@freeside.biz>
Thu, 26 May 2016 22:44:18 +0000
(15:44 -0700)
FS/FS/cdr.pm
patch
|
blob
|
history
FS/FS/part_pkg/voip_cdr.pm
patch
|
blob
|
history
FS/FS/part_pkg/voip_inbound.pm
patch
|
blob
|
history
FS/FS/part_pkg/voip_sqlradacct.pm
patch
|
blob
|
history
FS/FS/part_pkg/voip_tiered.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cdr.pm
b/FS/FS/cdr.pm
index
b3cceb4
..
df16c7f
100644
(file)
--- a/
FS/FS/cdr.pm
+++ b/
FS/FS/cdr.pm
@@
-927,8
+927,10
@@
sub rate_prefix {
# by default, set the included minutes for this region/time to
# what's in the rate_detail
# by default, set the included minutes for this region/time to
# what's in the rate_detail
- $included_min->{$regionnum}{$ratetimenum} = $rate_detail->min_included
- unless exists $included_min->{$regionnum}{$ratetimenum};
+ if (!exists( $included_min->{$regionnum}{$ratetimenum} )) {
+ $included_min->{$regionnum}{$ratetimenum} =
+ ($rate_detail->min_included * $cust_pkg->quantity || 1);
+ }
if ( $included_min->{$regionnum}{$ratetimenum} >= $minutes ) {
$charge_sec = 0;
if ( $included_min->{$regionnum}{$ratetimenum} >= $minutes ) {
$charge_sec = 0;
diff --git
a/FS/FS/part_pkg/voip_cdr.pm
b/FS/FS/part_pkg/voip_cdr.pm
index
be2d15b
..
24c4cf0
100644
(file)
--- a/
FS/FS/part_pkg/voip_cdr.pm
+++ b/
FS/FS/part_pkg/voip_cdr.pm
@@
-401,8
+401,10
@@
sub calc_usage {
my $included_min = $self->option('min_included', 1) || 0;
#single price rating
#or region group
my $included_min = $self->option('min_included', 1) || 0;
#single price rating
#or region group
+ $included_min *= ($cust_pkg->quantity || 1);
my $included_calls = $self->option('calls_included', 1) || 0;
my $included_calls = $self->option('calls_included', 1) || 0;
+ $included_calls *= ($cust_pkg->quantity || 1);
my $cdr_svc_method = $self->option('cdr_svc_method',1)||'svc_phone.phonenum';
my $rating_method = $self->option('rating_method') || 'prefix';
my $cdr_svc_method = $self->option('cdr_svc_method',1)||'svc_phone.phonenum';
my $rating_method = $self->option('rating_method') || 'prefix';
@@
-664,7
+666,8
@@
sub reset_usage {
FS::cust_pkg_usage->new({
'pkgnum' => $cust_pkg->pkgnum,
'pkgusagepart' => $part,
FS::cust_pkg_usage->new({
'pkgnum' => $cust_pkg->pkgnum,
'pkgusagepart' => $part,
- 'minutes' => $part_pkg_usage->minutes,
+ 'minutes' => $part_pkg_usage->minutes *
+ ($cust_pkg->quantity || 1),
});
foreach my $cdr_usage (
qsearch('cdr_cust_pkg_usage', {'cdrusagenum' => $usage->cdrusagenum})
});
foreach my $cdr_usage (
qsearch('cdr_cust_pkg_usage', {'cdrusagenum' => $usage->cdrusagenum})
diff --git
a/FS/FS/part_pkg/voip_inbound.pm
b/FS/FS/part_pkg/voip_inbound.pm
index
052bb7f
..
81f2765
100644
(file)
--- a/
FS/FS/part_pkg/voip_inbound.pm
+++ b/
FS/FS/part_pkg/voip_inbound.pm
@@
-214,6
+214,7
@@
sub calc_usage {
# my $downstream_cdr = '';
my $included_min = $self->option('min_included', 1) || 0;
# my $downstream_cdr = '';
my $included_min = $self->option('min_included', 1) || 0;
+ $included_min *= ($cust_pkg->quantity || 1);
my $use_duration = $self->option('use_duration');
my $output_format = $self->option('output_format', 1) || 'default';
my $use_duration = $self->option('use_duration');
my $output_format = $self->option('output_format', 1) || 'default';
diff --git
a/FS/FS/part_pkg/voip_sqlradacct.pm
b/FS/FS/part_pkg/voip_sqlradacct.pm
index
a205f9f
..
299d5c1
100644
(file)
--- a/
FS/FS/part_pkg/voip_sqlradacct.pm
+++ b/
FS/FS/part_pkg/voip_sqlradacct.pm
@@
-131,7
+131,8
@@
sub calc_recur {
# find the price and add detail to the invoice
###
# 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;
unless exists $included_min{$regionnum};
my $granularity = $rate_detail->sec_granularity;
diff --git
a/FS/FS/part_pkg/voip_tiered.pm
b/FS/FS/part_pkg/voip_tiered.pm
index
d8d74c1
..
0ad0ff6
100644
(file)
--- a/
FS/FS/part_pkg/voip_tiered.pm
+++ b/
FS/FS/part_pkg/voip_tiered.pm
@@
-81,6
+81,7
@@
sub calc_usage {
&& ( $last_bill eq '' || $last_bill == 0 );
my $included_min = $self->option('min_included', 1) || 0;
&& ( $last_bill eq '' || $last_bill == 0 );
my $included_min = $self->option('min_included', 1) || 0;
+ $included_min *= ($cust_pkg->quantity || 1);
my $cdr_svc_method = $self->option('cdr_svc_method',1)||'svc_phone.phonenum';
my $cdr_inout = ($cdr_svc_method eq 'svc_phone.phonenum')
&& $self->option('cdr_inout',1)
my $cdr_svc_method = $self->option('cdr_svc_method',1)||'svc_phone.phonenum';
my $cdr_inout = ($cdr_svc_method eq 'svc_phone.phonenum')
&& $self->option('cdr_inout',1)