Merge branch 'master' of ssh://lx-office/~/lx-office-erp
[kivitendo-erp.git] / templates / webpages / do / form_header.html
1 [%- USE T8 %]
2 [% USE HTML %][% USE LxERP %]<body onload="on_load()">
3
4  <script type="text/javascript" src="js/show_form_details.js"></script>
5  <script type="text/javascript" src="js/show_history.js"></script>
6  <script type="text/javascript" src="js/show_vc_details.js"></script>
7  <script type="text/javascript" src="js/common.js"></script>
8  <script type="text/javascript" src="js/delivery_customer_selection.js"></script>
9  <script type="text/javascript" src="js/vendor_selection.js"></script>
10  <script type="text/javascript" src="js/calculate_qty.js"></script>
11  <script type="text/javascript" src="js/stock_in_out.js"></script>
12
13  <script type="text/javascript">
14   <!--
15       function on_load() {
16         [% IF onload %][% onload %];[% END %]
17         setupDateFormat('[% myconfig_dateformat %]', '[% 'Falsches Datumsformat!' | $T8 %]');
18         setupPoints('[% myconfig_numberformat %]', '[% 'wrongformat' | $T8 %]');
19
20         [%- UNLESS delivered %]
21         Calendar.setup({ inputField : "transdate", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "transdate_trigger" });
22         [%- END %]
23       }
24     -->
25  </script>
26
27  <style type="text/css">
28   .fixed_width {
29     width: 250px;
30   }
31  </style>
32
33  [%- IF vc == 'customer' %]
34  [%- SET vc = 'customer' %]
35  [%- SET the_vc_id = customer_id %]
36  [%- SET the_vc = customer %]
37  [%- SET the_oldvc = oldcustomer %]
38  [%- SET is_customer = '1' %]
39  [%- ELSE %]
40  [%- SET vc = 'vendor' %]
41  [%- SET the_vc_id = vendor_id %]
42  [%- SET the_vc = vendor %]
43  [%- SET the_oldvc = oldvendor %]
44  [%- SET is_customer = '0' %]
45  [%- END %]
46  [%- IF delivered %]
47  [%- SET RO = ' readonly' %]
48  [%- SET DISABLED = ' disabled' %]
49  [%- END %]
50
51  <div class="listtop">[% title %]</div>
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="curr" value="[% HTML.escape(curr) %]">
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="subject" value="[% HTML.escape(subject) %]">
94   <input type="hidden" name="taxincluded" value="[% HTML.escape(taxincluded) %]">
95   <input type="hidden" name="taxzone_id" value="[% HTML.escape(taxzone_id) %]">
96   <input type="hidden" name="terms" value="[% HTML.escape(terms) %]">
97   <input type="hidden" name="title" value="[% HTML.escape(title) %]">
98   <input type="hidden" name="type" value="[% HTML.escape(type) %]">
99   <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">
100
101   <p>
102    <table width="100%">
103     <tr valign="top">
104      <td>
105       <table width="100%">
106        <tr>
107         <input type="hidden" name="[% vc %]_id" value="[% HTML.escape(the_vc_id) %]">
108         <input type="hidden" name="old[% vc %]" value="[% HTML.escape(the_oldvc) %]">
109         <th align="right">[% IF is_customer %][% 'Customer' | $T8 %][% ELSE %][% 'Vendor' | $T8 %][% END %]</th>
110         <td>
111          [%- UNLESS !delivered && SHOW_VC_DROP_DOWN %]
112          <input type="text" value="[% HTML.escape(oldvcname) %]" name="[% HTML.escape(vc) %]"[% RO %]>
113          [%- ELSE %]
114          <select name="[% vc %]" class="fixed_width" onchange="document.do.update_button.click();"[% RO %]>
115           [%- FOREACH row = ALL_VC %]
116           <option value="[% HTML.escape(row.value) %]" [% IF the_oldvc == row.value %] selected[% END %]>[% HTML.escape(row.name) %]</option>
117           [%- END %]
118          </select>
119          <input type="hidden" name="select[% vc %]" value="1">
120          [%- END %]
121          <input type="button" value="[% 'Details (one letter abbreviation)' | $T8 %]" onclick="show_vc_details('[% vc %]')">
122         </td>
123
124         [%- IF ALL_CONTACTS.size %]
125         <tr>
126          <th align="right">[% 'Contact Person' | $T8 %]</th>
127          <td>
128           [%- IF delivered %]
129           <input type="hidden" name="cp_id" value="[% HTML.escape(cp_id) %]">
130           [%- IF cp_id == row.cp_id %]
131           [%- HTML.escape(row.cp_name) %][%- IF row.cp_abteilung %] ([% HTML.escape(row.cp_abteilung) %])[% END -%]
132           [%- END %]
133           [%- ELSE %]
134           <select name="cp_id" class="fixed_width" >
135            <option></option>
136            [%- FOREACH row = ALL_CONTACTS %]
137            <option value="[% HTML.escape(row.cp_id) %]"[% IF cp_id == row.cp_id %] selected[% END %]>
138             [%- HTML.escape(row.cp_name) %][%- IF row.cp_abteilung %] ([% HTML.escape(row.cp_abteilung) %])[% END -%]
139            </option>
140            [%- END %]
141           </select>
142           [%- END %]
143          </td>
144         </tr>
145         [%- END %]
146
147         [%- IF ALL_SHIPTO.size %]
148         <tr>
149          <th align="right">[% 'Shipping Address' | $T8 %]</th>
150          <td>
151           [%- IF delivered %]
152           <input type="hidden" name="shipto_id" value="[% HTML.escape(shipto_id) %]">
153           [%- FOREACH row = ALL_SHIPTO %]
154           [%- IF shipto_id == row.shipto_id %]
155           [%- HTML.escape(row.shiptoname) -%]
156           [%- IF row.shiptodepartment_1 %]; [% HTML.escape(row.shiptodepartment_1) -%][% END -%]
157           [%- IF row.shiptostreet %]; [% HTML.escape(row.shiptostreet) -%][% END -%]
158           [%- IF row.shiptocity %]; [% HTML.escape(row.shiptocity) -%][% END -%]
159           [%- END %]
160           [%- END %]
161
162           [%- ELSE %]
163           <select name="shipto_id" class="fixed_width" >
164            <option></option>
165            [%- FOREACH row = ALL_SHIPTO %]
166            <option value="[% HTML.escape(row.shipto_id) %]"[% IF shipto_id == row.shipto_id %] selected[% END %]>
167             [%- HTML.escape(row.shiptoname) -%]
168             [%- IF row.shiptodepartment_1 %]; [% HTML.escape(row.shiptodepartment_1) -%][% END -%]
169             [%- IF row.shiptostreet %]; [% HTML.escape(row.shiptostreet) -%][% END -%]
170             [%- IF row.shiptocity %]; [% HTML.escape(row.shiptocity) -%][% END -%]
171            </option>
172            [%- END %]
173           </select>
174           [%- END %]
175          </td>
176         </tr>
177         [%- END %]
178
179         [%- IF business %]
180         <tr>
181          <th align="right">[% IF is_customer %][% 'Customer type' | $T8 %][% ELSE %][% 'Vendor type' | $T8 %][% END %]</th>
182          <td>[% HTML.escape(business) %]</td>
183         </tr>
184         [%- END %]
185
186         [%- IF max_dunning_level %]
187         <tr>
188          <th align="right">[% 'Max. Dunning Level' | $T8 %]</th>
189          <td>
190           <b>[% HTML.escape(max_dunning_level) %]</b>; [% 'Dunning Amount' | $T8 %]:
191           <b>[% HTML.escape(LxERP.format_amount(dunning_amount, 2)) %]</b>
192          </td>
193         </tr>
194         [%- END %]
195        </tr>
196
197        [%- IF ALL_DEPARTMENTS.size %]
198        <tr>
199         <th align="right" nowrap>[% 'Department' | $T8 %]</th>
200         <td colspan="3">
201          [%- IF delivered %]
202          <input type="hidden" name="department" value="[% HTML.escape(department) %]">
203          [%- FOREACH row = ALL_DEPARTMENTS %]
204          [% IF department == row.value %][% HTML.escape(row.description) %]--[% HTML.escape(row.id) %][% END %]
205          [%- END %]
206          [%- ELSE %]
207          <select name="department" class="fixed_width">
208           <option></option>
209           [%- FOREACH row = ALL_DEPARTMENTS %]
210           <option[% IF department == row.value %] selected[% END %]>[% HTML.escape(row.description) %]--[% HTML.escape(row.id) %]</option>
211           [%- END %]
212          </select>
213          [%- END %]
214         </td>
215        </tr>
216        [%- END %]
217
218        <tr>
219         <th align="right">[% 'Shipping Point' | $T8 %]</th>
220         <td colspan="3"><input name="shippingpoint" size="35" value="[% HTML.escape(shippingpoint) %]"[% RO %]></td>
221        </tr>
222
223        <tr>
224         <th align="right">[% 'Ship via' | $T8 %]</th>
225         <td colspan="3"><input name="shipvia" size="35" value="[% HTML.escape(shipvia) %]"[% RO %]></td>
226        </tr>
227
228        <tr>
229         <th align="right">[% 'Transaction description' | $T8 %]</th>
230         <td colspan="3"><input name="transaction_description" size="35" value="[% HTML.escape(transaction_description) %]"[% RO %]></td>
231        </tr>
232
233       </table>
234      </td>
235
236      <td align="right">
237       <table>
238
239        <tr>
240         <td colspan="2" align="center">
241          [%- IF delivered %]
242           [%- IF is_customer %]
243           [% 'transferred out' | $T8 %]
244           [%- ELSE %]
245           [% 'transferred in' | $T8 %]
246           [%- END %]
247          [%- ELSE %]
248           [%- IF is_customer %]
249           [% 'not transferred out yet' | $T8 %]
250           [%- ELSE %]
251           [% 'not transferred in yet' | $T8 %]
252           [%- END %]
253          [%- END %]
254          ;
255          [%- IF closed %]
256           [% 'Closed' | $T8 %]
257          [%- ELSE %]
258           [% 'Open' | $T8 %]
259          [%- END %]
260         </td>
261        </tr>
262
263        <input type="hidden" name="delivered" value="[% HTML.escape(delivered) %]">
264
265        <tr>
266         <th align="right">[% 'Employee' | $T8 %]</th>
267         <td>
268          [%- IF delivered %]
269          <input type="hidden" name="employee_id" value="[% HTML.escape(employee_id) %]">
270          [%- FOREACH row = ALL_EMPLOYEES %]
271          [% IF row.id == employee_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
272          [%- END %]
273          [%- ELSE %]
274          <select name="employee_id">
275           [%- FOREACH row = ALL_EMPLOYEES %]
276           <option value="[% HTML.escape(row.id) %]"[% IF row.id == employee_id %] selected[% END %]>
277            [%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %]
278           </option>
279           [%- END %]
280          </select>
281          [%- END %]
282         </td>
283        </tr>
284
285        [%- IF is_customer %]
286        [%- IF salesman_id %]
287        [%- SET the_salesman_id = salesman_id %]
288        [%- ELSE %]
289        [%- SET the_salesman_id = employee_id %]
290        [%- END %]
291        <tr>
292         <th align="right">[% 'Salesman' | $T8 %]</th>
293         <td>
294          [%- IF delivered %]
295          <input type="hidden" name="salesman_id" value="[% HTML.escape(salesman_id) %]">
296          [%- FOREACH row = ALL_SALESMEN %]
297          [% IF row.id == the_salesman_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
298          [%- END %]
299          [%- ELSE %]
300          <select name="salesman_id">
301           [%- FOREACH row = ALL_SALESMEN %]
302           <option value="[% HTML.escape(row.id) %]"[% IF row.id == the_salesman_id %] selected[% END %]>
303            [%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %]
304           </option>
305           [%- END %]
306          </select>
307          [%- END %]
308         </td>
309        </tr>
310        [%- END %]
311
312        <tr>
313         <th width="70%" align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
314         <td><input name="donumber" size="11" value="[% HTML.escape(donumber) %]"[% RO %]></td>
315        </tr>
316
317        <tr>
318         <th width="70%" align="right" nowrap>[% 'Order Number' | $T8 %]</th>
319         <td><input name="ordnumber" size="11" value="[% HTML.escape(ordnumber) %]"[% RO %]></td>
320        </tr>
321
322        <tr>
323         <th width="70%" align="right" nowrap>[% IF is_customer %][% 'Customer Order Number' | $T8 %][% ELSE %][% 'Vendor Order Number' | $T8 %][% END %]</th>
324         <td><input name="cusordnumber" size="11" value="[% HTML.escape(cusordnumber) %]"[% RO %]></td>
325        </tr>
326
327        <tr>
328         <th align="right" nowrap>[% 'Delivery Order Date' | $T8 %]</th>
329         <td nowrap>
330          <input name="transdate" id="transdate" size="11" title="[% HTML.escape(myconfig_dateformat) %]" value="[% HTML.escape(transdate) %]"
331                 onBlur="check_right_date_format(this)"[% RO %]>
332          [% UNLESS delivered %]<input type="button" name="b_transdate" id="transdate_trigger" value="?">[% END %]
333         </td>
334        </tr>
335
336        <tr>
337         <th width="70%" align="right" nowrap>[% 'Project Number' | $T8 %]</th>
338         <td>
339          [%- IF delivered %]
340          <input type="hidden" name="globalproject_id" value="[% HTML.escape(globalproject_id) %]">
341          [%- FOREACH row = ALL_PROJECTS %]
342          [% IF globalproject_id == row.id %][% HTML.escape(row.projectnumber) %][% END %]
343          [%- END %]
344          [%- ELSE %]
345          <select name="globalproject_id">
346           <option></option>
347           [%- FOREACH row = ALL_PROJECTS %]
348           <option value="[% HTML.escape(row.id) %]"[% IF globalproject_id == row.id %] selected[% END %]>[% HTML.escape(row.projectnumber) %]</option>
349           [%- END %]
350          </select>
351          [%- END %]
352         </td>
353        </tr>
354       </table>
355      </td>
356     </tr>
357    </table>