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