- $form->{title} = "$form->{accno}--$form->{account}";
-
- $form->header;
-
- print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-<table width=100%>
- <tr>
- <th class=listtop>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <td>$option</td>
- </tr>
- <tr>
- <td>
- <table width=100%>
- <tr class=listheading>
-|;
-
- map { print "\n$column_header{$_}" } @column_index;
-
- print qq|
- </tr>
-|;
-
- $ml = ($form->{category} eq 'A') ? -1 : 1;
- $form->{beginningbalance} *= $ml;
- $clearedbalance = $balance = $form->{beginningbalance};
- $i = 0;
- $id = 0;
-
- map { $column_data{$_} = "<td> </td>" }
- qw(cleared transdate source name debit credit);
- $column_data{balance} =
- "<td align=right>"
- . $form->format_amount(\%myconfig, $balance, 2, 0) . "</td>";
- $j = 0;
- print qq|
- <tr class=listrow$j>
-|;
-
- map { print "\n$column_data{$_}" } @column_index;
-
- print qq|
- </tr>
-|;
-
- foreach $ref (@{ $form->{PR} }) {
-
- $balance += $ref->{amount} * $ml;
- $cleared += $ref->{amount} * $ml if $ref->{cleared};
-
- $column_data{name} = "<td>$ref->{name} </td>";
- $column_data{source} = qq|<td>$ref->{source} </a>
- </td>|;
- $column_data{transdate} = "<td>$ref->{transdate} </td>";
-
- $column_data{debit} = "<td> </td>";
- $column_data{credit} = "<td> </td>";
-
- if ($ref->{amount} < 0) {
- $totaldebits += $ref->{amount} * -1;
- $column_data{debit} =
- "<td align=right>"
- . $form->format_amount(\%myconfig, $ref->{amount} * -1, 2, " ")
- . "</td>";
- } else {
- $totalcredits += $ref->{amount};
- $column_data{credit} =
- "<td align=right>"
- . $form->format_amount(\%myconfig, $ref->{amount}, 2, " ")
- . "</td>";
- }
-
- $column_data{balance} =
- "<td align=right>"
- . $form->format_amount(\%myconfig, $balance, 2, 0) . "</td>";
-
- if ($ref->{fx_transaction}) {
- $i++ unless $id == $ref->{id};
- $fx_transaction = 1;
- $fx += $ref->{amount} * $ml;
- $column_data{cleared} = qq|<td align=center>
- <input type=hidden name="fxoid_$i" value=$ref->{oid}>
- </td>|;
- } else {
- $i++ unless ($fx_transaction && $id == $ref->{id});
- $fx_transaction = 0;
- $column_data{cleared} = qq|<td>
- <input name="cleared_$i" type=checkbox class=checkbox value=1 $ref->{cleared}>
- <input type=hidden name="oid_$i" value=$ref->{oid}>
- </td>|;
- }
- $id = $ref->{id};
-
- $j++;
- $j %= 2;
- print qq|
- <tr class=listrow$j>
-|;
-
- map { print "\n$column_data{$_}" } @column_index;
-
- print qq|
- </tr>
-|;