-
+
|;
map { print "\n$column_header{$_}" } @column_index;
@@ -176,48 +212,65 @@ sub display_form {
|;
- $ml = ($form->{category} eq 'A') ? -1 : 1;
+ my $ml = ($form->{category} eq 'A') ? -1 : 1;
$form->{beginningbalance} *= $ml;
- $clearedbalance = $balance = $form->{beginningbalance};
- $i = 0;
- $id = 0;
-
- map { $column_data{$_} = " | " } qw(cleared transdate source name debit credit);
- $column_data{balance} = "".$form->format_amount(\%myconfig, $balance, 2, 0)." | ";
- $j = 0;
+ my $balance = $form->{beginningbalance};
+ my $clearedbalance = $balance;
+ my $i = 0;
+ my $id = 0;
+
+ my %column_data;
+ map { $column_data{$_} = " | " }
+ qw(cleared transdate source name debit credit);
+ $column_data{balance} =
+ ""
+ . $form->format_amount(\%myconfig, $balance, 2, 0) . " | ";
+ my $j = 0;
print qq|
-
+
|;
map { print "\n$column_data{$_}" } @column_index;
print qq|
-
+
|;
-
- foreach $ref (@{ $form->{PR} }) {
+ my $cleared;
+ my $totaldebits;
+ my $totalcredits;
+ my $fx_transaction;
+ my $fx;
+ foreach my $ref (@{ $form->{PR} }) {
$balance += $ref->{amount} * $ml;
$cleared += $ref->{amount} * $ml if $ref->{cleared};
- $column_data{name} = "$ref->{name} | ";
+ $column_data{name} = "$ref->{name} | ";
$column_data{source} = qq|$ref->{source}
| |;
$column_data{transdate} = "$ref->{transdate} | ";
-
- $column_data{debit} = " | ";
+
+ $column_data{debit} = " | ";
$column_data{credit} = " | ";
-
+
if ($ref->{amount} < 0) {
$totaldebits += $ref->{amount} * -1;
- $column_data{debit} = "".$form->format_amount(\%myconfig, $ref->{amount} * -1, 2, " ")." | ";
+ $column_data{debit} =
+ ""
+ . $form->format_amount(\%myconfig, $ref->{amount} * -1, 2, " ")
+ . " | ";
} else {
$totalcredits += $ref->{amount};
- $column_data{credit} = "".$form->format_amount(\%myconfig, $ref->{amount}, 2, " ")." | ";
+ $column_data{credit} =
+ ""
+ . $form->format_amount(\%myconfig, $ref->{amount}, 2, " ")
+ . " | ";
}
-
- $column_data{balance} = "".$form->format_amount(\%myconfig, $balance, 2, 0)." | ";
+
+ $column_data{balance} =
+ ""
+ . $form->format_amount(\%myconfig, $balance, 2, 0) . " | ";
if ($ref->{fx_transaction}) {
$i++ unless $id == $ref->{id};
@@ -236,15 +289,16 @@ sub display_form {
}
$id = $ref->{id};
- $j++; $j %= 2;
+ $j++;
+ $j %= 2;
print qq|
-
+
|;
map { print "\n$column_data{$_}" } @column_index;
print qq|
-
+
|;
}
@@ -252,33 +306,43 @@ sub display_form {
# print totals
map { $column_data{$_} = " | " } @column_index;
- $column_data{debit} = "".$form->format_amount(\%myconfig, $totaldebits, 2, " ")." | ";
- $column_data{credit} = "".$form->format_amount(\%myconfig, $totalcredits, 2, " ")." | ";
-
+ $column_data{debit} =
+ ""
+ . $form->format_amount(\%myconfig, $totaldebits, 2, " ") . " | ";
+ $column_data{credit} =
+ ""
+ . $form->format_amount(\%myconfig, $totalcredits, 2, " ") . " | ";
+
print qq|
-
+
|;
map { print "\n$column_data{$_}" } @column_index;
- $form->{statementbalance} = $form->parse_amount(\%myconfig, $form->{statementbalance});
- $difference = $form->format_amount(\%myconfig, $form->{statementbalance} - $clearedbalance - $cleared, 2, 0);
-
- $form->{statementbalance} = $form->format_amount(\%myconfig, $form->{statementbalance}, 2, 0);
+ $form->{statementbalance} =
+ $form->parse_amount(\%myconfig, $form->{statementbalance});
+ my $difference =
+ $form->format_amount(\%myconfig,
+ $form->{statementbalance} - $clearedbalance - $cleared,
+ 2, 0);
+
+ $form->{statementbalance} =
+ $form->format_amount(\%myconfig, $form->{statementbalance}, 2, 0);
$clearedbalance = $form->format_amount(\%myconfig, $clearedbalance, 2, 0);
-
+
+ my $exchdiff;
if ($fx) {
- $fx = $form->format_amount(\%myconfig, $fx, 2, 0);
+ $fx = $form->format_amount(\%myconfig, $fx, 2, 0);
$exchdiff = qq|
- |.$locale->text('Exchangerate Difference').qq| |
- |
- $fx |
+ | . $locale->text('Exchangerate Difference') . qq| |
+ |
+ $fx |
|;
}
print qq|
-
+
|
@@ -286,34 +350,34 @@ sub display_form {