]> wagnertech.de Git - mfinanz.git/blob - templates/design40_webpages/reclamation/tabs/basic_data.html
date error in mapping
[mfinanz.git] / templates / design40_webpages / reclamation / tabs / basic_data.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5 [%- USE P %]
6
7 [%- INCLUDE 'generic/set_longdescription.html' %]
8
9 <div id="ui-tabs-basic-data">
10
11 [% IF FORM.email_attachment_id || FORM.workflow_email_attachment_id%]
12   <div class="wrapper" id="email_attachment_wrapper">
13     [%
14       BLOCK panel_1;
15         P.email_journal.attachment_preview(
16              FORM.email_attachment_id || FORM.workflow_email_attachment_id,
17              style="height:600px"
18              );
19       END;
20       INCLUDE 'common/toggle_panel.html'
21         block_name='panel_1'
22         button_closed  = LxERP.t8('Show Attachment')
23         button_open    = LxERP.t8('Hide Attachment')
24         ;
25     %]
26   </div>
27 [% END %]
28
29 <div class="wrapper" id="wrapper-1">
30 [% INCLUDE 'generic/toggle_wrapper.html' %]
31
32 <div class="col">
33
34   <table class="tbl-horizontal col">
35     <caption>[% 'Customer & Order Information' | $T8 %]</caption>
36     <colgroup><col class="wi-mediumsmall"><col class="wi-lightwide"></colgroup>
37     <tbody>
38       <tr>
39         <th>[%- SELF.cv == "customer" ? LxERP.t8('Customer') : LxERP.t8('Vendor') -%]</th>
40         [% SET cv_id = SELF.cv _ '_id' %]
41         <td class="wi-lightwide">
42           [% P.customer_vendor.picker("reclamation.${SELF.cv}" _ '_id', SELF.reclamation.$cv_id, type=SELF.cv, show_details="1") %]
43         </td>
44       </tr>
45
46       <tr id='contact_row' [%- IF !SELF.reclamation.${SELF.cv}.contacts.size %]style='display:none'[%- END %]>
47         <th>[% 'Contact Person' | $T8 %]</th>
48         <td>[% L.select_tag('reclamation.contact_id',
49                             SELF.reclamation.${SELF.cv}.contacts,
50                             default=SELF.reclamation.contact_id,
51                             title_key='full_name_dep',
52                             value_key='cp_id',
53                             with_empty=1,
54                             class='wi-lightwide') %]</td>
55       </tr>
56
57       <tr>
58         <th>[% 'Shipping Address' | $T8 %]</th>
59         <td>
60           <span id='shipto_selection' [%- IF !SELF.reclamation.${SELF.cv}.shipto.size %] style='display:none'[%- END %] >
61             [% shiptos = [ { shipto_id => "", displayable_id => LxERP.t8("No/individual shipping address") } ] ;
62                FOREACH s = SELF.reclamation.${SELF.cv}.shipto ;
63                  shiptos.push(s) ;
64                END ;
65                L.select_tag('reclamation.shipto_id',
66                              shiptos,
67                              default=SELF.reclamation.shipto_id,
68                              title_key='displayable_id',
69                              value_key='shipto_id',
70                              with_empty=0,
71                              class='wi-lightwide') %]
72           </span>
73           [% L.button_tag("kivi.Reclamation.edit_custom_shipto()",
74                           LxERP.t8("Custom shipto"),
75                           class='button neutral below wi-lightwide') %]
76         </td>
77       </tr>
78
79       [%- IF SELF.cv == "customer" %]
80       <tr id="billing_address_row"[% IF !SELF.reclamation.customer.additional_billing_addresses.as_list.size %] style="display:none"[% END %]>
81         <th>[% 'Custom Billing Address' | $T8 %]</th>
82         <td>
83           [% L.select_tag('reclamation.billing_address_id',
84                            SELF.reclamation.customer.additional_billing_addresses,
85                            default=SELF.reclamation.billing_address_id,
86                            title_key='displayable_id',
87                            value_key='id',
88                            with_empty=1,
89                            class='wi-lightwide') %]
90         </td>
91       </tr>
92       [%- END %]
93
94       [%- PROCESS reclamation/tabs/basic_data/_business_info_row.html SELF=SELF %]
95
96       <tr>
97         <th>[% 'Tax rate' | $T8 %]</th>
98         <td>[% L.select_tag('reclamation.taxzone_id', SELF.all_taxzones, default=SELF.reclamation.taxzone_id, title_key='description', class='recalc wi-lightwide') %]</td>
99       </tr>
100
101       [% SET currency_id = SELF.reclamation.currency_id || INSTANCE_CONF.get_currency_id  # use default currency for new reclamation %]
102       [% SET show_exchangerate = (SELF.reclamation.currency_id != INSTANCE_CONF.get_currency_id) %]
103       <tr id="currency_settings">
104         <th>[% 'Currency' | $T8 %]</th>
105         <td>[% L.select_tag('reclamation.currency_id', SELF.all_currencies, default=currency_id, value_key='id', title_key='name') %]</td>
106       </tr>
107       <tr id="exchangerate_settings" [%- IF !show_exchangerate %]style='display:none'[%- END %]>
108         <th>[% 'Exchangerate' | $T8 %]</th>
109         <td> 1 <span id="currency_name">[% SELF.reclamation.currency.name %]</span> =
110           [% L.input_tag('reclamation.exchangerate_as_null_number', SELF.reclamation.exchangerate_as_null_number, 'data-validate'=show_exchangerate ? 'required' : '', size="15", class="reformat_number_as_null_number numeric") %]
111           [% INSTANCE_CONF.default_currency %]
112           [% L.hidden_tag('old_currency_id', currency_id) %]
113           [% L.hidden_tag('old_exchangerate', SELF.reclamation.exchangerate_as_null_number) %]
114         </td>
115       </tr>
116
117 [%- IF SELF.all_languages.size %]
118       <tr>
119         <th>[% 'Language' | $T8 %]</th>
120         <td>
121           [% L.select_tag('reclamation.language_id', SELF.all_languages, default=SELF.reclamation.language_id, title_key='description', with_empty=1, style='wi-lightwide') %]
122         </td>
123       </tr>
124 [%- END %]
125
126 [%- IF SELF.all_departments.size %]
127       <tr>
128         <th>[% 'Department' | $T8 %]</th>
129         <td>
130           [% L.select_tag('reclamation.department_id', SELF.all_departments, default=SELF.reclamation.department_id, title_key='description', with_empty=1, class='wi-lightwide') %]
131         </td>
132       </tr>
133 [%- END %]
134
135       <tr>
136         <th>[% 'Shipping Point' | $T8 %]</th>
137         <td>[% L.input_tag('reclamation.shippingpoint', SELF.reclamation.shippingpoint, class='wi-lightwide') %]</td>
138       </tr>
139
140       <tr>
141         <th>[% 'Ship via' | $T8 %]</th>
142         <td>[% L.input_tag('reclamation.shipvia', SELF.reclamation.shipvia, class='wi-lightwide') %]</td>
143       </tr>
144
145       <tr>
146         <th>[% 'Transaction description' | $T8 %]</th>
147         <td>[% L.input_tag('reclamation.transaction_description', SELF.reclamation.transaction_description, 'data-validate'=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '', class='wi-lightwide') %]</td>
148       </tr>
149
150       <tr>
151         <th>[% 'Project Number' | $T8 %]</th>
152         <td>[% P.project.picker('reclamation.globalproject_id', SELF.reclamation.globalproject_id, class='wi-lightwide') %]</td>
153       </tr>
154
155     </tbody>
156   </table>
157
158   <table class="tbl-horizontal col">
159     <caption>[% 'Terms' | $T8 %]</caption>
160     <colgroup><col class="wi-mediumsmall"><col class="wi-lightwide"></colgroup>
161     <tbody>
162       <tr>
163         <td colspan="2">
164           <span class="label above">[% 'Payment Terms' | $T8 %]</span>
165           [% L.select_tag('reclamation.payment_id',
166                             SELF.all_payment_terms,
167                             default = SELF.reclamation.payment_id,
168                             with_empty = 1,
169                             title_key = 'description',
170                             class = 'wi-mediumsmall-lightwide') %]
171         </td>
172       </tr>
173       <tr>
174         <td colspan="2">
175           <span class="label above">[% 'Delivery Terms' | $T8 %]</span>
176           [% L.select_tag('reclamation.delivery_term_id',
177                             SELF.all_delivery_terms,
178                             default = SELF.reclamation.delivery_term_id,
179                             with_empty = 1,
180                             title_key = 'description',
181                             class = 'wi-mediumsmall-lightwide') %]
182         </td>
183       </tr>
184
185       <tr id="taxincluded_row_id" [%- IF !SELF.taxes.size %]class="hidden"[% END %]>
186         <th><label for="reclamation.taxincluded">[% 'Tax Included' | $T8 %]</label></th>
187         <td>[% L.yes_no_tag('reclamation.taxincluded', SELF.reclamation.taxincluded, class='recalc') %]</td>
188       </tr>
189
190     </tbody>
191   </table>
192
193 </div><!-- /.col -->
194
195 <table class="tbl-horizontal col">
196   <caption>[% 'Notes' | $T8 %]</caption>
197   <colgroup><col class="wi-wide"></colgroup>
198   <tbody>
199     <tr>
200       <td class="wi-wide">
201         [% L.textarea_tag('reclamation.notes', SELF.reclamation.notes, style="width: 350px; height: 150px", class="texteditor wi-wide") %]
202       </td>
203     </tr>
204     <tr>
205       <td>
206         <span class="label above">[% 'Internal Notes' | $T8 %]</span>
207         [% L.textarea_tag('reclamation.intnotes', SELF.reclamation.intnotes, class="wi-wide") %]
208       </td>
209     </tr>
210
211   </tbody>
212 </table>
213
214 <table class="tbl-horizontal col">
215   <caption>[% 'Handling, Numbers & Dates' | $T8 %]</caption>
216   <colgroup> <col class="wi-mediumsmall"><col class="wi-normal"> </colgroup>
217   <tbody>
218
219     [%- IF SELF.reclamation.id %]
220     <tr>
221       <th>
222         <label for="reclamation.delivered">[% 'Delivery Order(s) for full qty created' | $T8 %]</label>
223       </th>
224       <td>
225           [% L.yes_no_tag('reclamation.delivered', SELF.reclamation.delivered, class="wi-normal") %]
226       </td>
227     </tr>
228     <tr>
229       <th>
230         <label for="reclamation.closed">[% 'Closed' | $T8 %]</label>
231       </th>
232       <td>
233         [% L.yes_no_tag('reclamation.closed', SELF.reclamation.closed, class="wi-normal") %]
234       </td>
235     </tr>
236     [%- END %]
237
238     <tr>
239       <th>[% 'Employee' | $T8 %]</th>
240       <td>[% L.select_tag('reclamation.employee_id',
241         SELF.all_employees,
242         default=(SELF.reclamation.employee_id ? SELF.reclamation.employee_id : SELF.current_employee_id),
243         title_key='safe_name',
244         class='wi-normal',
245         ) %]</td>
246     </tr>
247
248     [% IF SELF.cv == 'customer' %]
249     <tr>
250       <th>[% 'Salesman' | $T8 %]</th>
251       <td>[% L.select_tag('reclamation.salesman_id',
252         SELF.all_salesmen,
253         default=(SELF.reclamation.salesman_id ? SELF.reclamation.salesman_id : SELF.current_employee_id),
254         title_key='safe_name',
255         class='wi-normal',
256         ) %]</td>
257     </tr>
258     [% END %]
259
260     <tr>
261       <th>[% 'Reclamation Number' | $T8 %]</th>
262       <td>[% L.input_tag('reclamation.record_number', SELF.reclamation.record_number, onchange='kivi.Reclamation.set_number_in_title(this)', class='wi-normal') %]</td>
263     </tr>
264
265     <tr>
266       <th>[% 'Customer Record Number' | $T8 %]</th>
267       <td>[% L.input_tag('reclamation.cv_record_number', SELF.reclamation.cv_record_number, class='wi-normal') %]</td>
268     </tr>
269
270     <tr>
271       <th>[% 'Reclamation Date' | $T8 %]</th>
272       <td>[% L.date_tag('reclamation.transdate_as_date', SELF.reclamation.transdate_as_date, class='wi-date') %]</td>
273     </tr>
274
275     <tr>
276       <th>[% 'Tax point' | $T8 %]</th>
277       <td>[% L.date_tag('reclamation.tax_point_as_date', SELF.reclamation.tax_point_as_date, class='recalc wi-date') %]</td>
278     </tr>
279
280     <tr>
281       <th>[% 'Deadline' | $T8 %]</th>
282       <td>[% L.date_tag('reclamation.reqdate_as_date', SELF.reclamation.reqdate_as_date, class='recalc wi-date') %]</td>
283     </tr>
284
285     <tr>
286       <th>[% 'Insert Date' | $T8 %]</th>
287       <td><span class="data wi-normal">[% SELF.reclamation.itime_as_date %]</span></td>
288     </tr>
289
290   </tbody>
291 </table>
292
293 </div><!-- /.wrapper -->
294
295
296   [%- PROCESS reclamation/tabs/basic_data/_item_input.html SELF=SELF %]
297
298 [%- IF SELF.positions_scrollbar_height -%]
299   [%- SET scroll_style = 'style="overflow-y: auto; height:' _ SELF.positions_scrollbar_height _ 'vh;"' -%]
300 [%- ELSE -%]
301   [%- SET scroll_style = '' -%]
302 [%- END -%]
303 <div id="row_table_scroll_id" class="wrapper horizontal-scroll-wrapper" [%- scroll_style -%]>
304
305   <table id="row_table_id" class="tbl-list">
306     <caption>[% 'Articles' | $T8 %]</caption>
307     <thead>
308       <tr>
309         <th class="center">
310           [%- IF MYCONFIG.show_form_details %]
311             [%- L.img_tag(src="image/collapse.svg", alt=LxERP.t8('Hide all details'), title=LxERP.t8('Hide all details'), id='expand_all', class='row-icon', "data-expanded"="1") %]
312           [%- ELSE %]
313             [%- L.img_tag(src="image/expand.svg", alt=LxERP.t8('Show all details'), title=LxERP.t8('Show all details'), id='expand_all', class='row-icon') %]
314           [%- END %]
315         </th>
316           <th>
317             [% L.checkbox_tag("select_all_multi_id", checked=0, alt=LxERP.t8('Select/Deselect all'), title=LxERP.t8('Select/Deselect all'), id='select_all') %]
318           </th>
319         <th>[% 'position' | $T8 %] </th>
320         <th style='text-align:center'><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
321         <th style='text-align:center'><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
322         [%- IF SELF.show_update_button -%]
323         <th style='text-align:center'>
324           [%- L.img_tag(src="image/rotate_cw.svg",
325                         alt=LxERP.t8('Update from master data'),
326                         title= LxERP.t8('Update from master data'),
327                         onclick="if (!confirm('" _ LxERP.t8("Are you sure to update all positions from master data?") _ "')) return false; kivi.Reclamation.update_all_rows_from_master_data();",
328                         id='update_from_master',
329                         class='row-icon') %]
330         </th>
331         [%- END %]
332         <th id="partnumber_header_id"><a href='#' onClick='javascript:kivi.Reclamation.reorder_items("partnumber")'> [%- 'Partnumber'  | $T8 %]</a></th>
333         [%- IF SELF.search_cvpartnumber -%]
334         <th id="cvpartnumber_header_id"><a href='#' onClick='javascript:kivi.Reclamation.reorder_items("cvpartnumber")' > [%- SELF.cv == "customer" ? LxERP.t8('Customer Part Number') : LxERP.t8('Model') %]</a></th>
335         [%- END -%]
336         <th id="partclass_header_id">[%- 'Type'  | $T8 %]</th>
337         <th id="description_header_id"><a href='#' onClick='javascript:kivi.Reclamation.reorder_items("description")'>[%- 'Description' | $T8 %]</a></th>
338         <th id="reason_header_id"><a href='#' onClick='javascript:kivi.Reclamation.reorder_items("reason")'>[%- 'Reason' | $T8 %]</a></th>
339         <th id="reason_description_ext_header_id"><a href='#' onClick='javascript:kivi.Reclamation.reorder_items("reason_description_ext")'>[%- 'Reason Description Extern' | $T8 %]</a></th>
340         <th id="reason_description_int_header_id"><a href='#' onClick='javascript:kivi.Reclamation.reorder_items("reason_description_int")'>[%- 'Reason Description Intern' | $T8 %]</a></th>
341         <th id="qty_header_id"><a href='#' onClick='javascript:kivi.Reclamation.reorder_items("qty")'>        [%- 'Qty' | $T8 %]</a></th>
342         <th class="listheading">[%- 'Price Factor' | $T8 %] </th>
343         <th class="listheading">[%- 'Unit'         | $T8 %] </th>
344         <th class="listheading">[%- 'Price Source' | $T8 %] </th>
345         <th id="sellprice_header_id"><a href='#' onClick='javascript:kivi.Reclamation.reorder_items("sellprice")'> [%- 'Price' | $T8 %]</a></th>
346         <th id="discount_header_id"><a href='#' onClick='javascript:kivi.Reclamation.reorder_items("discount")'>  [%- 'Discount'    | $T8 %]</a></th>
347         <th>[%- 'Extended' | $T8 %] </th>
348       </tr>
349       <tr>
350         <th></th>
351         <th class="center">
352           [%- L.button_tag('kivi.Reclamation.toggle_selected_rows();', "🔄",
353                            title=LxERP.t8("Toggle selection"),
354                            alt=LxERP.t8("Toggle selection"),
355                            ) %]
356         </th>
357         <th colspan="2"></th>
358         <th class="center">
359           [%- L.button_tag('kivi.Reclamation.delete_selected_rows();', LxERP.t8("X"),
360                            title=LxERP.t8("Delete selected rows"),
361                            alt=LxERP.t8("Delete selected rows"),
362                            ) %]
363         </th>
364         [%- IF SELF.show_update_button -%]
365         <th></th>
366         [%- END -%]
367         <th colspan="3"></th>
368         <th>
369           [% L.select_tag("reason_id_for_selected",
370                           SELF.reclamation.valid_reclamation_reasons,
371                           title_key = 'name',
372                           value_key = 'id',
373                           with_empty=1,
374                           class="wi-small",
375                           ) %]
376           [%- L.button_tag(
377                 'kivi.Reclamation.set_selected_to_value("reason_id")',
378                 "↓",
379                 alt=LxERP.t8('Apply to selected rows'),
380                 title=LxERP.t8('Apply to selected rows'),
381           ) %]
382         </th>
383         <th>
384           [% L.areainput_tag("reason_description_ext_for_selected",
385                              "",
386                              size='40',
387                              class="wi-mediumsmall",
388                              ) %]
389           [%- L.button_tag(
390                 'kivi.Reclamation.set_selected_to_value("reason_description_ext")',
391                 "↓",
392                 alt=LxERP.t8('Apply to selected rows'),
393                 title=LxERP.t8('Apply to selected rows'),
394           ) %]
395         </th>
396         <th>
397           [% L.areainput_tag("reason_description_int_for_selected",
398                              "",
399                              size='40',
400                              class="wi-mediumsmall",
401                              ) %]
402           [%- L.button_tag(
403                 'kivi.Reclamation.set_selected_to_value("reason_description_int")',
404                 "↓",
405                 alt=LxERP.t8('Apply to selected rows'),
406                 title=LxERP.t8('Apply to selected rows'),
407           ) %]
408         </th>
409         <th colspan="[% (SELF.search_cvpartnumber ? 8 : 7) %]"></th>
410       </tr>
411     </thead>
412
413     [%- FOREACH item = SELF.reclamation.items_sorted %]
414       [%- PROCESS reclamation/tabs/basic_data/_row.html ITEM=item ID=(item.id||item.new_fake_id) -%]
415     [%- END %]
416
417     <tfoot>
418       <tr id="subtotal_row_id">
419         <td colspan="[% (SELF.search_cvpartnumber ? 15 : 14) %]"></td>
420         [%- IF SELF.show_update_button -%]
421         <td></td>
422         [%- END -%]
423         <th colspan="3">[% IF !SELF.reclamation.taxincluded %][%- 'Subtotal' | $T8 %][% END %]</th>
424         <td class="numeric">[% IF !SELF.reclamation.taxincluded %][%- L.div_tag(SELF.reclamation.netamount_as_number, id='netamount_id') %][% END %]</td>
425       </tr>
426       [%- FOREACH tax = SELF.reclamation.taxes %]
427         [%- PROCESS reclamation/tabs/basic_data/_tax_row.html TAX=tax TAXINCLUDED=SELF.reclamation.taxincluded %]
428       [%- END %]
429       <tr id="amount_row_id">
430         <td colspan="[% (SELF.search_cvpartnumber ? 15 : 14) %]"></td>
431         [%- IF SELF.show_update_button -%]
432         <td></td>
433         [%- END -%]
434         <th colspan="3">[%- 'Total' | $T8 %]</th>
435         <td class="numeric">
436           [%- L.div_tag(SELF.reclamation.amount_as_number, id='amount_id') %]
437         </td>
438       </tr>
439     </tfoot>
440
441   </table>
442 </div><!-- /#row_table_scroll_id /.wrapper -->
443
444 </div><!-- /#ui-tabs-basic-data -->
445
446 [% L.sortable_element('#row_table_id') %]