- if ($form->{type} =~ /_quotation$/) {
- push @columns, "quonumber";
- }
-
- push @columns, qw(name spoolfile);
- my @column_index = $form->sort_columns(@columns);
- unshift @column_index, "checked";
-
- my %column_header;
- my %column_data;
-
- $column_header{checked} = "<th class=listheading> </th>";
- $column_header{transdate} =
- "<th><a class=listheading href=$href&sort=transdate>"
- . $locale->text('Date')
- . "</a></th>";
- $column_header{invnumber} =
- "<th><a class=listheading href=$href&sort=invnumber>"
- . $locale->text('Invoice')
- . "</a></th>";
- $column_header{ordnumber} =
- "<th><a class=listheading href=$href&sort=ordnumber>"
- . $locale->text('Order')
- . "</a></th>";
- $column_header{quonumber} =
- "<th><a class=listheading href=$href&sort=quonumber>"
- . $locale->text('Quotation')
- . "</a></th>";
- $column_header{name} =
- "<th><a class=listheading href=$href&sort=name>"
- . $locale->text($name)
- . "</a></th>";
- $column_header{spoolfile} =
- "<th class=listheading>" . $locale->text('Spoolfile') . "</th>";
-
- $form->header;
-
- print qq|
-<body>
-
-<form method=post action=bp.pl>
-
-<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>
-|;
-
- # add sort and escape callback, this one we use for the add sub
- $form->{callback} = $callback .= "&sort=$form->{sort}";
-
- # escape callback for href
- $callback = $form->escape($callback);
-
- my $i = 0;
- my $j = 0;
- my $spoolfile;
- my $spool = $::lx_office_conf{paths}->{spool};
-
- foreach my $ref (@{ $form->{SPOOL} }) {
-
- $i++;
-
- $form->{"checked_$i"} = "checked" if $form->{"checked_$i"};
-
- if ($ref->{invoice}) {
- $ref->{module} = ($ref->{module} eq 'ar') ? "is" : "ir";
- }
- my $module = "$ref->{module}.pl";
-
- $column_data{transdate} = "<td>$ref->{transdate} </td>";