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