1 [% USE HTML %][% USE L %][% USE LxERP %][%- USE JavaScript -%]
3 <script type="text/javascript">
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 shiptogln: "[% JavaScript.escape(vc_obj.gln) %]",
13 shiptocontact: "[% JavaScript.escape(vc_obj.contact) %]",
14 shiptocp_gender: "[% JavaScript.escape(vc_obj.cp_gender) %]",
15 shiptophone: "[% JavaScript.escape(vc_obj.phone) %]",
16 shiptofax: "[% JavaScript.escape(vc_obj.fax) %]",
17 shiptoemail: "[% JavaScript.escape(vc_obj.email) %]"
18 [% FOREACH var = cvars %]
19 , "shiptocvar_[% JavaScript.escape(var.config.name) %]": ""
23 [% FOREACH shipto = vc_obj.shipto %]
25 { shiptoname: "[% JavaScript.escape(shipto.shiptoname) %]",
26 shiptodepartment_1: "[% JavaScript.escape(shipto.shiptodepartment_1) %]",
27 shiptodepartment_2: "[% JavaScript.escape(shipto.shiptodepartment_2) %]",
28 shiptostreet: "[% JavaScript.escape(shipto.shiptostreet) %]",
29 shiptozipcode: "[% JavaScript.escape(shipto.shiptozipcode) %]",
30 shiptocity: "[% JavaScript.escape(shipto.shiptocity) %]",
31 shiptocountry: "[% JavaScript.escape(shipto.shiptocountry) %]",
32 shiptogln: "[% JavaScript.escape(shipto.shiptogln) %]",
33 shiptocontact: "[% JavaScript.escape(shipto.shiptocontact) %]",
34 shiptocp_gender: "[% JavaScript.escape(shipto.shiptocp_gender) %]",
35 shiptophone: "[% JavaScript.escape(shipto.shiptophone) %]",
36 shiptofax: "[% JavaScript.escape(shipto.shiptofax) %]",
37 shiptoemail: "[% JavaScript.escape(shipto.shiptoemail) %]"
38 [% FOREACH var = shipto.cvars_by_config %]
39 , "shiptocvar_[% JavaScript.escape(var.config.name) %]": "[% JavaScript.escape(var.value_as_text) %]"
45 function copy_address() {
46 var shipto = addresses[ $('#shipto_to_copy').val() ];
48 $('#' + key).val(shipto[key]);
51 function clear_fields() {
52 var shipto = addresses[0];
55 $('#shiptocp_gender').val('m');
58 function clear_shipto_id_before_submit() {
59 var shipto = addresses[0];
61 if ((key != 'shiptocp_gender') && ($('#' + key).val() != '')) {
62 $('#shipto_id').val('');
70 [% select_options = [ [ 0, LxERP.t8("Billing Address") ] ] ;
71 FOREACH shipto = vc_obj.shipto ;
72 tmpcity = shipto.shiptozipcode _ ' ' _ shipto.shiptocity ;
73 tmptitle = [ shipto.shiptoname, shipto.shiptostreet, tmpcity ] ;
74 CALL select_options.import([ [ loop.count, tmptitle.grep('\S').join("; ") ] ]) ;
78 <form method="post" action="[% HTML.escape(script) %]">
79 [% L.hidden_tag("shipto_id", shipto_id) %]
82 [% LxERP.t8("Copy address from master data") %]:
83 [% L.select_tag("", select_options, id="shipto_to_copy", style="width: 400px") %]
84 [% L.button_tag("copy_address()", LxERP.t8("Copy")) %]
85 [% L.button_tag("clear_fields()", LxERP.t8("Clear fields")) %]
89 <tr class="listheading">
90 <th colspan="2" width="50%">[% LxERP.t8('Billing Address') %]</th>
91 <th width="50%">[% LxERP.t8('Shipping Address') %]</th>
95 <th align="right" nowrap>[%- IF vc == "customer" %][%- LxERP.t8('Customer Number') %][%- ELSE %][%- LxERP.t8('Vendor Number') %][%- END %]</th>
96 <td>[%- IF vc == "customer" %][%- HTML.escape(customernumber) %][%- ELSE %][%- HTML.escape(vendornumber) %][%- END %]</td>
99 <th align="right" nowrap>[% LxERP.t8('Company Name') %]</th>
100 <td>[% HTML.escape(name) %]</td>
101 <td>[% L.input_tag("shiptoname", shiptoname, "size", "35") %]</td>
104 <th align="right" nowrap>[% LxERP.t8('Department') %]</th>
105 <td>[% HTML.escape(department_1) %]</td>
106 <td>[% L.input_tag("shiptodepartment_1", shiptodepartment_1, "size", "35") %]</td>
109 <th align="right" nowrap> </th>
110 <td>[% HTML.escape(department_2) %]</td>
111 <td>[% L.input_tag("shiptodepartment_2", shiptodepartment_2, "size", "35") %]</td>
114 <th align="right" nowrap>[% LxERP.t8('Street') %]</th>
115 <td>[% HTML.escape(street) %]</td>
116 <td>[% L.input_tag("shiptostreet", shiptostreet, "size", "35") %]</td>
119 <th align="right" nowrap>[% LxERP.t8('Zipcode') %]</th>
120 <td>[% HTML.escape(zipcode) %]</td>
121 <td>[% L.input_tag("shiptozipcode", shiptozipcode, "size", "35") %]</td>
124 <th align="right" nowrap>[% LxERP.t8('City') %]</th>
125 <td>[% HTML.escape(city) %]</td>
126 <td>[% L.input_tag("shiptocity", shiptocity, "size", "35") %]</td>
129 <th align="right" nowrap>[% LxERP.t8('Country') %]</th>
130 <td>[% HTML.escape(country) %]</td>
131 <td>[% L.input_tag("shiptocountry", shiptocountry, "size", "35") %]</td>
134 <th align="right" nowrap>[% LxERP.t8('GLN') %]</th>
135 <td>[% HTML.escape(gln) %]</td>
136 <td>[% L.input_tag("shiptogln", shiptogln, "size", "35") %]</td>
139 <th align="right" nowrap>[% LxERP.t8('Contact') %]</th>
140 <td>[% HTML.escape(contact) %]</td>
141 <td>[% L.input_tag("shiptocontact", shiptocontact, "size", "35") %]</td>
144 <th align="right" nowrap>[% LxERP.t8('Gender') %]</th>
147 [% L.select_tag('shiptocp_gender', [ [ 'm', LxERP.t8('male') ], [ 'f', LxERP.t8('female') ] ], 'default' = shiptocp_gender) %]
151 <th align="right" nowrap>[% LxERP.t8('Phone') %]</th>
152 <td>[% HTML.escape(phone) %]</td>
153 <td>[% L.input_tag("shiptophone", shiptophone, "size", "35") %]</td>
156 <th align="right" nowrap>[% LxERP.t8('Fax') %]</th>
157 <td>[% HTML.escape(fax) %]</td>
158 <td>[% L.input_tag("shiptofax", shiptofax, "size", "35") %]</td>
161 <th align="right" nowrap>[% LxERP.t8('E-mail') %]</th>
162 <td>[% HTML.escape(email) %]</td>
163 <td>[% L.input_tag("shiptoemail", shiptoemail, "size", "35") %]</td>
165 [% FOREACH var = cvars %]
167 <th align="right" nowrap>[% HTML.escape(var.config.description) %]</th>
169 <td>[% INCLUDE 'common/render_cvar_input.html' cvar_name_prefix='shiptocvar_' %]</td>
174 <hr size="3" noshade>
176 [% L.hidden_tag("action", "ship_to_entered") %]
177 [% L.hidden_tag("nextsub", nextsub) %]
178 [% L.hidden_tag("previousform", previousform) %]
180 [% L.button_tag("clear_shipto_id_before_submit()", LxERP.t8("Continue")) %]