[freeside-commits] branch FREESIDE_3_BRANCH updated. b43dc5871854ed8662f75f5ee00229bd761bedd4

Mark Wells mark at 420.am
Thu May 26 15:44:34 PDT 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  b43dc5871854ed8662f75f5ee00229bd761bedd4 (commit)
      from  1313896e5b0cd551fc4449fe6dd8c863d5d1de4a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b43dc5871854ed8662f75f5ee00229bd761bedd4
Author: Mark Wells <mark at freeside.biz>
Date:   Thu May 26 15:43:55 2016 -0700

    in rated CDR packages, multiply included minutes by package quantity, #71003

diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm
index b3cceb4..df16c7f 100644
--- 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
-      $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;
diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm
index fa2c02f..2d53ace 100644
--- a/FS/FS/part_pkg/voip_cdr.pm
+++ b/FS/FS/part_pkg/voip_cdr.pm
@@ -404,8 +404,10 @@ sub calc_usage {
   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;
+  $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';
@@ -667,7 +669,8 @@ sub reset_usage {
                 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})
diff --git a/FS/FS/part_pkg/voip_inbound.pm b/FS/FS/part_pkg/voip_inbound.pm
index 373701e..5bce1e1 100644
--- 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;
+  $included_min *= ($cust_pkg->quantity || 1);
   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 00ed3f6..e8e2044 100644
--- 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
       ###
 
-      $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;
diff --git a/FS/FS/part_pkg/voip_tiered.pm b/FS/FS/part_pkg/voip_tiered.pm
index d8d74c1..0ad0ff6 100644
--- 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;
+  $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)

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cdr.pm                      |    6 ++++--
 FS/FS/part_pkg/voip_cdr.pm        |    5 ++++-
 FS/FS/part_pkg/voip_inbound.pm    |    1 +
 FS/FS/part_pkg/voip_sqlradacct.pm |    3 ++-
 FS/FS/part_pkg/voip_tiered.pm     |    1 +
 5 files changed, 12 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list