SL::Template::Plugin::L::select_tag und SL::Template::Plugin::L::options_for_select...
[kivitendo-erp.git] / templates / webpages / do / form_header.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5 <body onload="on_load()">
6
7  <script type="text/javascript" src="js/show_form_details.js"></script>
8  <script type="text/javascript" src="js/show_history.js"></script>
9  <script type="text/javascript" src="js/show_vc_details.js"></script>
10  <script type="text/javascript" src="js/common.js"></script>
11  <script type="text/javascript" src="js/delivery_customer_selection.js"></script>
12  <script type="text/javascript" src="js/vendor_selection.js"></script>
13  <script type="text/javascript" src="js/calculate_qty.js"></script>
14  <script type="text/javascript" src="js/stock_in_out.js"></script>
15
16  <script type="text/javascript">
17   <!--
18       function on_load() {
19         [% IF onload %][% onload %];[% END %]
20         setupDateFormat('[% myconfig_dateformat %]', '[% 'Falsches Datumsformat!' | $T8 %]');
21         setupPoints('[% myconfig_numberformat %]', '[% 'wrongformat' | $T8 %]');
22       }
23     -->
24  </script>
25
26  <style type="text/css">
27   .fixed_width {
28     width: 250px;
29   }
30  </style>
31
32  [%- IF vc == 'customer' %]
33  [%- SET vc = 'customer' %]
34  [%- SET the_vc_id = customer_id %]
35  [%- SET the_vc = customer %]
36  [%- SET the_oldvc = oldcustomer %]
37  [%- SET is_customer = '1' %]
38  [%- ELSE %]
39  [%- SET vc = 'vendor' %]
40  [%- SET the_vc_id = vendor_id %]
41  [%- SET the_vc = vendor %]
42  [%- SET the_oldvc = oldvendor %]
43  [%- SET is_customer = '0' %]
44  [%- END %]
45  [%- IF delivered %]
46  [%- SET DISABLED = ' disabled' %]
47  [%- END %]
48
49  <div class="listtop">[% title %]</div>
50
51 [%- INCLUDE 'common/flash.html' %]
52
53  [%- IF ERRORS && ERRORS.size %]
54  <p><font color="#ff0000">[% ERRORS.join('<br>') %]</font></p>
55  [%- END %]
56
57  <form method="post" name="do" action="do.pl">
58
59   <input type="hidden" name="action" value="[% HTML.escape(action) %]">
60   <input type="hidden" name="bcc" value="[% HTML.escape(bcc) %]">
61   <input type="hidden" name="business" value="[% HTML.escape(business) %]">
62   <input type="hidden" name="cc" value="[% HTML.escape(cc) %]">
63   <input type="hidden" name="closed" value="[% HTML.escape(closed) %]">
64   <input type="hidden" name="convert_from_oe_ids" value="[% HTML.escape(convert_from_oe_ids) %]">
65   <input type="hidden" name="currency" value="[% HTML.escape(currency) %]">
66   <input type="hidden" name="customer_klass" value="[% HTML.escape(customer_klass) %]">
67   <input type="hidden" name="discount" value="[% HTML.escape(discount) %]">
68   <input type="hidden" name="dunning_amount" value="[% HTML.escape(dunning_amount) %]">
69   <input type="hidden" name="email" value="[% HTML.escape(email) %]">
70   <input type="hidden" name="emailed" value="[% HTML.escape(emailed) %]">
71   <input type="hidden" name="format" value="[% HTML.escape(format) %]">
72   <input type="hidden" name="formname" value="[% HTML.escape(formname) %]">
73   <input type="hidden" name="id" value="[% HTML.escape(id) %]">
74   <input type="hidden" name="max_dunning_level" value="[% HTML.escape(max_dunning_level) %]">
75   <input type="hidden" name="media" value="[% HTML.escape(media) %]">
76   <input type="hidden" name="message" value="[% HTML.escape(message) %]">
77   <input type="hidden" name="printed" value="[% HTML.escape(printed) %]">
78   <input type="hidden" name="proforma" value="[% HTML.escape(proforma) %]">
79   <input type="hidden" name="queued" value="[% HTML.escape(queued) %]">
80   <input type="hidden" name="saved_donumber" value="[% HTML.escape(saved_donumber) %]">
81   <input type="hidden" name="shiptocity" value="[% HTML.escape(shiptocity) %]">
82   <input type="hidden" name="shiptocontact" value="[% HTML.escape(shiptocontact) %]">
83   <input type="hidden" name="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
84   <input type="hidden" name="shiptocountry" value="[% HTML.escape(shiptocountry) %]">
85   <input type="hidden" name="shiptodepartment_1" value="[% HTML.escape(shiptodepartment_1) %]">
86   <input type="hidden" name="shiptodepartment_2" value="[% HTML.escape(shiptodepartment_2) %]">
87   <input type="hidden" name="shiptoemail" value="[% HTML.escape(shiptoemail) %]">
88   <input type="hidden" name="shiptofax" value="[% HTML.escape(shiptofax) %]">
89   <input type="hidden" name="shiptoname" value="[% HTML.escape(shiptoname) %]">
90   <input type="hidden" name="shiptophone" value="[% HTML.escape(shiptophone) %]">
91   <input type="hidden" name="shiptostreet" value="[% HTML.escape(shiptostreet) %]">
92   <input type="hidden" name="shiptozipcode" value="[% HTML.escape(shiptozipcode) %]">
93   <input type="hidden" name="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
94   <input type="hidden" name="subject" value="[% HTML.escape(subject) %]">
95   <input type="hidden" name="taxincluded" value="[% HTML.escape(taxincluded) %]">
96   <input type="hidden" name="taxzone_id" value="[% HTML.escape(taxzone_id) %]">
97   <input type="hidden" name="terms" value="[% HTML.escape(terms) %]">
98   <input type="hidden" name="title" value="[% HTML.escape(title) %]">
99   <input type="hidden" name="type" value="[% HTML.escape(type) %]">
100   <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">
101
102   <p>
103    <table width="100%">
104     <tr valign="top">
105      <td>
106       <table width="100%">
107        <tr>
108         <input type="hidden" name="[% vc %]_id" value="[% HTML.escape(the_vc_id) %]">
109         <input type="hidden" name="old[% vc %]" value="[% HTML.escape(the_oldvc) %]">
110         <th align="right">[% IF is_customer %][% 'Customer' | $T8 %][% ELSE %][% 'Vendor' | $T8 %][% END %]</th>
111         <td>
112          [%- UNLESS !delivered && SHOW_VC_DROP_DOWN %]
113          <input type="text" value="[% HTML.escape(oldvcname) %]" name="[% HTML.escape(vc) %]"[% RO %]>
114          [%- ELSE %]
115          <select name="[% vc %]" class="fixed_width" onchange="document.do.update_button.click();"[% RO %]>
116           [%- FOREACH row = ALL_VC %]
117           <option value="[% HTML.escape(row.value) %]" [% IF the_oldvc == row.value %] selected[% END %]>[% HTML.escape(row.name) %]</option>
118           [%- END %]
119          </select>
120          <input type="hidden" name="select[% vc %]" value="1">
121          [%- END %]
122          <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% vc %]')">
123         </td>
124
125         [%- IF ALL_CONTACTS.size %]
126         <tr>
127          <th align="right">[% 'Contact Person' | $T8 %]</th>
128          <td>
129           [%- IF delivered %]
130           <input type="hidden" name="cp_id" value="[% HTML.escape(cp_id) %]">
131           [%- IF cp_id == row.cp_id %]
132           [%- HTML.escape(row.cp_name) %][%- IF row.cp_abteilung %] ([% HTML.escape(row.cp_abteilung) %])[% END -%]
133           [%- END %]
134           [%- ELSE %]
135             [% L.select_tag('cp_id', ALL_CONTACTS, default = cp_id, value = 'cp_id', title = 'full_name_dep', with_empty = 1, style='width: 250px') %]
136           [%- END %]
137          </td>
138         </tr>
139         [%- END %]
140
141         [%- IF ALL_SHIPTO.size %]
142         <tr>
143          <th align="right">[% 'Shipping Address' | $T8 %]</th>
144          <td>
145           [%- IF delivered %]
146           <input type="hidden" name="shipto_id" value="[% HTML.escape(shipto_id) %]">
147           [%- FOREACH row = ALL_SHIPTO %]
148           [%- IF shipto_id == row.shipto_id %]
149           [%- HTML.escape(row.shiptoname) -%]
150           [%- IF row.shiptodepartment_1 %]; [% HTML.escape(row.shiptodepartment_1) -%][% END -%]
151           [%- IF row.shiptostreet %]; [% HTML.escape(row.shiptostreet) -%][% END -%]
152           [%- IF row.shiptocity %]; [% HTML.escape(row.shiptocity) -%][% END -%]
153           [%- END %]
154           [%- END %]
155
156           [%- ELSE %]
157             [% L.select_tag('shipto_id', ALL_SHIPTO, default = shipto_id, value = 'shipto_id', title = 'displayable_id', with_empty = 1, class = 'fixed_width') %]
158           [%- END %]
159          </td>
160         </tr>
161         [%- END %]
162
163         [%- IF business %]
164         <tr>
165          <th align="right">[% IF is_customer %][% 'Customer type' | $T8 %][% ELSE %][% 'Vendor type' | $T8 %][% END %]</th>
166          <td>[% HTML.escape(business) %]</td>
167         </tr>
168         [%- END %]
169
170         [%- IF max_dunning_level %]
171         <tr>
172          <th align="right">[% 'Max. Dunning Level' | $T8 %]</th>
173          <td>
174           <b>[% HTML.escape(max_dunning_level) %]</b>; [% 'Dunning Amount' | $T8 %]:
175           <b>[% HTML.escape(LxERP.format_amount(dunning_amount, 2)) %]</b>
176          </td>
177         </tr>
178         [%- END %]
179        </tr>
180
181        [%- IF ALL_DEPARTMENTS.size %]
182        <tr>
183         <th align="right" nowrap>[% 'Department' | $T8 %]</th>
184         <td colspan="3">
185           [% IF ( delivered ) %]
186             [% L.hidden_tag('department_id', department_id) %]
187           [% END %]
188           [% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title = 'description', with_empty = 1, style = 'width: 250px', disabled = delivered )%]
189        </td>
190        </tr>
191        [%- END %]
192
193        <tr>
194         <th align="right">[% 'Shipping Point' | $T8 %]</th>
195         <td colspan="3"><input name="shippingpoint" size="35" value="[% HTML.escape(shippingpoint) %]"[% RO %]></td>
196        </tr>
197
198        <tr>
199         <th align="right">[% 'Ship via' | $T8 %]</th>
200         <td colspan="3"><input name="shipvia" size="35" value="[% HTML.escape(shipvia) %]"[% RO %]></td>
201        </tr>
202
203        <tr>
204         <th align="right">[% 'Transaction description' | $T8 %]</th>
205         <td colspan="3"><input name="transaction_description" size="35" value="[% HTML.escape(transaction_description) %]"[% RO %]></td>
206        </tr>
207
208       </table>
209      </td>
210
211      <td align="right">
212       <table>
213
214        <tr>
215         <td colspan="2" align="center">
216          [%- IF delivered %]
217           [%- IF is_customer %]
218           [% 'transferred out' | $T8 %]
219           [%- ELSE %]
220           [% 'transferred in' | $T8 %]
221           [%- END %]
222          [%- ELSE %]
223           [%- IF is_customer %]
224           [% 'not transferred out yet' | $T8 %]
225           [%- ELSE %]
226           [% 'not transferred in yet' | $T8 %]
227           [%- END %]
228          [%- END %]
229          ;
230          [%- IF closed %]
231           [% 'Closed' | $T8 %]
232          [%- ELSE %]
233           [% 'Open' | $T8 %]
234          [%- END %]
235         </td>
236        </tr>
237
238        <input type="hidden" name="delivered" value="[% HTML.escape(delivered) %]">
239
240        <tr>
241         <th align="right">[% 'Employee' | $T8 %]</th>
242         <td>
243          [%- IF delivered %]
244          <input type="hidden" name="employee_id" value="[% HTML.escape(employee_id) %]">
245          [%- FOREACH row = ALL_EMPLOYEES %]
246          [% IF row.id == employee_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
247          [%- END %]
248          [%- ELSE %]
249            [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title = 'safe_name') %]
250          [%- END %]
251         </td>
252        </tr>
253
254        [%- IF is_customer %]
255        [%- IF salesman_id %]
256        [%- SET the_salesman_id = salesman_id %]
257        [%- ELSE %]
258        [%- SET the_salesman_id = employee_id %]
259        [%- END %]
260        <tr>
261         <th align="right">[% 'Salesman' | $T8 %]</th>
262         <td>
263          [%- IF delivered %]
264          <input type="hidden" name="salesman_id" value="[% HTML.escape(salesman_id) %]">
265          [%- FOREACH row = ALL_SALESMEN %]
266          [% IF row.id == the_salesman_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
267          [%- END %]
268          [%- ELSE %]
269           [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title = 'safe_name') %]
270          [%- END %]
271         </td>
272        </tr>
273        [%- END %]
274
275        <tr>
276         <th width="70%" align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
277         <td><input name="donumber" size="11" value="[% HTML.escape(donumber) %]"[% RO %]></td>
278        </tr>
279
280        <tr>
281         <th width="70%" align="right" nowrap>[% 'Order Number' | $T8 %]</th>
282         <td><input name="ordnumber" size="11" value="[% HTML.escape(ordnumber) %]"[% RO %]></td>
283        </tr>
284
285        <tr>
286         <th width="70%" align="right" nowrap>[% IF is_customer %][% 'Customer Order Number' | $T8 %][% ELSE %][% 'Vendor Order Number' | $T8 %][% END %]</th>
287         <td><input name="cusordnumber" size="11" value="[% HTML.escape(cusordnumber) %]"[% RO %]></td>
288        </tr>
289
290        <tr>
291         <th align="right" nowrap>[% 'Delivery Order Date' | $T8 %]</th>
292         <td nowrap>
293          [% L.date_tag('transdate', transdate, readonly => delivered) %]
294         </td>
295        </tr>
296
297        <tr>
298         <th width="70%" align="right" nowrap>[% 'Project Number' | $T8 %]</th>
299         <td>
300          [%- IF delivered %]
301          <input type="hidden" name="globalproject_id" value="[% HTML.escape(globalproject_id) %]">
302          [%- FOREACH row = ALL_PROJECTS %]
303          [% IF globalproject_id == row.id %][% HTML.escape(row.projectnumber) %][% END %]
304          [%- END %]
305          [%- ELSE %]
306          <select name="globalproject_id">
307           <option></option>
308           [%- FOREACH row = ALL_PROJECTS %]
309           <option value="[% HTML.escape(row.id) %]"[% IF globalproject_id == row.id %] selected[% END %]>[% HTML.escape(row.projectnumber) %]</option>
310           [%- END %]
311          </select>
312          [%- END %]
313         </td>
314        </tr>
315       </table>
316      </td>
317     </tr>
318    </table>