c49aef7438ff5d3820a31e255cc0fee2c0c030ad
[kivitendo-erp.git] / templates / webpages / common / _ship_to_dialog.html
1 [% USE HTML %][% USE L %][% USE LxERP %][%- USE JavaScript -%]
2
3 <script type="text/javascript">
4   $(function() {
5     kivi.SalesPurchase.shipto_addresses = [
6       { shiptoname:         "[% JavaScript.escape(vc_obj.name) %]",
7         shiptodepartment_1: "[% JavaScript.escape(vc_obj.department_1) %]",
8         shiptodepartment_2: "[% JavaScript.escape(vc_obj.department_2) %]",
9         shiptostreet:       "[% JavaScript.escape(vc_obj.street) %]",
10         shiptozipcode:      "[% JavaScript.escape(vc_obj.zipcode) %]",
11         shiptocity:         "[% JavaScript.escape(vc_obj.city) %]",
12         shiptocountry:      "[% JavaScript.escape(vc_obj.country) %]",
13         shiptogln:          "[% JavaScript.escape(vc_obj.gln) %]",
14         shiptocontact:      "[% JavaScript.escape(vc_obj.contact) %]",
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) %]": ""
20       [% END %]
21       }
22
23     [% FOREACH shipto = vc_obj.shipto %]
24       ,
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         shiptophone:        "[% JavaScript.escape(shipto.shiptophone) %]",
35         shiptofax:          "[% JavaScript.escape(shipto.shiptofax) %]",
36         shiptoemail:        "[% JavaScript.escape(shipto.shiptoemail) %]"
37       [% FOREACH var = shipto.cvars_by_config %]
38         , "shiptocvar_[% JavaScript.escape(var.config.name) %]": "[% JavaScript.escape(var.value_as_text) %]"
39       [% END %]
40       }
41     [% END %]
42     ];
43   });
44 </script>
45
46 [% select_options = [ [ 0, LxERP.t8("Billing Address") ] ] ;
47    FOREACH shipto = vc_obj.shipto ;
48      tmpcity  = shipto.shiptozipcode _ ' ' _ shipto.shiptocity ;
49      tmptitle = [ shipto.shiptoname, shipto.shiptostreet, tmpcity ] ;
50      CALL select_options.import([ [ loop.count, tmptitle.grep('\S').join("; ") ] ]) ;
51    END ;
52    '' %]
53
54 <p>
55  [% LxERP.t8("Copy address from master data") %]:
56  [% L.select_tag("", select_options, id="shipto_to_copy", style="width: 300px") %]
57  [% L.button_tag("kivi.SalesPurchase.copy_shipto_address()", LxERP.t8("Copy")) %]
58 </p>
59
60 <table>
61  <tr class="listheading">
62   <th></th>
63   <th>[% LxERP.t8('Billing Address') %]</th>
64   <th>[% LxERP.t8('Shipping Address') %]</th>
65  </tr>
66  <tr height="5"></tr>
67  <tr>
68   <th align="right" nowrap>[%- IF vc == "customer" %][%- LxERP.t8('Customer Number') %][%- ELSE %][%- LxERP.t8('Vendor Number') %][%- END %]</th>
69   <td>[%- IF vc == "customer" %][%- HTML.escape(vc_obj.customernumber) %][%- ELSE %][%- HTML.escape(vc_obj.vendornumber) %][%- END %]</td>
70  </tr>
71  <tr>
72   <th align="right" nowrap>[% LxERP.t8('Company Name') %]</th>
73   <td>[% HTML.escape(vc_obj.name) %]</td>
74   <td>[% L.input_tag("shiptoname", shiptoname, "size", "35") %]</td>
75  </tr>
76  <tr>
77   <th align="right" nowrap>[% LxERP.t8('Department') %]</th>
78   <td>[% HTML.escape(vc_obj.department_1) %]</td>
79   <td>[% L.input_tag("shiptodepartment_1", shiptodepartment_1, "size", "35") %]</td>
80  </tr>
81  <tr>
82   <th align="right" nowrap>&nbsp;</th>
83   <td>[% HTML.escape(vc_obj.department_2) %]</td>
84   <td>[% L.input_tag("shiptodepartment_2", shiptodepartment_2, "size", "35") %]</td>
85  </tr>
86  <tr>
87   <th align="right" nowrap>[% LxERP.t8('Street') %]</th>
88   <td>[% HTML.escape(vc_obj.street) %]</td>
89   <td>[% L.input_tag("shiptostreet", shiptostreet, "size", "35") %]</td>
90  </tr>
91  <tr>
92   <th align="right" nowrap>[% LxERP.t8('Zipcode') %]</th>
93   <td>[% HTML.escape(vc_obj.zipcode) %]</td>
94   <td>[% L.input_tag("shiptozipcode", shiptozipcode, "size", "35") %]</td>
95  </tr>
96  <tr>
97   <th align="right" nowrap>[% LxERP.t8('City') %]</th>
98   <td>[% HTML.escape(vc_obj.city) %]</td>
99   <td>[% L.input_tag("shiptocity", shiptocity, "size", "35") %]</td>
100  </tr>
101  <tr>
102   <th align="right" nowrap>[% LxERP.t8('Country') %]</th>
103   <td>[% HTML.escape(vc_obj.country) %]</td>
104   <td>[% L.input_tag("shiptocountry", shiptocountry, "size", "35") %]</td>
105  </tr>
106  <tr>
107   <th align="right" nowrap>[% LxERP.t8('GLN') %]</th>
108   <td>[% HTML.escape(vc_obj.gln) %]</td>
109   <td>[% L.input_tag("shiptogln", shiptogln, "size", "35") %]</td>
110  </tr>
111  <tr>
112   <th align="right" nowrap>[% LxERP.t8('Contact') %]</th>
113   <td>[% HTML.escape(vc_obj.contact) %]</td>
114   <td>[% L.input_tag("shiptocontact", shiptocontact, "size", "35") %]</td>
115  </tr>
116  <tr>
117   <th align="right" nowrap>[% LxERP.t8('Gender') %]</th>
118   <td></td>
119   <td>
120    [% L.select_tag('shiptocp_gender', [ [ 'm', LxERP.t8('male') ], [ 'f', LxERP.t8('female') ] ], 'default' = shiptocp_gender) %]
121   </td>
122  </tr>
123  <tr>
124   <th align="right" nowrap>[% LxERP.t8('Phone') %]</th>
125   <td>[% HTML.escape(vc_obj.phone) %]</td>
126   <td>[% L.input_tag("shiptophone", shiptophone, "size", "35") %]</td>
127  </tr>
128  <tr>
129   <th align="right" nowrap>[% LxERP.t8('Fax') %]</th>
130   <td>[% HTML.escape(vc_obj.fax) %]</td>
131   <td>[% L.input_tag("shiptofax", shiptofax, "size", "35") %]</td>
132  </tr>
133  <tr>
134   <th align="right" nowrap>[% LxERP.t8('E-mail') %]</th>
135   <td>[% HTML.escape(vc_obj.email) %]</td>
136   <td>[% L.input_tag("shiptoemail", shiptoemail, "size", "35") %]</td>
137  </tr>
138 [% FOREACH var = cvars %]
139  <tr valign="top">
140   <th align="right" nowrap>[% HTML.escape(var.config.description) %]</th>
141   <td></td>
142   <td>[% INCLUDE 'common/render_cvar_input.html' cvar_name_prefix='shiptocvar_' %]</td>
143  </tr>
144 [% END %]
145 </table>
146
147 <p>
148  [% L.button_tag("kivi.SalesPurchase.submit_custom_shipto()", LxERP.t8("Apply")) %]
149  [% L.button_tag("kivi.SalesPurchase.reset_shipto_fields()", LxERP.t8("Reset")) %]
150  [% L.button_tag("kivi.SalesPurchase.clear_shipto_fields()", LxERP.t8("Clear fields")) %]
151  [% L.button_tag("\$('#shipto_dialog').dialog('close');", LxERP.t8("Abort")) %]
152 </p>