X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fvoip_cdr.pm;h=4f05963ef6b704054b0a12a9d860b507feebfca9;hb=48214eb5dfdaf96e35a60959d9c227c699a2a3d3;hp=4529a987e82ddbb2754bee9bd78f6970f6ad5ecb;hpb=458906d72c4c6360dd478fd1169db4dc41d1bfa3;p=freeside.git diff --git a/FS/FS/part_pkg/voip_cdr.pm b/FS/FS/part_pkg/voip_cdr.pm index 4529a987e..4f05963ef 100644 --- a/FS/FS/part_pkg/voip_cdr.pm +++ b/FS/FS/part_pkg/voip_cdr.pm @@ -4,17 +4,16 @@ use strict; use vars qw(@ISA $DEBUG %info); use Date::Format; use Tie::IxHash; -use Time::Local; use FS::Conf; use FS::Record qw(qsearchs qsearch); -use FS::part_pkg::flat; +use FS::part_pkg::recur_Common; use FS::cdr; use FS::rate; use FS::rate_prefix; use FS::rate_detail; use FS::part_pkg::recur_Common; -@ISA = qw(FS::part_pkg::prorate); +@ISA = qw(FS::part_pkg::recur_Common); $DEBUG = 0; @@ -67,7 +66,7 @@ tie my %temporalities, 'Tie::IxHash', #'type' => 'radio', #'options' => \%recur_method, 'type' => 'select', - 'select_options' => \%FS::part_pkg::recur_common::recur_method, + 'select_options' => \%FS::part_pkg::recur_Common::recur_method, }, 'rating_method' => { 'name' => 'Rating method', @@ -83,7 +82,6 @@ tie my %temporalities, 'Tie::IxHash', }, 'min_charge' => { 'name' => 'Charge per minute when using "single price per minute" rating method', - 'type' => 'text', }, 'ignore_unrateable' => { 'name' => 'Ignore calls without a rate in the rate tables. By default, the system will throw a fatal error upon encountering unrateable calls.', @@ -151,6 +149,7 @@ tie my %temporalities, 'Tie::IxHash', '411_rewrite' => { 'name' => 'Rewrite these (comma-separated) destination numbers to 411 for rating purposes (also ignore any carrierid check): ', }, + #false laziness w/cdr_termination.pm 'output_format' => { 'name' => 'CDR invoice display format', 'type' => 'select', 'select_options' => { FS::cdr::invoice_formats() }, @@ -163,6 +162,7 @@ tie my %temporalities, 'Tie::IxHash', 'summarize_usage' => { 'name' => 'Include usage summary with recurring charges when usage is in separate section', 'type' => 'checkbox', }, + #eofalse 'bill_every_call' => { 'name' => 'Generate an invoice immediately for every call. Useful for prepaid.', 'type' => 'checkbox', @@ -475,10 +475,12 @@ sub calc_usage { my $minutes = sprintf("%.1f", $seconds / 60); $minutes =~ s/\.0$// ;# if $granularity == 60; - $charge = sprintf('%.2f', ( $self->option('min_charge') * $minutes ) - + 0.00000001 ); #so 1.005 rounds to 1.01 + # XXX config? + #$charge = sprintf('%.2f', ( $self->option('min_charge') * $minutes ) + #+ 0.00000001 ); #so 1.005 rounds to 1.01 + $charge = sprintf('%.4f', ( $self->option('min_charge') * $minutes ) + + 0.0000000001 ); #so 1.00005 rounds to 1.0001 - $charge = $charges += $charge; @call_details = ($cdr->downstream_csv( 'format' => $output_format, @@ -683,11 +685,6 @@ sub is_free { 0; } -sub base_recur { - my($self, $cust_pkg) = @_; - $self->option('recur_fee'); -} - # This equates svc_phone records; perhaps svc_phone should have a field # to indicate it represents a line sub calc_units {