]> wagnertech.de Git - mfinanz.git/blob - templates/design40_webpages/do/form_header.html
date error in mapping
[mfinanz.git] / templates / design40_webpages / do / form_header.html
1 [% USE T8 %]
2 [% USE HTML %]
3 [% USE LxERP %]
4 [% USE L %]
5 [% USE P %]
6
7 [% # Determine which shipping address to show if the delivery order has been shipped already. %]
8 [% IF delivered;
9   SET shipto_label = [];
10   IF shipto_id;
11     FOREACH row = ALL_SHIPTO ;
12       IF row.shipto_id == shipto_id ;
13         SET shipto_label = [ row.shiptoname, row.shiptodepartment_1, row.shiptostreet, row.shiptocity ] ;
14       END ;
15     END ;
16   ELSE ;
17     SET shipto_label = [ shiptoname, shiptodepartment_1, shiptostreet, shiptocity ] ;
18   END ;
19
20   SET shipto_label = shipto_label.grep('.') ;
21   IF !shipto_label.size ;
22     shipto_label = [ LxERP.t8('no shipping address') ] ;
23   END ;
24 END ; %]
25
26 <h1>[% title %]</h1>
27
28 <script type="text/javascript" src="js/show_form_details.js"></script>
29 <script type="text/javascript" src="js/show_history.js"></script>
30 <script type="text/javascript" src="js/show_vc_details.js"></script>
31 <script type="text/javascript" src="js/delivery_customer_selection.js"></script>
32 <script type="text/javascript" src="js/calculate_qty.js"></script>
33 <script type="text/javascript" src="js/stock_in_out.js"></script>
34 <script type="text/javascript" src="js/follow_up.js"></script>
35 <script type="text/javascript" src="js/kivi.SalesPurchase.js"></script>
36
37
38 [% IF vc == 'customer' %]
39   [% SET is_customer = '1' %]
40 [% ELSE %]
41   [% SET vc = 'vendor' %]
42   [% SET is_customer = '0' %]
43 [% END %]
44 [% SET vc_id = vc _ "_id" %]
45 [% IF delivered %]
46   [% SET DISABLED = ' disabled' %]
47 [% END %]
48
49 [% INCLUDE 'common/flash.html' %]
50 [% INCLUDE 'generic/set_longdescription.html' %]
51
52 [% IF ERRORS && ERRORS.size %]
53   <p class="message message_error">[% ERRORS.join('<br>') %]</p>
54 [% END %]
55
56 <form id="form" method="post" name="do" action="do.pl">
57
58 <div id="do_tabs" class="tabwidget">
59   <ul>
60     <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
61     [% IF INSTANCE_CONF.get_webdav %]
62       <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
63     [% END %]
64     [% IF id AND INSTANCE_CONF.get_doc_storage %]
65       <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>
66       <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>
67     [% END %]
68     [% IF id AND AUTH.assert('record_links', 1) %]
69       <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=DeliveryOrder&object_id=[% HTML.url(id) %]">[% 'Linked Records' | $T8 %]</a></li>
70     [% END %]
71   </ul>
72
73 <div id="ui-tabs-basic-data">
74 <div class="wrapper" id="wrapper-1">
75 [% INCLUDE 'generic/toggle_wrapper.html' %]
76
77 <input type="hidden" name="follow_up_trans_id_1" id="follow_up_trans_id_1" value="[% HTML.escape(id) %]">
78 <input type="hidden" name="follow_up_trans_type_1" id="follow_up_trans_type_1" value="[% HTML.escape(type) %]">
79 <input type="hidden" name="follow_up_trans_info_1" id="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
80 <input type="hidden" name="follow_up_rowcount" id="follow_up_rowcount" value="1">
81
82 <input type="hidden" name="business" id="business" value="[% HTML.escape(business) %]">
83 <input type="hidden" name="closed" id="closed" value="[% HTML.escape(closed) %]">
84 <input type="hidden" name="convert_from_oe_ids" id="convert_from_oe_ids" value="[% HTML.escape(convert_from_oe_ids) %]">
85 <input type="hidden" name="currency" id="currency" value="[% HTML.escape(currency) %]">
86 <input type="hidden" name="customer_pricegroup_id" id="customer_pricegroup_id" value="[% HTML.escape(customer_pricegroup_id) %]">
87 <input type="hidden" name="discount" id="discount" value="[% HTML.escape(discount) %]">
88 <input type="hidden" name="dunning_amount" id="dunning_amount" value="[% HTML.escape(dunning_amount) %]">
89 <input type="hidden" name="emailed" id="emailed" value="[% HTML.escape(emailed) %]">
90 <input type="hidden" name="id" id="id" value="[% HTML.escape(id) %]">
91 <input type="hidden" name="max_dunning_level" id="max_dunning_level" value="[% HTML.escape(max_dunning_level) %]">
92 <input type="hidden" name="printed" id="printed" value="[% HTML.escape(printed) %]">
93 <input type="hidden" name="proforma" id="proforma" value="[% HTML.escape(proforma) %]">
94 <input type="hidden" name="queued" id="queued" value="[% HTML.escape(queued) %]">
95 <input type="hidden" name="saved_donumber" id="saved_donumber" value="[% HTML.escape(saved_donumber) %]">
96 [% IF delivered %]
97   <input type="hidden" name="shipto_id" id="shipto_id" value="[% HTML.escape(shipto_id) %]">
98   <input type="hidden" name="shiptocity" id="shiptocity" value="[% HTML.escape(shiptocity) %]">
99   <input type="hidden" name="shiptocontact" id="shiptocontact" value="[% HTML.escape(shiptocontact) %]">
100   <input type="hidden" name="shiptocp_gender" id="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
101   <input type="hidden" name="shiptocountry" id="shiptocountry" value="[% HTML.escape(shiptocountry) %]">
102   <input type="hidden" name="shiptogln" id="shiptogln" value="[% HTML.escape(shiptogln) %]">
103   <input type="hidden" name="shiptodepartment_1" id="shiptodepartment_1" value="[% HTML.escape(shiptodepartment_1) %]">
104   <input type="hidden" name="shiptodepartment_2" id="shiptodepartment_2" value="[% HTML.escape(shiptodepartment_2) %]">
105   <input type="hidden" name="shiptoemail" id="shiptoemail" value="[% HTML.escape(shiptoemail) %]">
106   <input type="hidden" name="shiptofax" id="shiptofax" value="[% HTML.escape(shiptofax) %]">
107   <input type="hidden" name="shiptoname" id="shiptoname" value="[% HTML.escape(shiptoname) %]">
108   <input type="hidden" name="shiptophone" id="shiptophone" value="[% HTML.escape(shiptophone) %]">
109   <input type="hidden" name="shiptostreet" id="shiptostreet" value="[% HTML.escape(shiptostreet) %]">
110   <input type="hidden" name="shiptozipcode" id="shiptozipcode" value="[% HTML.escape(shiptozipcode) %]">
111   <input type="hidden" name="shiptocp_gender" id="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
112 [% END %]
113 <input type="hidden" name="show_details" id="show_details" value="[% HTML.escape(show_details) %]">
114 <input type="hidden" name="taxincluded" id="taxincluded" value="[% HTML.escape(taxincluded) %]">
115 <input type="hidden" name="taxzone_id" id="taxzone_id" value="[% HTML.escape(taxzone_id) %]">
116 <input type="hidden" name="title" id="title" value="[% HTML.escape(title) %]">
117 <input type="hidden" name="type" id="type" value="[% HTML.escape(type) %]">
118 <input type="hidden" name="vc" id="vc" value="[% HTML.escape(vc) %]">
119 <input type="hidden" name="lastmtime" id="lastmtime" value="[% HTML.escape(lastmtime) %]">
120 <input type="hidden" name="tax_point" id="tax_point" value="[% HTML.escape(tax_point) %]">
121
122 [% IF !id %]
123 [%   L.hidden_tag('form_validity_token', form_validity_token) %]
124 [% END %]
125
126 [% IF delivered %][% SET RO=' readonly' %][% END %]
127
128 <table class="tbl-horizontal col">
129   <caption>[% 'Customer & Order Information' | $T8 %]</caption>
130   <colgroup><col class="wi-mediumsmall"><col class="wi-wide"></colgroup>
131   <tbody>
132     <tr>
133       <th>[% IF is_customer %][% 'Customer' | $T8 %][% ELSE %][% 'Vendor' | $T8 %][% END %]</th>
134       <td class="wi-wide">
135         [% IF RO %]
136           [% P.hidden_tag(vc_id, $vc_id) %]
137           [% HTML.escape(VC_OBJ.name) %]
138         [% ELSE %]
139           [% P.customer_vendor.picker(vc_id, $vc_id, type=vc, class="wi-wide tooltipstered", onchange="\$('#update_button').click()", title=VC_OBJ.name ) %]
140         [% END %]
141         [% #P.button_tag("show_vc_details('" _ HTML.escape(vc) _ "')", LxERP.t8("Details (one letter abbreviation)"), class="wi-tiny neutral", title=LxERP.t8('Detailed information about this contact') ) %]
142         <a href="javascript:show_vc_details('[% HTML.escape(vc) %]');" title="[% 'Show detail informationen' | $T8 %]" class="button-image info"><img src="image/detail.png"></a>
143         [% P.hidden_tag("previous_" _ vc_id, $vc_id) %]
144       </td>
145     </tr>
146     [% IF ALL_CONTACTS.size %]
147     <tr>
148       <th>[% 'Contact Person' | $T8 %]</th>
149       <td>
150         [% IF delivered %]
151           <input type="hidden" name="cp_id" value="[% HTML.escape(cp_id) %]">
152           [% IF cp_id == row.cp_id %]
153             <span class="data wi-wide">[% HTML.escape(row.cp_name) %][% IF row.cp_abteilung %] ([% HTML.escape(row.cp_abteilung) %])[% END -%]</span>
154           [% END %]
155         [% ELSE %]
156           [% L.select_tag('cp_id', ALL_CONTACTS, default = cp_id, value_key = 'cp_id', title_key = 'full_name_dep', with_empty = 1, class='wi-wide') %]
157         [% END %]
158       </td>
159     </tr>
160     [% END %]
161     <tr>
162       <th>[% 'Shipping Address' | $T8 %]</th>
163       <td>
164         [% IF delivered %]
165           <span class="data wi-wide">[% HTML.escape(shipto_label.join('; ')) %]</span>
166         [% ELSE %]
167           [% IF ALL_SHIPTO.size %]
168             [% shiptos = [ [ "", LxERP.t8("No/individual shipping address") ] ] ;
169                L.select_tag('shipto_id', shiptos.import(ALL_SHIPTO), default=shipto_id, value_key='shipto_id', title_key='displayable_id', class='wi-wide') %]
170           [% END %]
171           [% L.button_tag("kivi.SalesPurchase.edit_custom_shipto()", LxERP.t8("Custom shipto"), class='button neutral below wi-wide') %]
172         [% END %]
173       </td>
174     </tr>
175     [% IF (vc == 'customer') && VC_OBJ.additional_billing_addresses.as_list.size %]
176     <tr>
177       <th>[% 'Custom Billing Address' | $T8 %]</th>
178       <td>
179         [% L.select_tag('billing_address_id', VC_OBJ.additional_billing_addresses,
180                         with_empty=1, default=billing_address_id, value_key='id', title_key='displayable_id', class='wi-wide') %]
181       </td>
182     </tr>
183     [% END %]
184     [% IF business %]
185       <tr>
186         <th>[% IF is_customer %][% 'Customer type' | $T8 %][% ELSE %][% 'Vendor type' | $T8 %][% END %]</th>
187         <td><span class="data wi-wide">[% HTML.escape(business) %]</span><!-- PENDENT: Behandlung von Text in Formular-Tabellen -->  </td>
188       </tr>
189     [% END %]
190     [% IF max_dunning_level %]
191       <tr>
192         <th>[% 'Max. Dunning Level' | $T8 %]</th>
193         <td>
194           <b>[% HTML.escape(max_dunning_level) %]</b>, [% 'Dunning Amount' | $T8 %]:
195           <b>[% HTML.escape(LxERP.format_amount(dunning_amount, 2)) %]</b>
196         </td>
197       </tr>
198     [% END %]
199     [% IF ALL_LANGUAGES.size %]
200       <tr>
201        <th>[% 'Language' | $T8 %]</th>
202        <td>
203         [% L.select_tag('language_id', ALL_LANGUAGES, default = language_id, title_key = 'description', with_empty = 1, style = 'width: 250px' )%]
204        </td>
205       </tr>
206     [% END %]
207     [% IF ALL_DEPARTMENTS.size %]
208       <tr>
209         <th>[% 'Department' | $T8 %]</th>
210         <td>
211           [% IF ( delivered ) %]
212             [% L.hidden_tag('department_id', department_id) %]
213           [% ELSE %]
214             [% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1, class='wi-wide', disabled = delivered )%]
215           [% END %]
216         </td>
217       </tr>
218     [% END %]
219     <tr>
220       <th>[% 'Shipping Point' | $T8 %]</th>
221       <td><input type="text" name="shippingpoint" class="wi-wide" value="[% HTML.escape(shippingpoint) %]"[% RO %]></td>
222     </tr>
223     <tr>
224       <th>[% 'Ship via' | $T8 %]</th>
225       <td><input type="text" name="shipvia" class="wi-wide" value="[% HTML.escape(shipvia) %]"[% RO %]></td>
226     </tr>
227     <tr>
228       <th>[% 'Transaction description' | $T8 %]</th>
229       <td>[% L.input_tag("transaction_description", transaction_description, class="wi-wide", "data-validate"=(INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : ''), readonly=delivered) %]</td>
230     </tr>
231   </tbody>
232 </table>
233
234
235
236 <table class="tbl-horizontal col">
237   <caption>[% 'Delivery Terms' | $T8 %]</caption>
238   <colgroup><col class="wi-wide"></colgroup>
239   <tbody>
240     <tr>
241       <td>[% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default=delivery_term_id, with_empty=1, title_key='description', class='wi-wide') %]</td>
242    </tr>
243     <tr>
244       <th class="caption"> [% 'Notes' | $T8 %] </th>
245     </tr>
246     <tr>
247       <td class="wi-wide">
248         [% IF delivered %]
249           [% L.hidden_tag("notes", notes) %]
250           <div class="fake-textarea fake-wi-wide">[% P.restricted_html(notes) %]</div>
251         [% ELSE %]
252           [% L.textarea_tag("notes", notes, rows=3, cols=10, class="texteditor wi-wide") %]
253         [% END %]
254       </td>
255     </tr>
256     <tr>
257       <td colspan="2">
258         <span class="label above">[% 'Internal Notes' | $T8 %]</span>
259         [% L.textarea_tag("intnotes", intnotes, class="wi-wide") %]
260       </td>
261     </tr>
262   </tbody>
263 </table>
264
265
266 <table class="tbl-horizontal">
267   <caption>[% 'Status & Handling' | $T8 %]</caption>
268   <tbody>
269     <tr>
270       <th>[% 'Transfer Status' | $T8 %]</th>
271       <td>
272         <span class="data wi-normal">[% IF delivered %]
273           [% IF is_customer %]
274             [% 'transferred out' | $T8 %]
275           [% ELSE %]
276             [% 'transferred in' | $T8 %]
277           [% END %]
278         [% ELSE %]
279           [% IF is_customer %]
280             [% 'not transferred out yet' | $T8 %]
281           [% ELSE %]
282             [% 'not transferred in yet' | $T8 %]
283           [% END %]
284         [% END %]</span>
285       </td>
286       </tr>
287     <tr>
288       <th>[% 'Status' | $T8 %]</th>
289       <td>
290         <span class="data wi-normal">[% IF closed %][% 'Closed' | $T8 %][% ELSE %][% 'Open' | $T8 %][% END %]</span>
291         <input type="hidden" name="delivered" value="[% HTML.escape(delivered) %]">
292      </td>
293     </tr>
294     <tr>
295       <th>[% 'Employee' | $T8 %]</th>
296       <td>
297         [% IF delivered %]
298           <input type="hidden" name="employee_id" value="[% HTML.escape(employee_id) %]">
299           [% FOREACH row = ALL_EMPLOYEES %]
300             [% IF row.id == employee_id %]
301               [% IF row.name %]
302                 <span class="data wi-normal">[% HTML.escape(row.name) %]</span>
303               [% ELSE %]
304                 <span class="data wi-normal">[% HTML.escape(row.login) %]</span>
305               [% END %]
306             [% END %]
307           [% END %]
308         [% ELSE %]
309           [% L.select_tag('employee_id', ALL_EMPLOYEES, default = employee_id, title_key = 'safe_name', class='wi-normal') %]
310         [% END %]
311       </td>
312     </tr>
313     [% IF is_customer %]
314       [% IF salesman_id %]
315         [% SET the_salesman_id = salesman_id %]
316       [% ELSE %]
317         [% SET the_salesman_id = employee_id %]
318       [% END %]
319       <tr>
320         <th>[% 'Salesman' | $T8 %]</th>
321         <td>
322           [% IF delivered %]
323             <input type="hidden" name="salesman_id" value="[% HTML.escape(salesman_id) %]">
324             [% FOREACH row = ALL_SALESMEN %]
325               [% IF row.id == the_salesman_id %]
326                [% IF row.name %]
327                  <span class="data wi-normal">[% HTML.escape(row.name) %][% ELSE %][% HTML.escape(row.login) %]</span>
328                [% END %]
329              [% END %]
330             [% END %]
331           [% ELSE %]
332             [% L.select_tag('salesman_id', ALL_SALESMEN, default = (salesman_id ? salesman_id : employee_id), title_key = 'safe_name', class='wi-normal') %]
333           [% END %]
334         </td>
335       </tr>
336     [% END %]
337     <tr>
338       <th class="caption" colspan="2">[% 'IDs & Dates' | $T8 %]</th>
339     </tr>
340     <tr>
341       <th>[% 'Delivery Order Number' | $T8 %]</th>
342       <td>
343         [% IF !is_customer || INSTANCE_CONF.get_sales_purchase_record_numbers_changeable %]
344           [% L.input_tag("donumber", donumber, readonly=delivered, class="wi-mediumsmall") %]
345         [% ELSIF id %]
346           [% HTML.escape(donumber) %]
347           [% L.hidden_tag("donumber", donumber) %]
348         [% ELSE %]
349           [% LxERP.t8("will be set upon saving") %]
350         [% END %]
351       </td>
352     </tr>
353     <tr>
354       <th>[% 'Order Number' | $T8 %]</th>
355       <td><input type="text" name="ordnumber" id="ordnumber" class="wi-mediumsmall" value="[% HTML.escape(ordnumber) %]"[% RO %]></td>
356     </tr>
357     <tr>
358       <th>[% IF is_customer %][% 'Customer Order Number' | $T8 %][% ELSE %][% 'Vendor Order Number' | $T8 %][% END %]</th>
359       <td><input type="text" name="cusordnumber" id="cusordnumber" class="wi-mediumsmall" value="[% HTML.escape(cusordnumber) %]"[% RO %]></td>
360     </tr>
361    <tr>
362       <th>[% 'Project Number' | $T8 %]</th>
363       <td>
364         [% IF delivered %]
365           <input type="hidden" name="globalproject_id" value="[% HTML.escape(globalproject_id) %]">
366           [% FOREACH row = ALL_PROJECTS %]
367             [% IF globalproject_id == row.id %][% HTML.escape(row.projectnumber) %][% END %]
368           [% END %]
369         [% ELSE %]
370           <select name="globalproject_id" class="wi-mediumsmall">
371             <option></option>
372             [% FOREACH row = ALL_PROJECTS %]
373               <option value="[% HTML.escape(row.id) %]"[% IF globalproject_id == row.id %] selected[% END %]>[% HTML.escape(row.projectnumber) %]</option>
374             [% END %]
375           </select>
376         [% END %]
377       </td>
378     </tr>
379     <tr>
380       <th>[% 'Delivery Order Date' | $T8 %]</th>
381       <td> [% L.date_tag('transdate', transdate, readonly => delivered, class='wi-small') %] </td>
382     </tr>
383     <tr>
384       <th>[% 'Reqdate' | $T8 %]</th>
385       <td> [% L.date_tag('reqdate', reqdate, readonly => delivered, class='wi-small') %] </td>
386     </tr>
387     [% IF is_customer %]
388       <tr>
389         <th>[% 'Insert Date' | $T8 %]</th>
390         <td><span class="data wi-small">[% insertdate %]</span></td>
391       </tr>
392     [% END %]
393   </tbody>
394 </table>
395
396 </div><!-- /.wrapper -->