don't abort upgrade if a RADIUS server is unreachable
[freeside.git] / FS / FS / cust_bill_pkg.pm
index 7406eda..1ee5c09 100644 (file)
@@ -360,7 +360,7 @@ sub regularize_details {
         # then turn it into one
         my %hash = ();
         if ( ! ref($detail) ) {
-          $hash{'detail'} = 'detail';
+          $hash{'detail'} = $detail;
         }
         elsif ( ref($detail) eq 'HASH' ) {
           %hash = %$detail;
@@ -893,7 +893,7 @@ sub usage {
 
   if ( $self->get('details') ) {
 
-    return sum( 
+    return sum( 0, 
       map { $_->amount || 0 }
       grep { !defined($classnum) or $classnum eq $_->classnum }
       @{ $self->get('details') }
@@ -908,7 +908,7 @@ sub usage {
     my $sth = dbh->prepare($sql) or die dbh->errstr;
     $sth->execute or die $sth->errstr;
 
-    return $sth->fetchrow_arrayref->[0];
+    return $sth->fetchrow_arrayref->[0] || 0;
 
   }