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