6 <script type="text/javascript">
8 kivi.SalesPurchase.shipto_addresses = [
9 { shiptoname: "[% JavaScript.escape(vc_obj.name) %]",
10 shiptodepartment_1: "[% JavaScript.escape(vc_obj.department_1) %]",
11 shiptodepartment_2: "[% JavaScript.escape(vc_obj.department_2) %]",
12 shiptostreet: "[% JavaScript.escape(vc_obj.street) %]",
13 shiptozipcode: "[% JavaScript.escape(vc_obj.zipcode) %]",
14 shiptocity: "[% JavaScript.escape(vc_obj.city) %]",
15 shiptocountry: "[% JavaScript.escape(vc_obj.country) %]",
16 shiptogln: "[% JavaScript.escape(vc_obj.gln) %]",
17 shiptocontact: "[% JavaScript.escape(vc_obj.contact) %]",
18 shiptophone: "[% JavaScript.escape(vc_obj.phone) %]",
19 shiptofax: "[% JavaScript.escape(vc_obj.fax) %]",
20 shiptoemail: "[% JavaScript.escape(vc_obj.email) %]"
21 [% FOREACH var = cvars %]
22 , "shiptocvar_[% JavaScript.escape(var.config.name) %]": ""
26 [% FOREACH shipto = vc_obj.shipto %]
28 { shiptoname: "[% JavaScript.escape(shipto.shiptoname) %]",
29 shiptodepartment_1: "[% JavaScript.escape(shipto.shiptodepartment_1) %]",
30 shiptodepartment_2: "[% JavaScript.escape(shipto.shiptodepartment_2) %]",
31 shiptostreet: "[% JavaScript.escape(shipto.shiptostreet) %]",
32 shiptozipcode: "[% JavaScript.escape(shipto.shiptozipcode) %]",
33 shiptocity: "[% JavaScript.escape(shipto.shiptocity) %]",
34 shiptocountry: "[% JavaScript.escape(shipto.shiptocountry) %]",
35 shiptogln: "[% JavaScript.escape(shipto.shiptogln) %]",
36 shiptocontact: "[% JavaScript.escape(shipto.shiptocontact) %]",
37 shiptophone: "[% JavaScript.escape(shipto.shiptophone) %]",
38 shiptofax: "[% JavaScript.escape(shipto.shiptofax) %]",
39 shiptoemail: "[% JavaScript.escape(shipto.shiptoemail) %]"
40 [% FOREACH var = shipto.cvars_by_config %]
41 , "shiptocvar_[% JavaScript.escape(var.config.name) %]": "[% JavaScript.escape(var.value_as_text) %]"
49 [% select_options = [ [ 0, LxERP.t8("Billing Address") ] ] ;
50 FOREACH shipto = vc_obj.shipto ;
51 tmpcity = shipto.shiptozipcode _ ' ' _ shipto.shiptocity ;
52 tmptitle = [ shipto.shiptoname, shipto.shiptostreet, tmpcity ] ;
53 CALL select_options.import([ [ loop.count, tmptitle.grep('\S').join("; ") ] ]) ;
58 <div class="select-item control-panel">
59 [% LxERP.t8("Copy address from master data") %]:
60 [% L.select_tag("", select_options, id="shipto_to_copy", class="wi-normal") %]
61 [% L.button_tag("kivi.SalesPurchase.copy_shipto_address()", LxERP.t8("Copy"), type="button", class="button neutral") %]
65 fields = ['shiptoname', 'shiptodepartment_1', 'shiptodepartment_2',
66 'shiptostreet', 'shiptozipcode', 'shiptocity', 'shiptocountry',
67 'shiptogln', 'shiptocontact', 'shiptocp_gender', 'shiptophone',
68 'shiptofax', 'shiptoemail'] ;
69 FOREACH field = fields ;
70 $field = cs_obj.$field ;
76 <table class="tbl-horizontal checkered wi-moderate">
80 <th>[% LxERP.t8('Billing Address') %]</th>
81 <th>[% LxERP.t8('Shipping Address') %]</th>
86 <th>[% IF vc == "customer" %][% LxERP.t8('Customer Number') %][% ELSE %][% LxERP.t8('Vendor Number') %][% END %]</th>
87 <td>[% IF vc == "customer" %][% HTML.escape(vc_obj.customernumber) %][% ELSE %][% HTML.escape(vc_obj.vendornumber) %][% END %]</td>
91 <th>[% LxERP.t8('Company Name') %]</th>
92 <td>[% HTML.escape(vc_obj.name) %]</td>
93 <td>[% L.input_tag("shiptoname", shiptoname, "size", "35", class="wi-normal") %]</td>
96 <th>[% LxERP.t8('Department') %]</th>
97 <td>[% HTML.escape(vc_obj.department_1) %]</td>
98 <td>[% L.input_tag("shiptodepartment_1", shiptodepartment_1, "size", "35") %]</td>
101 <th>[% LxERP.t8('Department') %] 2</th>
102 <td>[% HTML.escape(vc_obj.department_2) %]</td>
103 <td>[% L.input_tag("shiptodepartment_2", shiptodepartment_2, "size", "35") %]</td>
106 <th>[% LxERP.t8('Street') %]</th>
107 <td>[% HTML.escape(vc_obj.street) %]</td>
108 <td>[% L.input_tag("shiptostreet", shiptostreet, "size", "35") %]</td>
111 <th>[% LxERP.t8('Zipcode') %]</th>
112 <td>[% HTML.escape(vc_obj.zipcode) %]</td>
113 <td>[% L.input_tag("shiptozipcode", shiptozipcode, "size", "35") %]</td>
116 <th>[% LxERP.t8('City') %]</th>
117 <td>[% HTML.escape(vc_obj.city) %]</td>
118 <td>[% L.input_tag("shiptocity", shiptocity, "size", "35") %]</td>
121 <th>[% LxERP.t8('Country') %]</th>
122 <td>[% HTML.escape(vc_obj.country) %]</td>
123 <td>[% L.input_tag("shiptocountry", shiptocountry, "size", "35") %]</td>
126 <th>[% LxERP.t8('GLN') %]</th>
127 <td>[% HTML.escape(vc_obj.gln) %]</td>
128 <td>[% L.input_tag("shiptogln", shiptogln, "size", "35") %]</td>
131 <th>[% LxERP.t8('Contact') %]</th>
132 <td>[% HTML.escape(vc_obj.contact) %]</td>
133 <td>[% L.input_tag("shiptocontact", shiptocontact, "size", "35") %]</td>
136 <th>[% LxERP.t8('Gender') %]</th>
139 [% L.select_tag('shiptocp_gender', [ [ 'm', LxERP.t8('male') ], [ 'f', LxERP.t8('female') ] ], 'default' = shiptocp_gender) %]
143 <th>[% LxERP.t8('Phone') %]</th>
144 <td>[% HTML.escape(vc_obj.phone) %]</td>
145 <td>[% L.input_tag("shiptophone", shiptophone, "size", "35") %]</td>
148 <th>[% LxERP.t8('Fax') %]</th>
149 <td>[% HTML.escape(vc_obj.fax) %]</td>
150 <td>[% L.input_tag("shiptofax", shiptofax, "size", "35") %]</td>
153 <th>[% LxERP.t8('E-mail') %]</th>
154 <td>[% HTML.escape(vc_obj.email) %]</td>
155 <td>[% L.input_tag("shiptoemail", shiptoemail, "size", "35") %]</td>
157 [% FOREACH var = cvars %]
159 <th>[% HTML.escape(var.config.description) %]</th>
161 <td>[% INCLUDE 'common/render_cvar_input.html' cvar_name_prefix='shiptocvar_' %]</td>
167 <div class="buttons">
168 [% L.button_tag("kivi.SalesPurchase.submit_custom_shipto('" _ id_selector _ "')", LxERP.t8("Apply")) %]
169 [% L.button_tag("kivi.SalesPurchase.reset_shipto_fields()", LxERP.t8("Reset"), class="neutral") %]
170 [% L.button_tag("kivi.SalesPurchase.clear_shipto_fields()", LxERP.t8("Clear fields"), class="neutral") %]
171 [% L.button_tag("\$('#shipto_dialog').dialog('close');", LxERP.t8("Abort"), class="neutral") %]