Bug 4192: Fixes warnings generated by opac-account.pl.
authorGarry Collum <gcollum@gmail.com>
Mon, 15 Feb 2010 22:44:47 +0000 (17:44 -0500)
committerGalen Charlton <gmcharlt@gmail.com>
Tue, 16 Feb 2010 11:12:38 +0000 (06:12 -0500)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
opac/opac-account.pl

index 43a1e0c..22d83b8 100755 (executable)
@@ -51,12 +51,12 @@ my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
 
 for ( my $i = 0 ; $i < $numaccts ; $i++ ) {
     $accts->[$i]{'date'} = format_date( $accts->[$i]{'date'} );
-    $accts->[$i]{'amount'} = sprintf( "%.2f", $accts->[$i]{'amount'} );
+    $accts->[$i]{'amount'} = sprintf( "%.2f", $accts->[$i]{'amount'} || '0.00');
     if ( $accts->[$i]{'amount'} >= 0 ) {
         $accts->[$i]{'amountcredit'} = 1;
     }
     $accts->[$i]{'amountoutstanding'} =
-      sprintf( "%.2f", $accts->[$i]{'amountoutstanding'} );
+      sprintf( "%.2f", $accts->[$i]{'amountoutstanding'} || '0.00' );
     if ( $accts->[$i]{'amountoutstanding'} >= 0 ) {
         $accts->[$i]{'amountoutstandingcredit'} = 1;
     }