]> wagnertech.de Git - mfinanz.git/blob - templates/design40_webpages/common/_ship_to_dialog.html
date error in mapping
[mfinanz.git] / templates / design40_webpages / common / _ship_to_dialog.html
1 [% USE HTML %]
2 [% USE L %]
3 [% USE LxERP %]
4 [% USE JavaScript %]
5
6 <script type="text/javascript">
7   $(function() {
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) %]": ""
23       [% END %]
24       }
25
26     [% FOREACH shipto = vc_obj.shipto %]
27       ,
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) %]"
42       [% END %]
43       }
44     [% END %]
45     ];
46   });
47 </script>
48
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("; ") ] ]) ;
54     END ;
55    ''
56 %]
57
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") %]
62 </div>
63
64 [% IF cs_obj ;
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 ;
71   END ;
72 END ;
73 '' %]
74
75
76 <table class="tbl-horizontal checkered wi-moderate">
77   <thead>
78     <tr>
79       <td></td>
80       <th>[% LxERP.t8('Billing Address') %]</th>
81       <th>[% LxERP.t8('Shipping Address') %]</th>
82     </tr>
83   </thead>
84    <tbody>
85    <tr>
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>
88     <td></td>
89    </tr>
90    <tr>
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>
94    </tr>
95    <tr>
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>
99    </tr>
100    <tr>
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>
104    </tr>
105    <tr>
106     <th>[% LxERP.t8('Street') %]</th>
107     <td>[% HTML.escape(vc_obj.street) %]</td>
108     <td>[% L.input_tag("shiptostreet", shiptostreet, "size", "35") %]</td>
109    </tr>
110    <tr>
111     <th>[% LxERP.t8('Zipcode') %]</th>
112     <td>[% HTML.escape(vc_obj.zipcode) %]</td>
113     <td>[% L.input_tag("shiptozipcode", shiptozipcode, "size", "35") %]</td>
114    </tr>
115    <tr>
116     <th>[% LxERP.t8('City') %]</th>
117     <td>[% HTML.escape(vc_obj.city) %]</td>
118     <td>[% L.input_tag("shiptocity", shiptocity, "size", "35") %]</td>
119    </tr>
120    <tr>
121     <th>[% LxERP.t8('Country') %]</th>
122     <td>[% HTML.escape(vc_obj.country) %]</td>
123     <td>[% L.input_tag("shiptocountry", shiptocountry, "size", "35") %]</td>
124    </tr>
125    <tr>
126     <th>[% LxERP.t8('GLN') %]</th>
127     <td>[% HTML.escape(vc_obj.gln) %]</td>
128     <td>[% L.input_tag("shiptogln", shiptogln, "size", "35") %]</td>
129    </tr>
130    <tr>
131     <th>[% LxERP.t8('Contact') %]</th>
132     <td>[% HTML.escape(vc_obj.contact) %]</td>
133     <td>[% L.input_tag("shiptocontact", shiptocontact, "size", "35") %]</td>
134    </tr>
135    <tr>
136     <th>[% LxERP.t8('Gender') %]</th>
137     <td></td>
138     <td>
139      [% L.select_tag('shiptocp_gender', [ [ 'm', LxERP.t8('male') ], [ 'f', LxERP.t8('female') ] ], 'default' = shiptocp_gender) %]
140     </td>
141    </tr>
142    <tr>
143     <th>[% LxERP.t8('Phone') %]</th>
144     <td>[% HTML.escape(vc_obj.phone) %]</td>
145     <td>[% L.input_tag("shiptophone", shiptophone, "size", "35") %]</td>
146    </tr>
147    <tr>
148     <th>[% LxERP.t8('Fax') %]</th>
149     <td>[% HTML.escape(vc_obj.fax) %]</td>
150     <td>[% L.input_tag("shiptofax", shiptofax, "size", "35") %]</td>
151    </tr>
152    <tr>
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>
156    </tr>
157   [% FOREACH var = cvars %]
158    <tr>
159     <th>[% HTML.escape(var.config.description) %]</th>
160     <td></td>
161     <td>[% INCLUDE 'common/render_cvar_input.html' cvar_name_prefix='shiptocvar_' %]</td>
162    </tr>
163   [% END %]
164   </tbody>
165 </table>
166
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") %]
172 </div>