- if ( $accts->[$i]{'amount'} <= 0 ) {
- $accts->[$i]{'amountcredit'} = 1;
- }
-
- $accts->[$i]{'amountoutstanding'} += 0.00;
- if ( $accts->[$i]{'amountoutstanding'} <= 0 ) {
- $accts->[$i]{'amountoutstandingcredit'} = 1;
- }
-
- my %row = (
- 'date' => output_pref({ dt => dt_from_string( $accts->[$i]{'date'} ), dateonly => 1 }),
- 'amountcredit' => $accts->[$i]{'amountcredit'},
- 'amountoutstandingcredit' => $accts->[$i]{'amountoutstandingcredit'},
- 'toggle' => $accts->[$i]{'toggle'},
- 'description' => $accts->[$i]{'description'},
- 'itemnumber' => $accts->[$i]{'itemnumber'},
- 'biblionumber' => $accts->[$i]{'biblionumber'},
- 'amount' => sprintf( "%.2f", $accts->[$i]{'amount'} ),
- 'amountoutstanding' => sprintf( "%.2f", $accts->[$i]{'amountoutstanding'} ),
- 'accountno' => $accts->[$i]{'accountno'},
- accounttype => $accts->[$i]{accounttype},
- 'note' => $accts->[$i]{'note'},
- );
-
- if ( $accts->[$i]{'accounttype'} ne 'F' && $accts->[$i]{'accounttype'} ne 'FU' ) {
- $row{'printtitle'} = 1;
- $row{'title'} = $accts->[$i]{'title'};
- }
-
- push( @accountrows, \%row );
+$accountline->{'amount'} += 0.00;
+if ( $accountline->{'amount'} <= 0 ) {
+ $accountline->{'amountcredit'} = 1;
+ $accountline->{'amount'} *= -1.00;
+}
+$accountline->{'amountoutstanding'} += 0.00;
+if ( $accountline->{'amountoutstanding'} <= 0 ) {
+ $accountline->{'amountoutstandingcredit'} = 1;