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