-<input type=hidden name=tradediscount value=$form->{tradediscount}>
-<input type=hidden name=business value=$form->{business}>
-<input type=hidden name=webdav value=$webdav>
-
-<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 width=100%>
- <tr>
- <th align=right>$vclabel</th>
- <td colspan=3>$vc</td>
- <input type=hidden name=$form->{vc}_id value=$form->{"$form->{vc}_id"}>
- <input type=hidden name="old$form->{vc}" value="$form->{"old$form->{vc}"}">
- <th align=richt nowrap>|
- . $locale->text('Contact Person') . qq|</th>
- <td colspan=3>$contact</td>
- </tr>
- $creditremaining
- $business
- $dunning
- $taxzone
- $department
- <tr>
- <th align=right>| . $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}>
- $exchangerate
- </tr>
- <tr>
- <th align=right>| . $locale->text('Shipping Point') . qq|</th>
- <td colspan=3><input name=shippingpoint size=35 value="$form->{shippingpoint}"></td>
- </tr>
- <tr>
- <th align=right>| . $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=vendor_string name=delivery_vendor_string value="$form->{delivery_vendor_string}"></td>
-# </tr>
-# </table>
-# </td>
-# </tr>
-print qq| </table>
- </td>
- <td align=right>
- <table>
- $openclosed
- $employee
- $ordnumber
- $terms
- </table>
- </td>
- </tr>
- </table>
- </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=taxpart value="$form->{taxpart}">
-<input type=hidden name=taxservice value="$form->{taxservice}">
-
-<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"}">
-|;
- }
- $lxdebug->leave_sub();
-}
-
-sub form_footer {
- $lxdebug->enter_sub();
-
- $form->{invtotal} = $form->{invsubtotal};
-
- if (($rows = $form->numtextrows($form->{notes}, 25, 8)) < 2) {
- $rows = 2;
- }
- if (($introws = $form->numtextrows($form->{intnotes}, 35, 8)) < 2) {
- $introws = 2;
- }
- $rows = ($rows > $introws) ? $rows : $introws;
- $notes =
- qq|<textarea name=notes rows=$rows cols=25 wrap=soft>$form->{notes}</textarea>|;
- $intnotes =
- qq|<textarea name=intnotes rows=$rows cols=35 wrap=soft>$form->{intnotes}</textarea>|;
-
- $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
-
- $taxincluded = "";
- if ($form->{taxaccounts}) {
- $taxincluded = qq|
- <input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}> <b>|
- . $locale->text('Tax Included') . qq|</b><br><br>
-|;
- }
-
- if (!$form->{taxincluded}) {
-
- foreach $item (split / /, $form->{taxaccounts}) {
- if ($form->{"${item}_base"}) {
- $form->{invtotal} += $form->{"${item}_total"} =
- $form->round_amount(
- $form->{"${item}_base"} * $form->{"${item}_rate"},
- 2);
- $form->{"${item}_total"} =
- $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
-
- $tax .= qq|
- <tr>
- <th align=right>$form->{"${item}_description"}</th>
- <td align=right>$form->{"${item}_total"}</td>
- </tr>
-|;
- }
- }
-
- $form->{invsubtotal} =
- $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0);
-
- $subtotal = qq|
- <tr>
- <th align=right>| . $locale->text('Subtotal') . qq|</th>
- <td align=right>$form->{invsubtotal}</td>
- </tr>
-|;
-
- }
-
- if ($form->{taxincluded}) {
- foreach $item (split / /, $form->{taxaccounts}) {
- if ($form->{"${item}_base"}) {
- $form->{"${item}_total"} =
- $form->round_amount(
- ($form->{"${item}_base"} * $form->{"${item}_rate"} /
- (1 + $form->{"${item}_rate"})
- ),
- 2);
- $form->{"${item}_netto"} =
- $form->round_amount(
- ($form->{"${item}_base"} - $form->{"${item}_total"}),
- 2);
- $form->{"${item}_total"} =
- $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
- $form->{"${item}_netto"} =
- $form->format_amount(\%myconfig, $form->{"${item}_netto"}, 2);
-
- $tax .= qq|
- <tr>
- <th align=right>Enthaltene $form->{"${item}_description"}</th>
- <td align=right>$form->{"${item}_total"}</td>
- </tr>
- <tr>
- <th align=right>Nettobetrag</th>
- <td align=right>$form->{"${item}_netto"}</td>
- </tr>
-|;
- }
- }
-
- }
-
- $form->{oldinvtotal} = $form->{invtotal};
- $form->{invtotal} =
- $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0);
-
- print qq|
- <tr>
- <td>
- <table width=100%>
- <tr valign=bottom>
- <td>
- <table>
- <tr>
- <th align=left>| . $locale->text('Notes') . qq|</th>
- <th align=left>| . $locale->text('Internal Notes') . qq|</th>
- </tr>
- <tr valign=top>
- <td>$notes</td>
- <td>$intnotes</td>
- </tr>
- <th align=right>| . $locale->text('Payment Terms') . qq|</th>
- <td><select name=payment_id tabindex=24>$payment
- </select></td>
- </table>
- </td>
- <td align=right width=100%>
- $taxincluded
- <table width=100%>
- $subtotal
- $tax
- <tr>
- <th align=right>| . $locale->text('Total') . qq|</th>
- <td align=right>$form->{invtotal}</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-<input type=hidden name=oldinvtotal value=$form->{oldinvtotal}>
-<input type=hidden name=oldtotalpaid value=$totalpaid>
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
-|;
-
- if ($webdav) {
- $webdav_list = qq|
-
- <tr>
- <th class=listtop align=left>Dokumente im Webdav-Repository</th>
- </tr>
- <table width=100%>
- <td align=left width=30%><b>Dateiname</b></td>
- <td align=left width=70%><b>Webdavlink</b></td>
-|;
- foreach $file (keys %{ $form->{WEBDAV} }) {
- $webdav_list .= qq|
- <tr>
- <td align=left>$file</td>
- <td align=left><a href="$form->{WEBDAV}{$file}">$form->{WEBDAV}{$file}</a></td>
- </tr>
-|;
- }
- $webdav_list .= qq|
- </table>
- </tr>
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
-|;
-
- print $webdav_list;
- }
- print qq|
-<input type=hidden name=jscalendar value=$form->{jscalendar}>
-|;
- print qq|
- <tr>
- <td>
-|;
- &print_options;
-
- print qq|
- </td>
- </tr>
-</table>
-
-Bearbeiten des $form->{heading}<br>
-<input class=submit type=submit name=action value="|
- . $locale->text('Update') . qq|">
-<input class=submit type=submit name=action value="|
- . $locale->text('Ship to') . qq|">
-<input class=submit type=submit name=action value="|
- . $locale->text('Print') . qq|">
-<input class=submit type=submit name=action value="|
- . $locale->text('E-mail') . qq|">
-<input class=submit type=submit name=action value="|
- . $locale->text('Save') . qq|">
-<input class=submit type=submit name=action value="|
- . $locale->text('Save and Close') . qq|">
-|;
-
- if (($form->{id})) {
- print qq|
-<br>Workflow $form->{heading}<br>
-<input class=submit type=submit name=action value="|
- . $locale->text('Save as new') . qq|">
-<input class=submit type=submit name=action value="|
- . $locale->text('Delete') . qq|">|;
- if (($form->{type} =~ /sales_quotation$/)) {
- print qq|
-<input class=submit type=submit name=action value="|
- . $locale->text('Sales Order') . qq|">|;
- }
- if ($form->{type} =~ /request_quotation$/) {
- print qq|
-<input class=submit type=submit name=action value="|
- . $locale->text('Purchase Order') . qq|">|;
- }
- if (1) {
- print qq|
-<input class=submit type=submit name=action value="|
- . $locale->text('Invoice') . qq|">
-|;
-}
-
- if ($form->{type} =~ /sales_order$/) {
- print qq|
-<br>$form->{heading} als neue Vorlage verwenden für<br>
-<input class=submit type=submit name=action value="|
- . $locale->text('Purchase Order') . qq|">
-<input class=submit type=submit name=action value="|
- . $locale->text('Quotation') . qq|">
-|;
-
- } elsif ($form->{type} =~ /purchase_order$/) {
- print qq|
-<br>$form->{heading} als neue Vorlage verwenden für<br>
-<input class=submit type=submit name=action value="|
- . $locale->text('Sales Order') . qq|">
-<input class=submit type=submit name=action value="|
- . $locale->text('Quotation') . qq|">
-|;
-
- } else {
- print qq|
-<br>$form->{heading} als neue Vorlage verwenden für<br>
-<input class=submit type=submit name=action value="|
- . $locale->text('Order') . qq|">
-|;
- }
- } elsif ($form->{type} =~ /sales_order$/ && $form->{rowcount} && !$form->{proforma}) {
- print qq|
-<br>Workflow $form->{heading}<br>
-<input class=submit type=submit name=action value="|
- . $locale->text('Save as new') . qq|">
-<input class=submit type=submit name=action value="|
- . $locale->text('Invoice') . qq|">
-|;
- }
-
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
-
-<input type=hidden name=rowcount value=$form->{rowcount}>
-
-<input name=callback type=hidden value="$form->{callback}">
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-</form>
-
-</body>
-</html>
-|;
- $lxdebug->leave_sub();
-}
-
-sub update {
- $lxdebug->enter_sub();
-
- map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
- qw(exchangerate creditlimit creditremaining);
- $form->{update} = 1;
-
- &check_name($form->{vc});
-
- &check_project;
-
- $buysell = 'buy';
- $buysell = 'sell' if ($form->{vc} eq 'vendor');
- $form->{exchangerate} = $exchangerate
- if (
- $form->{forex} = (
- $exchangerate =
- $form->check_exchangerate(
- \%myconfig, $form->{currency}, $form->{transdate}, $buysell
- )));
-
- # for pricegroups
- $i = $form->{rowcount};
-
- $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
-
- if ( ($form->{"partnumber_$i"} eq "")
- && ($form->{"description_$i"} eq "")
- && ($form->{"partsgroup_$i"} eq "")) {