- if ($form->{type} =~ /sales_order/) {
- unshift @column_index, "ids";
- }
-
- if ($form->{l_subtotal} eq 'Y') {
- $callback .= "&l_subtotal=Y";
- $href .= "&l_subtotal=Y";
- }
-
- if ($form->{vc} eq 'vendor') {
- if ($form->{type} eq 'purchase_order') {
- $form->{title} = $locale->text('Purchase Orders');
- } else {
- $form->{title} = $locale->text('Request for Quotations');
- }
- $name = $locale->text('Vendor');
- $employee = $locale->text('Employee');
- }
- if ($form->{vc} eq 'customer') {
- if ($form->{type} eq 'sales_order') {
- $form->{title} = $locale->text('Sales Orders');
- } else {
- $form->{title} = $locale->text('Quotations');
- }
- $employee = $locale->text('Employee');
- $name = $locale->text('Customer');
- }
-
- $column_header{id} =
- qq|<th><a class=listheading href=$href&sort=id>|
- . $locale->text('ID')
- . qq|</a></th>|;
- $column_header{transdate} =
- qq|<th><a class=listheading href=$href&sort=transdate>|
- . $locale->text('Date')
- . qq|</a></th>|;
- $column_header{reqdate} =
- qq|<th><a class=listheading href=$href&sort=reqdate>|
- . $locale->text('Required by')
- . qq|</a></th>|;
- $column_header{ordnumber} =
- qq|<th><a class=listheading href=$href&sort=ordnumber>|
- . $locale->text('Order')
- . qq|</a></th>|;
- $column_header{quonumber} =
- qq|<th><a class=listheading href=$href&sort=quonumber>|
- . ($form->{"type"} eq "request_quotation" ?
- $locale->text('RFQ') :
- $locale->text('Quotation'))
- . qq|</a></th>|;
- $column_header{name} =
- qq|<th><a class=listheading href=$href&sort=name>$name</a></th>|;
- $column_header{netamount} =
- qq|<th class=listheading>| . $locale->text('Amount') . qq|</th>|;
- $column_header{tax} =
- qq|<th class=listheading>| . $locale->text('Tax') . qq|</th>|;
- $column_header{amount} =
- qq|<th class=listheading>| . $locale->text('Total') . qq|</th>|;
- $column_header{curr} =
- qq|<th class=listheading>| . $locale->text('Curr') . qq|</th>|;
- $column_header{shipvia} =
- qq|<th><a class=listheading href=$href&sort=shipvia>|
- . $locale->text('Ship via')
- . qq|</a></th>|;
- $column_header{globalprojectnumber} =
- qq|<th class="listheading">| . $locale->text('Project Number') . qq|</th>|;
- $column_header{open} =
- qq|<th class=listheading>| . $locale->text('O') . qq|</th>|;
- $column_header{closed} =
- qq|<th class=listheading>| . $locale->text('C') . qq|</th>|;
- $column_header{"delivered"} =
- qq|<th class="listheading">| . $locale->text("Delivered") . qq|</th>|;
-
- $column_header{employee} =
- qq|<th><a class=listheading href=$href&sort=employee>$employee</a></th>|;
-
- $column_header{ids} = qq|<th></th>|;
-
- if ($form->{ $form->{vc} }) {
- $option = $locale->text(ucfirst $form->{vc});
- $option .= " : $form->{$form->{vc}}";
- }
- if ($form->{department}) {
- $option .= "\n<br>" if ($option);
- ($department) = split /--/, $form->{department};
- $option .= $locale->text('Department') . " : $department";
- }
- if ($form->{transdatefrom}) {
- $option .= "\n<br>"
- . $locale->text('From') . " "
- . $locale->date(\%myconfig, $form->{transdatefrom}, 1);
- }
- if ($form->{transdateto}) {
- $option .= "\n<br>"
- . $locale->text('Bis') . " "
- . $locale->date(\%myconfig, $form->{transdateto}, 1);
- }
- if ($form->{open}) {
- $option .= "\n<br>" if ($option);
- $option .= $locale->text('Open');
- }
- if ($form->{closed}) {
- $option .= "\n<br>" if ($option);
- $option .= $locale->text('Closed');
- }
-
- $form->header;
-
- print qq|
-<body>
-
-<form method="post" action="oe.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
- $callback_escaped = $form->escape($callback . "&sort=$form->{sort}");
-
- if (@{ $form->{OE} }) {
- $sameitem = $form->{OE}->[0]->{ $form->{sort} };