- $exchangerate = "";
- if ($form->{currency} ne $form->{defaultcurrency}) {
- if ($form->{forex}) {
- $exchangerate .=
- qq|<th align=right>|
- . $locale->text('Exchangerate')
- . qq|</th><td>$form->{exchangerate}<input type=hidden name=exchangerate value=$form->{exchangerate}></td>|;
- } else {
- $exchangerate .=
- qq|<th align=right>|
- . $locale->text('Exchangerate')
- . qq|</th><td><input name=exchangerate size=10 value=$form->{exchangerate}></td>|;
- }
- }
- $exchangerate .= qq|
-<input type=hidden name=forex value=$form->{forex}>
-|;
-
- $customer =
- ($form->{selectcustomer})
- ? qq|<select name=customer>$form->{selectcustomer}</select>\n<input type=hidden name="selectcustomer" value="$form->{selectcustomer}">|
- : qq|<input name=customer value="$form->{customer}" size=35>|;
-
- #sk
- $contact =
- ($form->{selectcontact})
- ? qq|<select name=cp_id>$form->{selectcontact}</select>\n<input type=hidden name="selectcontact" value="$form->{selectcontact}">|
- : qq|<input name=contact value="$form->{contact}" 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};
-
- $n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
-
- 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>
-|;
- }
-
- $form->{fokus} = "invoice.customer";
-
- # use JavaScript Calendar or not
- $form->{jsscript} = $jscalendar;
- $jsscript = "";
- if ($form->{type} eq "credit_note") {
- if ($form->{jsscript}) {
-
- # with JavaScript Calendar
- $button1 = qq|
- <td><input name=invdate id=invdate size=11 title="$myconfig{dateformat}" value=$form->{invdate}></td>
- <td><input type=button name=invdate id="trigger1" value=|
- . $locale->text('button') . qq|></td>
- |;
-
- #write Trigger
- $jsscript =
- Form->write_trigger(\%myconfig, "1",
- "invdate", "BL",
- "trigger1");
- } else {
-
- # without JavaScript Calendar
- $button1 =
- qq|<td><input name=invdate size=11 title="$myconfig{dateformat}" value=$form->{invdate}></td>|;
- $button2 =
- qq|<td width="13"><input name=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td>|;
- }
- } else {
- if ($form->{jsscript}) {
-
- # with JavaScript Calendar
- $button1 = qq|
- <td><input name=invdate id=invdate size=11 title="$myconfig{dateformat}" value=$form->{invdate}></td>
- <td><input type=button name=invdate id="trigger1" value=|
- . $locale->text('button') . qq|></td>
- |;
- $button2 = qq|
- <td width="13"><input name=duedate id=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td>
- <td width="4"><input type=button name=duedate id="trigger2" value=|
- . $locale->text('button') . qq|></td></td>
- |;
- $button3 = qq|
- <td width="13"><input name=deliverydate id=deliverydate size=11 title="$myconfig{dateformat}" value=$form->{deliverydate}></td>
- <td width="4"><input type=button name=deliverydate id="trigger3" value=|
- . $locale->text('button') . qq|></td></td>
- |;
-
- #write Trigger
- $jsscript =
- Form->write_trigger(\%myconfig, "3",
- "invdate", "BL",
- "trigger1", "duedate",
- "BL", "trigger2",
- "deliverydate", "BL",
- "trigger3");
- } else {
-
- # without JavaScript Calendar
- $button1 =
- qq|<td><input name=invdate size=11 title="$myconfig{dateformat}" value=$form->{invdate}></td>|;
- $button2 =
- qq|<td width="13"><input name=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td>|;
- }
- }
- if ($form->{resubmit} && ($form->{format} eq "html")) {
- $onload =
- qq|window.open('about:blank','Beleg'); document.invoice.target = 'Beleg';document.invoice.submit()|;
- } elsif ($form->{resubmit}) {
- $onload = qq|document.invoice.submit()|;
- } else {
- $onload = "fokus()";
- }
-
- $credittext = $locale->text('Credit Limit exceeded!!!');
- if ($creditwarning) {
- $onload = qq|alert('$credittext')|;
- }
-
- $form->header;
-
- print qq|
-<body onLoad="$onload">
-<script type="text/javascript" src="js/common.js"></script>
-<script type="text/javascript" src="js/delivery_customer_selection.js"></script>
-<script type="text/javascript" src="js/vendor_selection.js"></script>
-<script type="text/javascript" src="js/calculate_qty.js"></script>
-
-<form method=post name="invoice" action=$form->{script}>
-
-
-<input type=hidden name=id value=$form->{id}>
-<input type=hidden name=action value=$form->{action}>
-
-<input type=hidden name=type value=$form->{type}>
-<input type=hidden name=media value=$form->{media}>
-<input type=hidden name=format value=$form->{format}>
-
-<input type=hidden name=queued value="$form->{queued}">
-<input type=hidden name=printed value="$form->{printed}">
-<input type=hidden name=emailed value="$form->{emailed}">
-
-<input type=hidden name=title value="$form->{title}">
-<input type=hidden name=vc value=$form->{vc}>
-
-<input type=hidden name=discount value=$form->{discount}>
-<input type=hidden name=creditlimit value=$form->{creditlimit}>
-<input type=hidden name=creditremaining value=$form->{creditremaining}>
-
-<input type=hidden name=tradediscount value=$form->{tradediscount}>
-<input type=hidden name=business value=$form->{business}>
-
-<input type=hidden name=closedto value=$form->{closedto}>
-<input type=hidden name=locked value=$form->{locked}>
-
-<input type=hidden name=shipped value=$form->{shipped}>
-<input type=hidden name=lizenzen value=$lizenzen>
-<input type=hidden name=storno value=$form->{storno}>
-<input type=hidden name=storno_id value=$form->{storno_id}>
-
-
-
-<table width=100%>
- <tr class=listtop>
- <th class=listtop>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr>
- <td>
- <table width=100%>
- <tr valign=top>
- <td>
- <table>
- <tr>
- <th align=right nowrap>| . $locale->text('Customer') . qq|</th>
- <td colspan=3>$customer</td>
- <input type=hidden name=customer_klass value=$form->{customer_klass}>
- <input type=hidden name=customer_id value=$form->{customer_id}>
- <input type=hidden name=oldcustomer value="$form->{oldcustomer}">
- <th align=richt nowrap>|
- . $locale->text('Contact Person') . qq|</th>
- <td colspan=3>$contact</td>
- </tr>
- <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">$form->{creditremaining}</td>
- </tr>
- </table>
- </td>
- $shipto
- </tr>
- $business
- $dunning
- <tr>
- <th align=right nowrap>| . $locale->text('Record in') . qq|</th>
- <td colspan=3><select name=AR style="width:280px;">$form->{selectAR}</select></td>
- <input type=hidden name=selectAR value="$form->{selectAR}">
- </tr>
- $taxzone
- $department
- <tr>
- <th align=right nowrap>| . $locale->text('Currency') . qq|</th>
- <td><select name=currency>$form->{selectcurrency}</select></td>
- <input type=hidden name=selectcurrency value="$form->{selectcurrency}">
- <input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
- <input type=hidden name=fxgain_accno value=$form->{fxgain_accno}>
- <input type=hidden name=fxloss_accno value=$form->{fxloss_accno}>
- $exchangerate
- </tr>
- <tr>
- <th align=right nowrap>| . $locale->text('Shipping Point') . qq|</th>
- <td colspan=3><input name=shippingpoint size=35 value="$form->{shippingpoint}"></td>
- </tr>
- <tr>
- <th align=right nowrap>| . $locale->text('Ship via') . qq|</th>
- <td colspan=3><input name=shipvia size=35 value="$form->{shipvia}"></td>
- </tr>|;
-# <tr>
-# <td colspan=4>
-# <table>
-# <tr>
-# <td colspan=2>
-# <button type="button" onclick="delivery_customer_selection_window('delivery_customer_string','delivery_customer_id')">| . $locale->text('Choose Customer') . qq|</button>
-# </td>
-# <td colspan=2><input type=hidden name=delivery_customer_id value="$form->{delivery_customer_id}">
-# <input size=45 id=delivery_customer_string name=delivery_customer_string value="$form->{delivery_customer_string}"></td>
-# </tr>
-# <tr>
-# <td colspan=2>
-# <button type="button" onclick="vendor_selection_window('delivery_vendor_string','delivery_vendor_id')">| . $locale->text('Choose Vendor') . qq|</button>
-# </td>
-# <td colspan=2><input type=hidden name=delivery_vendor_id value="$form->{delivery_vendor_id}">
-# <input size=45 id=delivery_vendor_string name=delivery_vendor_string value="$form->{delivery_vendor_string}"></td>
-# </tr>
-# </table>
-# </td>
-# </tr>
-print qq| </table>
- </td>
- <td align=right>
- <table>
- <tr>
- <th align=right nowrap>| . $locale->text('Salesperson') . 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->{type} eq "credit_note") {
-print qq| <tr>
- <th align=right nowrap>| . $locale->text('Credit Note Number') . qq|</th>
- <td><input name=invnumber size=11 value="$form->{invnumber}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Credit Note Date') . qq|</th>
- $button1
- </tr>|;
-} else {
-print qq| <tr>
- <th align=right nowrap>| . $locale->text('Invoice Number') . qq|</th>
- <td><input name=invnumber size=11 value="$form->{invnumber}"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Invoice Date') . qq|</th>
- $button1
- </tr>
- <tr>
- <th align=right>| . $locale->text('Due Date') . qq|</th>
- $button2
- </tr>
- <tr>
- <th align=right>| . $locale->text('Delivery Date') . qq|</th>
- $button3
- </tr>|;
-}
-print qq| <tr>
- <th align=right nowrap>| . $locale->text('Order Number') . qq|</th>
- <td><input name=ordnumber size=11 value="$form->{ordnumber}"></td>
- </tr>
- <tr>
- <th align=right nowrap>| . $locale->text('Quotation Number') . qq|</th>
- <td><input name=quonumber size=11 value="$form->{quonumber}"></td>
- </tr>
- <tr>
- <th align=right nowrap>| . $locale->text('Customer Order Number') . qq|</th>
- <td><input name=cusordnumber size=11 value="$form->{cusordnumber}"></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- </td>
- </tr>
-
-$jsscript
-
-<!-- shipto are in hidden variables -->
-
-<input type=hidden name=shiptoname value="$form->{shiptoname}">
-<input type=hidden name=shiptostreet value="$form->{shiptostreet}">
-<input type=hidden name=shiptozipcode value="$form->{shiptozipcode}">
-<input type=hidden name=shiptocity value="$form->{shiptocity}">
-<input type=hidden name=shiptocountry value="$form->{shiptocountry}">
-<input type=hidden name=shiptocontact value="$form->{shiptocontact}">
-<input type=hidden name=shiptophone value="$form->{shiptophone}">
-<input type=hidden name=shiptofax value="$form->{shiptofax}">
-<input type=hidden name=shiptoemail value="$form->{shiptoemail}">
-
-<!-- email variables -->
-<input type=hidden name=message value="$form->{message}">
-<input type=hidden name=email value="$form->{email}">
-<input type=hidden name=subject value="$form->{subject}">
-<input type=hidden name=cc value="$form->{cc}">
-<input type=hidden name=bcc value="$form->{bcc}">
-<input type=hidden name=webdav value=$webdav>
-<input type=hidden name=taxaccounts value="$form->{taxaccounts}">
-|;
-
- foreach $item (split / /, $form->{taxaccounts}) {
- print qq|
-<input type=hidden name="${item}_rate" value="$form->{"${item}_rate"}">
-<input type=hidden name="${item}_description" value="$form->{"${item}_description"}">
-<input type=hidden name="${item}_taxnumber" value="$form->{"${item}_taxnumber"}">
-|;
- }
- $lxdebug->leave_sub();