summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorjeff <jeff>2008-02-13 23:42:00 +0000
committerjeff <jeff>2008-02-13 23:42:00 +0000
commit117b59b69ddc3dab173ec531762686d8c49ad08f (patch)
treeae9a025f28e015726c21fe2740301135464b0439 /FS
parentdae4a46355c29df7518f95e7f2312eea50bac8f9 (diff)
directory assistance (flat per-call) billing RT#3114
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_pkg/voip_cdr.pm8
-rw-r--r--FS/FS/rate_detail.pm2
2 files changed, 7 insertions, 3 deletions
diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm
index 2341fd020..7cf177972 100644
--- a/FS/FS/part_pkg/voip_cdr.pm
+++ b/FS/FS/part_pkg/voip_cdr.pm
@@ -261,9 +261,13 @@ sub calc_recur {
my $granularity = $rate_detail->sec_granularity;
my $seconds = $cdr->billsec; # |ength($cdr->billsec) ? $cdr->billsec : $cdr->duration;
- $seconds += $granularity - ( $seconds % $granularity );
+ $seconds += $granularity - ( $seconds % $granularity )
+ if $granularity; # 0 is per call
my $minutes = sprintf("%.1f", $seconds / 60);
$minutes =~ s/\.0$// if $granularity == 60;
+
+ # per call rather than per minute
+ $minutes = 1 unless $granularity;
$included_min{$regionnum} -= $minutes;
@@ -280,7 +284,7 @@ sub calc_recur {
@call_details = (
#time2str("%Y %b %d - %r", $cdr->calldate_unix ),
time2str("%c", $cdr->calldate_unix), #XXX this should probably be a config option dropdown so they can select US vs- rest of world dates or whatnot
- $minutes.'m',
+ $granularity ? $minutes.'m' : $minutes.' call',
'$'.$charge,
$pretty_destnum,
$rate_region->regionname,
diff --git a/FS/FS/rate_detail.pm b/FS/FS/rate_detail.pm
index 7f8c89eba..ad41b40ec 100644
--- a/FS/FS/rate_detail.pm
+++ b/FS/FS/rate_detail.pm
@@ -46,7 +46,7 @@ inherits from FS::Record. The following fields are currently supported:
=item min_charge - charge per minute
-=item sec_granularity - granularity in seconds, i.e. 6 or 60
+=item sec_granularity - granularity in seconds, i.e. 6 or 60; 0 for per-call
=back