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