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