- $column_data{netamount} =
- "<td align=right>"
- . $form->format_amount(\%myconfig, $ar->{netamount}, 2, " ")
- . "</td>";
- $column_data{tax} = "<td align=right>"
- . $form->format_amount(\%myconfig, $ar->{amount} - $ar->{netamount},
- 2, " ")
- . "</td>";
- $column_data{amount} =
- "<td align=right>"
- . $form->format_amount(\%myconfig, $ar->{amount}, 2, " ") . "</td>";
- $column_data{paid} =
- "<td align=right>"
- . $form->format_amount(\%myconfig, $ar->{paid}, 2, " ") . "</td>";
- $column_data{due} = "<td align=right>"
- . $form->format_amount(\%myconfig, $ar->{amount} - $ar->{paid},
- 2, " ")
- . "</td>";
-
- $subtotalnetamount += $ar->{netamount};
- $subtotalamount += $ar->{amount};
- $subtotalpaid += $ar->{paid};
- $subtotaldue += $ar->{amount} - $ar->{paid};
-
- $totalnetamount += $ar->{netamount};
- $totalamount += $ar->{amount};
- $totalpaid += $ar->{paid};
- $totaldue += ($ar->{amount} - $ar->{paid});
-
- $column_data{transdate} = "<td>$ar->{transdate} </td>";
- $column_data{id} = "<td>$ar->{id}</td>";
- $column_data{datepaid} = "<td>$ar->{datepaid} </td>";
- $column_data{duedate} = "<td>$ar->{duedate} </td>";
-
- $module = ($ar->{invoice}) ? "is.pl" : $form->{script};
-
- $column_data{invnumber} =
- "<td><a href=$module?action=edit&id=$ar->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ar->{invnumber}</a></td>";
-
- my $is_storno = $ar->{storno} && IS->is_storno(\%myconfig, $form, 'ar'); #($ar->{invnumber} =~ /^Storno zu/); # ToDO: fix this
- my $has_storno = $ar->{storno} && !$is_storno;
-
- $column_data{type} = "<td>" .
- ($has_storno ? $locale->text("Invoice with Storno (abbreviation)") :
- $is_storno ? $locale->text("Storno (one letter abbreviation)") :
- $ar->{amount} < 0 ? $locale->text("Credit note (one letter abbreviation)") :
- $ar->{invoice} ? $locale->text("Invoice (one letter abbreviation)") :
- $locale->text("AR Transaction (abbreviation)"))
- . "</td>";
- $column_data{ordnumber} = "<td>$ar->{ordnumber} </td>";
- $column_data{name} = "<td>$ar->{name}</td>";
- $ar->{notes} =~ s/\r\n/<br>/g;
- $column_data{notes} = "<td>$ar->{notes} </td>";
- $column_data{shippingpoint} = "<td>$ar->{shippingpoint} </td>";
- $column_data{shipvia} = "<td>$ar->{shipvia} </td>";
- $column_data{employee} = "<td>$ar->{employee} </td>";
- $column_data{globalprojectnumber} =
- "<td>" . H($ar->{globalprojectnumber}) . "</td>";
- $column_data{transaction_description} =
- "<td>" . H($ar->{transaction_description}) . "</td>";
-
- $i++;
- $i %= 2;
- print "
- <tr class=listrow$i>
-";
-
- map { print "\n$column_data{$_}" } @column_index;
-
- print qq|
- </tr>
-|;
-
- }
-
- if ($form->{l_subtotal} eq 'Y') {
- &ar_subtotal;
- }
-
- # print totals
- print qq|
- <tr class=listtotal>
-|;
-
- map { $column_data{$_} = "<td> </td>" } @column_index;
-
- $column_data{netamount} =
- "<th class=listtotal align=right>"
- . $form->format_amount(\%myconfig, $totalnetamount, 2, " ") . "</th>";
- $column_data{tax} = "<th class=listtotal align=right>"
- . $form->format_amount(\%myconfig, $totalamount - $totalnetamount,
- 2, " ")
- . "</th>";
- $column_data{amount} =
- "<th class=listtotal align=right>"
- . $form->format_amount(\%myconfig, $totalamount, 2, " ") . "</th>";
- $column_data{paid} =
- "<th class=listtotal align=right>"
- . $form->format_amount(\%myconfig, $totalpaid, 2, " ") . "</th>";
- $column_data{due} =
- "<th class=listtotal align=right>"
- . $form->format_amount(\%myconfig, $totaldue, 2, " ") . "</th>";
-
- map { print "\n$column_data{$_}" } @column_index;