fix up some bugs in VoIP rating
authorivan <ivan>
Fri, 31 Dec 2004 00:48:08 +0000 (00:48 +0000)
committerivan <ivan>
Fri, 31 Dec 2004 00:48:08 +0000 (00:48 +0000)
FS/FS/cust_svc.pm
FS/FS/part_pkg/voip_sqlradacct.pm
FS/FS/svc_acct.pm

index 37b73b1..474276e 100644 (file)
@@ -553,11 +553,11 @@ sub attribute_since_sqlradacct {
 
 }
 
-=item get_session_history_sqlradacct TIMESTAMP_START TIMESTAMP_END
+=item get_session_history TIMESTAMP_START TIMESTAMP_END
 
-See L<FS::svc_acct/get_session_history_sqlradacct>.  Equivalent to
-$cust_svc->svc_x->get_session_history_sqlradacct, but more efficient.
-Meaningless for records where B<svcdb> is not "svc_acct".
+See L<FS::svc_acct/get_session_history>.  Equivalent to
+$cust_svc->svc_x->get_session_history, but more efficient.  Meaningless for
+records where B<svcdb> is not "svc_acct".
 
 =cut
 
@@ -580,7 +580,7 @@ sub get_session_history {
     push @sessions, $part_export->usage_sessions( $start, $end, $self->svc_x );
   }
 
-  \@sessions;
+  @sessions;
 
 }
 
index 3989cdb..0b3250a 100644 (file)
@@ -1,7 +1,7 @@
 package FS::part_pkg::voip_sqlradacct;
 
 use strict;
-use vars qw(@ISA %info);
+use vars qw(@ISA $DEBUG %info);
 use FS::Record qw(qsearchs qsearch);
 use FS::part_pkg;
 #use FS::rate;
@@ -9,6 +9,8 @@ use FS::rate_prefix;
 
 @ISA = qw(FS::part_pkg);
 
+$DEBUG = 0;
+
 %info = (
     'name' => 'VoIP rating by plan of CDR records in an SQL RADIUS radacct table',
     'fields' => {
@@ -52,6 +54,7 @@ sub calc_recur {
     foreach my $session (
       $cust_svc->get_session_history( $last_bill, $$sdate )
     ) {
+      warn "rating session $session" if $DEBUG;
 
       ###
       # look up rate details based on called station id
index 8e47abf..caddb52 100644 (file)
@@ -1143,16 +1143,16 @@ sub attribute_since_sqlradacct {
   $self->cust_svc->attribute_since_sqlradacct(@_);
 }
 
-=item get_session_history_sqlradacct TIMESTAMP_START TIMESTAMP_END
+=item get_session_history TIMESTAMP_START TIMESTAMP_END
 
 Returns an array of hash references of this customers login history for the
 given time range.  (document this better)
 
 =cut
 
-sub get_session_history_sqlradacct {
+sub get_session_history {
   my $self = shift;
-  $self->cust_svc->get_session_history_sqlradacct(@_);
+  $self->cust_svc->get_session_history(@_);
 }
 
 =item radius_groups