- if ($form->{currency} ne $form->{defaultcurrency}) {
- if ($form->{forex}) {
- $exchangerate .=
- qq|<th align=right>|
- . $locale->text('Exchangerate')
- . qq|</th><td>$form->{exchangerate}</td>
- <input type=hidden name=exchangerate value=$form->{exchangerate}>
-|;
- } else {
- $exchangerate .=
- qq|<th align=right>|
- . $locale->text('Exchangerate')
- . qq|</th><td><input name=exchangerate size=10 value=$form->{exchangerate}></td>|;
- }
- }
-
- $vclabel = ucfirst $form->{vc};
- $vclabel = $locale->text($vclabel);
-
-
-
- if ($form->{business}) {
- $business = qq|
- <tr>
- <th align=right>| . $locale->text('Business') . qq|</th>
- <td>$form->{business}</td>
- <th align=right>| . $locale->text('Trade Discount') . qq|</th>
- <td>|
- . $form->format_amount(\%myconfig, $form->{tradediscount} * 100)
- . qq| %</td>
- </tr>
-|;
- }
-
- if ($form->{max_dunning_level}) {
- $dunning = qq|
- <tr>
- <td colspan=4>
- <table>
- <tr>
- <th align=right>| . $locale->text('Max. Dunning Level') . qq|:</th>
- <td><b>$form->{max_dunning_level}</b></td>
- <th align=right>| . $locale->text('Dunning Amount') . qq|:</th>
- <td><b>|
- . $form->format_amount(\%myconfig, $form->{dunning_amount},2)
- . qq|</b></td>
- </tr>
- </table>
- </td>
- </tr>
-|;
- }
-
- if (@{ $form->{TAXZONE} }) {
- $form->{selecttaxzone} = "";
- foreach $item (@{ $form->{TAXZONE} }) {
- if ($item->{id} == $form->{taxzone_id}) {
- $form->{selecttaxzone} .=
- "<option value=$item->{id} selected>" . H($item->{description}) .
- "</option>";
- } else {
- $form->{selecttaxzone} .=
- "<option value=$item->{id}>" . H($item->{description}) . "</option>";
- }
-
- }
- } else {
- $form->{selecttaxzone} =~ s/ selected//g;
- if ($form->{taxzone_id} ne "") {
- $form->{selecttaxzone} =~ s/value=$form->{taxzone_id}>/value=$form->{taxzone_id} selected>/;
- }
- }
-
- $taxzone = qq|
- <tr>
- <th align=right>| . $locale->text('Steuersatz') . qq|</th>
- <td><select name=taxzone_id>$form->{selecttaxzone}</select></td>
- <input type=hidden name=selecttaxzone value="$form->{selecttaxzone}">
- </tr>|;
-
-
- if ($form->{type} !~ /_quotation$/) {
- $ordnumber = qq|
- <tr>
- <th width=70% align=right nowrap>| . $locale->text('Order Number') . qq|</th>
- <td><input name=ordnumber size=11 value="$form->{ordnumber}"></td>
- </tr>
- <tr>
- <th width=70% align=right nowrap>|
- . $locale->text('Quotation Number') . qq|</th>
- <td><input name=quonumber size=11 value="$form->{quonumber}"></td>
- </tr>
- <tr>
- <th width=70% align=right nowrap>|
- . $locale->text('Customer Order Number') . qq|</th>
- <td><input name=cusordnumber size=11 value="$form->{cusordnumber}"></td>
- </tr>
- <tr>
- <th align=right nowrap>| . $locale->text('Order Date') . qq|</th>
- $button1
-
- </tr>
- <tr>
- <th align=right nowrap=true>| . $locale->text('Required by') . qq|</th>
- $button2
- </tr>
-|;
-
- $n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
-
- $creditremaining = qq|
- <tr>
- <td></td>
- <td colspan=3>
- <table>
- <tr>
- <th nowrap>| . $locale->text('Credit Limit') . qq|</th>
- <td>$form->{creditlimit}</td>
- <td width=20%></td>
- <th nowrap>| . $locale->text('Remaining') . qq|</th>
- <td class="plus$n" nowrap>$form->{creditremaining}</td>
- </tr>
- </table>
- </td>
- $shipto
- </tr>
-|;
- } else {
- $reqlabel =
- ($form->{type} eq 'sales_quotation')
- ? $locale->text('Valid until')
- : $locale->text('Required by');
- if ($form->{type} eq 'sales_quotation') {
- $ordnumber = qq|
- <tr>
- <th width=70% align=right nowrap>|
- . $locale->text('Quotation Number') . qq|</th>
- <td><input name=quonumber size=11 value="$form->{quonumber}"></td>
- <input type=hidden name=ordnumber value="$form->{ordnumber}">
- </tr>
-|;
- } else {
- $ordnumber = qq|
- <tr>
- <th width=70% align=right nowrap>| . $locale->text('RFQ Number') . qq|</th>
- <td><input name=quonumber size=11 value="$form->{quonumber}"></td>
- <input type=hidden name=ordnumber value="$form->{ordnumber}">
- </tr>
-|;
-
- }
-
- $ordnumber .= qq|
- <tr>
- <th align=right nowrap>| . $locale->text('Quotation Date') . qq|</th>
- $button1
- </tr>
- <tr>
- <th align=right nowrap=true>$reqlabel</th>
- $button2
- </tr>
-|;
- $creditremaining = qq| <tr>
- <td colspan=4></td>
- $shipto
- </tr>|;
- }
-
- $vc =
- ($form->{"select$form->{vc}"})
- ? qq|<select name=$form->{vc}>$form->{"select$form->{vc}"}</select>\n<input type=hidden name="select$form->{vc}" value="$form->{"select$form->{vc}"}">|
- : qq|<input name=$form->{vc} value="$form->{$form->{vc}}" size=35>|;
-
- $department = qq|
- <tr>
- <th align="right" nowrap>| . $locale->text('Department') . qq|</th>
- <td colspan=3><select name=department>$form->{selectdepartment}</select>
- <input type=hidden name=selectdepartment value="$form->{selectdepartment}">
- </td>
- </tr>
-| if $form->{selectdepartment};
-
- $employee = qq|
- <input type=hidden name=employee value="$form->{employee}">
-|;
-
- if ($form->{type} eq 'sales_order') {
- if ($form->{selectemployee}) {
- $employee = qq|
- <input type=hidden name=customer_klass value=$form->{customer_klass}>
- <tr>
- <th align=right nowrap>| . $locale->text('Employee') . qq|</th>
- <td colspan=2><select name=employee>$form->{selectemployee}</select></td>
- <input type=hidden name=selectemployee value="$form->{selectemployee}">
- <td></td>
- </tr>
-|;
- }
- } else {
- $employee = qq|
- <input type=hidden name=customer_klass value=$form->{customer_klass}>
- <tr>
- <th align=right nowrap>| . $locale->text('Employee') . qq|</th>
- <td colspan=2><select name=employee>$form->{selectemployee}</select></td>
- <input type=hidden name=selectemployee value="$form->{selectemployee}">
- <td></td>
- </tr>
-|;
- }
- if ($form->{resubmit} && ($form->{format} eq "html")) {
- $onload =
- qq|window.open('about:blank','Beleg'); document.oe.target = 'Beleg';document.oe.submit()|;
- } elsif ($form->{resubmit}) {
- $onload = qq|document.oe.submit()|;
- } else {
- $onload = "fokus()";
- }
-
- $credittext = $locale->text('Credit Limit exceeded!!!');
- if ($creditwarning) {
- $onload = qq|alert('$credittext')|;
- }
-
- $form->{"javascript"} .= qq|<script type="text/javascript" src="js/show_form_details.js"></script>|;
- # show history button js