prevent bug causing 'Error crediting customer for service remaining: FS::cust_pkg...
[freeside.git] / FS / FS / cust_svc.pm
index 9cb7a81..c91eba1 100644 (file)
@@ -19,7 +19,7 @@ use FS::part_export;
 
 @ISA = qw( FS::Record );
 
-$DEBUG = 1;
+$DEBUG = 0;
 
 $ignore_quantity = 0;
 
@@ -315,7 +315,8 @@ sub _svc_label {
   } elsif ( $svcdb eq 'svc_external' ) {
     my $conf = new FS::Conf;
     if ( $conf->config('svc_external-display_type') eq 'artera_turbo' ) {
-      $tag = sprintf('%010d', $svc_x->id). '-'. sprintf('%010d', $svc_x->title);
+      $tag = sprintf('%010d', $svc_x->id). '-'.
+             substr('0000000000'.uc($svc_x->title), -10);
     } else {
       $tag = $svc_x->id. ': '. $svc_x->title;
     }
@@ -553,11 +554,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
 
@@ -577,10 +578,11 @@ sub get_session_history {
   my @sessions = ();
 
   foreach my $part_export ( @part_export ) {
-    push @sessions, $part_export->usage_sessions( $start, $end, $self->svc_x );
+    push @sessions,
+      @{ $part_export->usage_sessions( $start, $end, $self->svc_x ) };
   }
 
-  \@sessions;
+  @sessions;
 
 }