- my %row = ( 'date' => format_date($accts->[$i]{'date'}),
- 'amountcredit' => $accts->[$i]{'amountcredit'},
- 'amountoutstandingcredit' => $accts->[$i]{'amountoutstandingcredit'},
- 'toggle' => $accts->[$i]{'toggle'},
- 'description' => $accts->[$i]{'description'},
- 'amount' => sprintf("%.2f",$accts->[$i]{'amount'}),
- 'amountoutstanding' => sprintf("%.2f",$accts->[$i]{'amountoutstanding'}) );
-
- if ($accts->[$i]{'accounttype'} ne 'F' && $accts->[$i]{'accounttype'} ne 'FU'){
- $row{'printtitle'}=1;
- $row{'title'} = $accts->[$i]{'title'};
+
+ $accountline->{date} = format_date($accountline->{date});
+ $accountline->{amount} = sprintf '%.2f', $accountline->{amount};
+ $accountline->{amountoutstanding} = sprintf '%.2f', $accountline->{amountoutstanding};
+ if ($accountline->{accounttype} eq 'Pay') {
+ $accountline->{payment} = 1;
+ $reverse_col = 1;