GLN: Berücksichtigung in Belegmasken
[kivitendo-erp.git] / templates / webpages / io / ship_to.html
1 [% USE HTML %][% USE L %][% USE LxERP %][%- USE JavaScript -%]
2
3 <script type="text/javascript">
4   var addresses = [
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     }
19
20   [% FOREACH shipto = vc_obj.shipto %]
21     ,
22     { shiptoname:         "[% JavaScript.escape(shipto.shiptoname) %]",
23       shiptodepartment_1: "[% JavaScript.escape(shipto.shiptodepartment_1) %]",
24       shiptodepartment_2: "[% JavaScript.escape(shipto.shiptodepartment_2) %]",
25       shiptostreet:       "[% JavaScript.escape(shipto.shiptostreet) %]",
26       shiptozipcode:      "[% JavaScript.escape(shipto.shiptozipcode) %]",
27       shiptocity:         "[% JavaScript.escape(shipto.shiptocity) %]",
28       shiptocountry:      "[% JavaScript.escape(shipto.shiptocountry) %]",
29       shiptogln:          "[% JavaScript.escape(shipto.shiptogln) %]",
30       shiptocontact:      "[% JavaScript.escape(shipto.shiptocontact) %]",
31       shiptocp_gender:    "[% JavaScript.escape(shipto.shiptocp_gender) %]",
32       shiptophone:        "[% JavaScript.escape(shipto.shiptophone) %]",
33       shiptofax:          "[% JavaScript.escape(shipto.shiptofax) %]",
34       shiptoemail:        "[% JavaScript.escape(shipto.shiptoemail) %]"
35     }
36   [% END %]
37   ];
38
39   function copy_address() {
40     var shipto = addresses[ $('#shipto_to_copy').val() ];
41     for (key in shipto)
42       $('#' + key).val(shipto[key]);
43   }
44
45   function clear_fields() {
46     var shipto = addresses[0];
47     for (key in shipto)
48       $('#' + key).val('');
49     $('#shiptocp_gender').val('m');
50   }
51
52   function clear_shipto_id_before_submit() {
53     var shipto = addresses[0];
54     for (key in shipto)
55       if ((key != 'shiptocp_gender') && ($('#' + key).val() != '')) {
56         $('#shipto_id').val('');
57         break;
58       }
59
60     $('form').submit();
61   }
62 </script>
63
64 [% select_options = [ [ 0, LxERP.t8("Billing Address") ] ] ;
65    FOREACH shipto = vc_obj.shipto ;
66      city  = shipto.shiptozipcode _ ' ' _ shipto.shiptocity ;
67      title = [ shipto.shiptoname, shipto.shiptostreet, city ] ;
68      CALL select_options.import([ [ loop.count, title.grep('\S').join("; ") ] ]) ;
69    END ;
70    '' %]
71
72  <form method="post" action="[% HTML.escape(script) %]">
73   [% L.hidden_tag("shipto_id", shipto_id) %]
74
75   <p>
76    [% LxERP.t8("Copy address from master data") %]:
77    [% L.select_tag("", select_options, id="shipto_to_copy", style="width: 400px") %]
78    [% L.button_tag("copy_address()", LxERP.t8("Copy")) %]
79    [% L.button_tag("clear_fields()", LxERP.t8("Clear fields")) %]
80   </p>
81
82   <table>
83    <tr class="listheading">
84     <th colspan="2" width="50%">[% LxERP.t8('Billing Address') %]</th>
85     <th width="50%">[% LxERP.t8('Shipping Address') %]</th>
86    </tr>
87    <tr height="5"></tr>
88    <tr>
89     <th align="right" nowrap>[%- IF vc == "customer" %][%- LxERP.t8('Customer Number') %][%- ELSE %][%- LxERP.t8('Vendor Number') %][%- END %]</th>
90     <td>[%- IF vc == "customer" %][%- HTML.escape(customernumber) %][%- ELSE %][%- HTML.escape(vendornumber) %][%- END %]</td>
91    </tr>
92    <tr>
93     <th align="right" nowrap>[% LxERP.t8('Company Name') %]</th>
94     <td>[% HTML.escape(name) %]</td>
95     <td>[% L.input_tag("shiptoname", shiptoname, "size", "35") %]</td>
96    </tr>
97    <tr>
98     <th align="right" nowrap>[% LxERP.t8('Department') %]</th>
99     <td>[% HTML.escape(department_1) %]</td>
100     <td>[% L.input_tag("shiptodepartment_1", shiptodepartment_1, "size", "35") %]</td>
101    </tr>
102    <tr>
103     <th align="right" nowrap>&nbsp;</th>
104     <td>[% HTML.escape(department_2) %]</td>
105     <td>[% L.input_tag("shiptodepartment_2", shiptodepartment_2, "size", "35") %]</td>
106    </tr>
107    <tr>
108     <th align="right" nowrap>[% LxERP.t8('Street') %]</th>
109     <td>[% HTML.escape(street) %]</td>
110     <td>[% L.input_tag("shiptostreet", shiptostreet, "size", "35") %]</td>
111    </tr>
112    <tr>
113     <th align="right" nowrap>[% LxERP.t8('Zipcode') %]</th>
114     <td>[% HTML.escape(zipcode) %]</td>
115     <td>[% L.input_tag("shiptozipcode", shiptozipcode, "size", "35") %]</td>
116    </tr>
117    <tr>
118     <th align="right" nowrap>[% LxERP.t8('City') %]</th>
119     <td>[% HTML.escape(city) %]</td>
120     <td>[% L.input_tag("shiptocity", shiptocity, "size", "35") %]</td>
121    </tr>
122    <tr>
123     <th align="right" nowrap>[% LxERP.t8('Country') %]</th>
124     <td>[% HTML.escape(country) %]</td>
125     <td>[% L.input_tag("shiptocountry", shiptocountry, "size", "35") %]</td>
126    </tr>
127    <tr>
128     <th align="right" nowrap>[% LxERP.t8('GLN') %]</th>
129     <td>[% HTML.escape(gln) %]</td>
130     <td>[% L.input_tag("shiptogln", shiptogln, "size", "35") %]</td>
131    </tr>
132    <tr>
133     <th align="right" nowrap>[% LxERP.t8('Contact') %]</th>
134     <td>[% HTML.escape(contact) %]</td>
135     <td>[% L.input_tag("shiptocontact", shiptocontact, "size", "35") %]</td>
136    </tr>
137    <tr>
138     <th align="right" nowrap>[% LxERP.t8('Gender') %]</th>
139     <td></td>
140     <td>
141      [% L.select_tag('shiptocp_gender', [ [ 'm', LxERP.t8('male') ], [ 'f', LxERP.t8('female') ] ], 'default' = shiptocp_gender) %]
142     </td>
143    </tr>
144    <tr>
145     <th align="right" nowrap>[% LxERP.t8('Phone') %]</th>
146     <td>[% HTML.escape(phone) %]</td>
147     <td>[% L.input_tag("shiptophone", shiptophone, "size", "35") %]</td>
148    </tr>
149    <tr>
150     <th align="right" nowrap>[% LxERP.t8('Fax') %]</th>
151     <td>[% HTML.escape(fax) %]</td>
152     <td>[% L.input_tag("shiptofax", shiptofax, "size", "35") %]</td>
153    </tr>
154    <tr>
155     <th align="right" nowrap>[% LxERP.t8('E-mail') %]</th>
156     <td>[% HTML.escape(email) %]</td>
157     <td>[% L.input_tag("shiptoemail", shiptoemail, "size", "35") %]</td>
158    </tr>
159   </table>
160
161   <hr size="3" noshade>
162
163   [% L.hidden_tag("action", "ship_to_entered") %]
164   [% L.hidden_tag("nextsub", nextsub) %]
165   [% L.hidden_tag("previousform", previousform) %]
166
167   [% L.button_tag("clear_shipto_id_before_submit()", LxERP.t8("Continue")) %]
168  </form>