[freeside-commits] branch master updated. f072dc42c97981167acae2e987a4e4e6a6a4d403

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


The branch, master has been updated
       via  f072dc42c97981167acae2e987a4e4e6a6a4d403 (commit)
      from  dd82a27357402466390044d001824657f6617626 (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 f072dc42c97981167acae2e987a4e4e6a6a4d403
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 be2d15b..24c4cf0 100644
--- 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
+  $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';
@@ -664,7 +666,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 052bb7f..81f2765 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 a205f9f..299d5c1 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