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