5c513297770f892b20212e506db85bb45785514c
[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  <script type="text/javascript" src="js/follow_up.js"></script>
16
17  <script type="text/javascript">
18   <!--
19       function on_load() {
20         [% IF onload %][% onload %];[% END %]
21       }
22     -->
23  </script>
24
25  <style type="text/css">
26   .fixed_width {
27     width: 250px;
28   }
29  </style>
30
31  [%- IF vc == 'customer' %]
32  [%- SET vc = 'customer' %]
33  [%- SET the_vc_id = customer_id %]
34  [%- SET the_vc = customer %]
35  [%- SET the_oldvc = oldcustomer %]
36  [%- SET is_customer = '1' %]
37  [%- ELSE %]
38  [%- SET vc = 'vendor' %]
39  [%- SET the_vc_id = vendor_id %]
40  [%- SET the_vc = vendor %]
41  [%- SET the_oldvc = oldvendor %]
42  [%- SET is_customer = '0' %]
43  [%- END %]
44  [%- IF delivered %]
45  [%- SET DISABLED = ' disabled' %]
46  [%- END %]
47
48  <div class="listtop">[% title %]</div>
49
50 [%- INCLUDE 'common/flash.html' %]
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="follow_up_trans_id_1" value="[% HTML.escape(id) %]">
59   <input type="hidden" name="follow_up_trans_type_1" value="[% HTML.escape(type) %]">
60   <input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
61   <input type="hidden" name="follow_up_rowcount" value="1">
62
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             [% L.select_tag('cp_id', ALL_CONTACTS, default = cp_id, value_key = 'cp_id', title_key = 'full_name_dep', with_empty = 1, style='width: 250px') %]
141           [%- END %]
142          </td>
143         </tr>
144         [%- END %]
145
146         [%- IF ALL_SHIPTO.size %]
147         <tr>
148          <th align="right">[% 'Shipping Address' | $T8 %]</th>
149          <td>
150           [%- IF delivered %]
151           <input type="hidden" name="shipto_id" value="[% HTML.escape(shipto_id) %]">
152           [%- FOREACH row = ALL_SHIPTO %]
153           [%- IF shipto_id == row.shipto_id %]
154           [%- HTML.escape(row.shiptoname) -%]
155           [%- IF row.shiptodepartment_1 %]; [% HTML.escape(row.shiptodepartment_1) -%][% END -%]
156           [%- IF row.shiptostreet %]; [% HTML.escape(row.shiptostreet) -%][% END -%]
157           [%- IF row.shiptocity %]; [% HTML.escape(row.shiptocity) -%][% END -%]
158           [%- END %]
159           [%- END %]
160
161           [%- ELSE %]
162             [% L.select_tag('shipto_id', ALL_SHIPTO, default = shipto_id, value_key = 'shipto_id', title_key = 'displayable_id', with_empty = 1, class = 'fixed_width') %]
163           [%- END %]
164          </td>
165         </tr>
166         [%- END %]
167
168         [%- IF business %]
169         <tr>
170          <th align="right">[% IF is_customer %][% 'Customer type' | $T8 %][% ELSE %][% 'Vendor type' | $T8 %][% END %]</th>
171          <td>[% HTML.escape(business) %]</td>
172         </tr>
173         [%- END %]
174
175         [%- IF max_dunning_level %]
176         <tr>
177          <th align="right">[% 'Max. Dunning Level' | $T8 %]</th>
178          <td>
179           <b>[% HTML.escape(max_dunning_level) %]</b>; [% 'Dunning Amount' | $T8 %]:
180           <b>[% HTML.escape(LxERP.format_amount(dunning_amount, 2)) %]</b>
181          </td>
182         </tr>
183         [%- END %]
184        </tr>
185
186        [%- IF ALL_DEPARTMENTS.size %]
187        <tr>
188         <th align="right" nowrap>[% 'Department' | $T8 %]</th>
189         <td colspan="3">
190           [% IF ( delivered ) %]
191             [% L.hidden_tag('department_id', department_id) %]
192           [% END %]
193           [% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, style = 'width: 250px', disabled = delivered )%]
194        </td>
195        </tr>
196        [%- END %]
197
198        <tr>
199         <th align="right">[% 'Shipping Point' | $T8 %]</th>
200         <td colspan="3"><input name="shippingpoint" size="35" value="[% HTML.escape(shippingpoint) %]"[% RO %]></td>
201        </tr>
202
203        <tr>
204         <th align="right">[% 'Ship via' | $T8 %]</th>
205         <td colspan="3"><input name="shipvia" size="35" value="[% HTML.escape(shipvia) %]"[% RO %]></td>
206        </tr>
207
208        <tr>
209         <th align="right">[% 'Transaction description' | $T8 %]</th>
210         <td colspan="3"><input name="transaction_description" size="35" value="[% HTML.escape(transaction_description) %]"[% RO %]></td>
211        </tr>
212
213       </table>
214      </td>
215
216      <td align="right">
217       <table>
218
219        <tr>
220         <td colspan="2" align="center">
221          [%- IF delivered %]
222           [%- IF is_customer %]
223           [% 'transferred out' | $T8 %]
224           [%- ELSE %]
225           [% 'transferred in' | $T8 %]
226           [%- END %]
227          [%- ELSE %]
228           [%- IF is_customer %]
229           [% 'not transferred out yet' | $T8 %]
230           [%- ELSE %]
231           [% 'not transferred in yet' | $T8 %]
232           [%- END %]
233          [%- END %]
234          ;
235          [%- IF closed %]
236           [% 'Closed' | $T8 %]
237          [%- ELSE %]
238           [% 'Open' | $T8 %]
239          [%- END %]
240         </td>
241        </tr>
242
243        <input type="hidden" name="delivered" value="[% HTML.escape(delivered) %]">
244
245        <tr>
246         <th align="right">[% 'Employee' | $T8 %]</th>
247         <td>
248          [%- IF delivered %]
249          <input type="hidden" name="employee_id" value="[% HTML.escape(employee_id) %]">
250          [%- FOREACH row = ALL_EMPLOYEES %]
251          [% IF row.id == employee_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
252          [%- END %]
253          [%- ELSE %]
254            [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name') %]
255          [%- END %]
256         </td>
257        </tr>
258
259        [%- IF is_customer %]
260        [%- IF salesman_id %]
261        [%- SET the_salesman_id = salesman_id %]
262        [%- ELSE %]
263        [%- SET the_salesman_id = employee_id %]
264        [%- END %]
265        <tr>
266         <th align="right">[% 'Salesman' | $T8 %]</th>
267         <td>
268          [%- IF delivered %]
269          <input type="hidden" name="salesman_id" value="[% HTML.escape(salesman_id) %]">
270          [%- FOREACH row = ALL_SALESMEN %]
271          [% IF row.id == the_salesman_id %][%- IF row.name %][%- HTML.escape(row.name) %][%- ELSE %][% HTML.escape(row.login) %][%- END %][% END %]
272          [%- END %]
273          [%- ELSE %]
274           [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title_key = 'safe_name') %]
275          [%- END %]
276         </td>
277        </tr>
278        [%- END %]
279
280        <tr>
281         <th width="70%" align="right" nowrap>[% 'Delivery Order Number' | $T8 %]</th>
282         <td><input name="donumber" size="11" value="[% HTML.escape(donumber) %]"[% RO %]></td>
283        </tr>
284
285        <tr>
286         <th width="70%" align="right" nowrap>[% 'Order Number' | $T8 %]</th>
287         <td><input name="ordnumber" size="11" value="[% HTML.escape(ordnumber) %]"[% RO %]></td>
288        </tr>
289
290        <tr>
291         <th width="70%" align="right" nowrap>[% IF is_customer %][% 'Customer Order Number' | $T8 %][% ELSE %][% 'Vendor Order Number' | $T8 %][% END %]</th>
292         <td><input name="cusordnumber" size="11" value="[% HTML.escape(cusordnumber) %]"[% RO %]></td>
293        </tr>
294
295        <tr>
296         <th align="right" nowrap>[% 'Delivery Order Date' | $T8 %]</th>
297         <td nowrap>
298          [% L.date_tag('transdate', transdate, readonly => delivered) %]
299         </td>
300        </tr>
301
302        <tr>
303         <th align="right" nowrap>[% 'Reqdate' | $T8 %]</th>
304         <td nowrap>
305          <input name="reqdate" id="reqdate" size="11" title="[% HTML.escape(myconfig_dateformat) %]" value="[% HTML.escape(reqdate) %]"
306                 onBlur="check_right_date_format(this)"[% RO %]>
307          <input type="button" name="b_reqdate" id="reqdate_trigger" value="?">
308         </td>
309        </tr>
310
311        <tr>
312         <th width="70%" align="right" nowrap>[% 'Project Number' | $T8 %]</th>
313         <td>
314          [%- IF delivered %]
315          <input type="hidden" name="globalproject_id" value="[% HTML.escape(globalproject_id) %]">
316          [%- FOREACH row = ALL_PROJECTS %]
317          [% IF globalproject_id == row.id %][% HTML.escape(row.projectnumber) %][% END %]
318          [%- END %]
319          [%- ELSE %]
320          <select name="globalproject_id">
321           <option></option>
322           [%- FOREACH row = ALL_PROJECTS %]
323           <option value="[% HTML.escape(row.id) %]"[% IF globalproject_id == row.id %] selected[% END %]>[% HTML.escape(row.projectnumber) %]</option>
324           [%- END %]
325          </select>
326          [%- END %]
327         </td>
328        </tr>
329       </table>
330      </td>
331     </tr>
332    </table>