fix for flat-rate prefix rating, #24716, from #5738
authorMark Wells <mark@freeside.biz>
Tue, 27 Aug 2013 21:16:36 +0000 (14:16 -0700)
committerMark Wells <mark@freeside.biz>
Tue, 27 Aug 2013 21:16:36 +0000 (14:16 -0700)
FS/FS/cdr.pm

index 3ebe6c4..de9cf12 100644 (file)
@@ -932,8 +932,12 @@ sub rate_prefix {
       }
 
                            #should preserve (display?) this
-      my $charge_min = ( $charge_sec - $conn_seconds ) / 60;
-      $charge += ($rate_detail->min_charge * $charge_min) if $charge_min > 0; #still not rounded
+      if ( $granularity == 0 ) { # per call rate
+        $charge += $rate_detail->min_charge;
+      } else {
+        my $charge_min = ( $charge_sec - $conn_seconds ) / 60;
+        $charge += ($rate_detail->min_charge * $charge_min) if $charge_min > 0; #still not rounded
+      }
 
     }