1 |
|
[% USE HTML %][% USE L %][% USE LxERP %]
|
|
1 |
[% USE HTML %][% USE L %][% USE LxERP %][%- USE JavaScript -%]
|
|
2 |
|
|
3 |
<script type="text/javascript">
|
|
4 |
var addresses = [
|
|
5 |
{ shiptoname: "[% JavaScript.escape(vc_obj.name) %]",
|
|
6 |
shiptodepartment_1: "[% JavaScript.escape(vc_obj.department_1) %]",
|
|
7 |
shiptodepartment_2: "[% JavaScript.escape(vc_obj.department_2) %]",
|
|
8 |
shiptostreet: "[% JavaScript.escape(vc_obj.street) %]",
|
|
9 |
shiptozipcode: "[% JavaScript.escape(vc_obj.zipcode) %]",
|
|
10 |
shiptocity: "[% JavaScript.escape(vc_obj.city) %]",
|
|
11 |
shiptocountry: "[% JavaScript.escape(vc_obj.country) %]",
|
|
12 |
shiptocontact: "[% JavaScript.escape(vc_obj.contact) %]",
|
|
13 |
shiptocp_gender: "[% JavaScript.escape(vc_obj.cp_gender) %]",
|
|
14 |
shiptophone: "[% JavaScript.escape(vc_obj.phone) %]",
|
|
15 |
shiptofax: "[% JavaScript.escape(vc_obj.fax) %]",
|
|
16 |
shiptoemail: "[% JavaScript.escape(vc_obj.email) %]"
|
|
17 |
}
|
|
18 |
|
|
19 |
[% FOREACH shipto = vc_obj.shipto %]
|
|
20 |
,
|
|
21 |
{ shiptoname: "[% JavaScript.escape(shipto.shiptoname) %]",
|
|
22 |
shiptodepartment_1: "[% JavaScript.escape(shipto.shiptodepartment_1) %]",
|
|
23 |
shiptodepartment_2: "[% JavaScript.escape(shipto.shiptodepartment_2) %]",
|
|
24 |
shiptostreet: "[% JavaScript.escape(shipto.shiptostreet) %]",
|
|
25 |
shiptozipcode: "[% JavaScript.escape(shipto.shiptozipcode) %]",
|
|
26 |
shiptocity: "[% JavaScript.escape(shipto.shiptocity) %]",
|
|
27 |
shiptocountry: "[% JavaScript.escape(shipto.shiptocountry) %]",
|
|
28 |
shiptocontact: "[% JavaScript.escape(shipto.shiptocontact) %]",
|
|
29 |
shiptocp_gender: "[% JavaScript.escape(shipto.shiptocp_gender) %]",
|
|
30 |
shiptophone: "[% JavaScript.escape(shipto.shiptophone) %]",
|
|
31 |
shiptofax: "[% JavaScript.escape(shipto.shiptofax) %]",
|
|
32 |
shiptoemail: "[% JavaScript.escape(shipto.shiptoemail) %]"
|
|
33 |
}
|
|
34 |
[% END %]
|
|
35 |
];
|
|
36 |
|
|
37 |
function copy_address() {
|
|
38 |
var shipto = addresses[ $('#shipto_to_copy').val() ];
|
|
39 |
for (key in shipto)
|
|
40 |
$('#' + key).val(shipto[key]);
|
|
41 |
}
|
|
42 |
|
|
43 |
function clear_fields() {
|
|
44 |
var shipto = addresses[0];
|
|
45 |
for (key in shipto)
|
|
46 |
$('#' + key).val('');
|
|
47 |
$('#shiptocp_gender').val('m');
|
|
48 |
}
|
|
49 |
|
|
50 |
function clear_shipto_id_before_submit() {
|
|
51 |
var shipto = addresses[0];
|
|
52 |
for (key in shipto)
|
|
53 |
if ((key != 'shiptocp_gender') && ($('#' + key).val() != '')) {
|
|
54 |
$('#shipto_id').val('');
|
|
55 |
break;
|
|
56 |
}
|
|
57 |
|
|
58 |
$('form').submit();
|
|
59 |
}
|
|
60 |
</script>
|
|
61 |
|
|
62 |
[% select_options = [ [ 0, LxERP.t8("Billing Address") ] ] ;
|
|
63 |
FOREACH shipto = vc_obj.shipto ;
|
|
64 |
city = shipto.shiptozipcode _ ' ' _ shipto.shiptocity ;
|
|
65 |
title = [ shipto.shiptoname, shipto.shiptostreet, city ] ;
|
|
66 |
CALL select_options.import([ [ loop.count, title.grep('\S').join("; ") ] ]) ;
|
|
67 |
END ;
|
|
68 |
'' %]
|
2 |
69 |
|
3 |
70 |
<form method="post" action="[% HTML.escape(script) %]">
|
|
71 |
[% L.hidden_tag("shipto_id", shipto_id) %]
|
|
72 |
|
|
73 |
<p>
|
|
74 |
[% LxERP.t8("Copy address from master data") %]:
|
|
75 |
[% L.select_tag("", select_options, id="shipto_to_copy", style="width: 400px") %]
|
|
76 |
[% L.button_tag("copy_address()", LxERP.t8("Copy")) %]
|
|
77 |
[% L.button_tag("clear_fields()", LxERP.t8("Clear fields")) %]
|
|
78 |
</p>
|
4 |
79 |
|
5 |
80 |
<table>
|
6 |
81 |
<tr class="listheading">
|
... | ... | |
82 |
157 |
[% L.hidden_tag("nextsub", nextsub) %]
|
83 |
158 |
[% L.hidden_tag("previousform", previousform) %]
|
84 |
159 |
|
85 |
|
[% L.submit_tag("__dummy", LxERP.t8("Continue")) %]
|
|
160 |
[% L.button_tag("clear_shipto_id_before_submit()", LxERP.t8("Continue")) %]
|
86 |
161 |
</form>
|
Lieferadresse eingeben: Möglichkeit zum Kopieren aus Stammdaten
Im Dialog für die Eingabe einer individuellen Lieferanschrift gibt es
nun die Möglichkeit, die Felder aus den Stammdaten des
Kunden/Lieferanten vorzubelegen. Dabei werden sowohl die
Rechnungsadresse als auch alle Lieferadressen angeboten.
Ist beim Abschicken in mindestens einem Feld etwas eingetragen, so wird
eine eventuell vorher ausgewählte shipto_id abgewählt, ansonsten
beibehalten.
Was momentan noch nicht angeboten wird, ist die Firmenadresse aus den
Mandantendaten, weil hier das Adressfeld leider nicht nach Straße,
Postleitzahl, Ort aufgeteilt ist. Ansonsten wäre das für Einkaufsbelege
sinnvoll.