]> wagnertech.de Git - mfinanz.git/blob - templates/webpages/part/_assortment.html
date error in mapping
[mfinanz.git] / templates / webpages / part / _assortment.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5 [%- USE P %]
6
7 <div id="assortment" name="assortment">
8
9 <h2>[% 'Assortment items' | $T8 %]</h2>
10
11 [% L.hidden_tag('assortment_id', SELF.part.id) %]
12
13 <div style="overflow-y: auto; height:65vh;">
14 <table id="assortment_items">
15  <thead>
16    <tr class="listheading">
17      <th class="listheading" style='display:none'></th>
18      [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
19      <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
20      [% END %]
21      <th class="listheading" nowrap width="3" >[%- 'position'     | $T8 %] </th>
22      [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
23      <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
24      [% END %]
25      <th id="partnumber_header_id"  class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Part.reorder_items("partnumber")'> [%- 'Partnumber'  | $T8 %]</a></th>
26      <th id="partdescription_header_id"  class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Part.reorder_items("description")' >[%- 'Description' | $T8 %]</a></th>
27      <th id="qty_header_id"         class="listheading" nowrap width="5" ><a href='#' onClick='javascript:kivi.Part.reorder_items("qty")'>        [%- 'Qty'         | $T8 %]</a></th>
28      <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
29      <th class="listheading" nowrap width="5" >[%- 'Charge'       | $T8 %] </th>
30      <th class="listheading" nowrap width="5" >[%- 'Line Total'   | $T8 %] </th>
31      <th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
32      <th id="sellprice_header_id"   class="listheading" nowrap width="10" ><a href='#' onClick='javascript:kivi.Part.reorder_items("sellprice")'> [%- 'Sellprice'   | $T8 %]</a></th>
33      <th id="lastcost_header_id"   class="listheading" nowrap width="10" ><a href='#' onClick='javascript:kivi.Part.reorder_items("lastcost")'> [%- 'Lastcost'      | $T8 %]</a></th>
34      <th id="_header_id"   class="listheading" nowrap width="15" ><a href='#' onClick='javascript:kivi.Part.reorder_items("partsgroup")'> [%- 'Partsgroup'       | $T8 %]</a></th>
35    </tr>
36  </thead>
37 <tbody id="assortment_rows">
38   [% assortment_html %]
39 </tbody>
40 <tbody id="assortment_input">
41 <tr>
42  [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
43  <td></td>
44  <td></td>
45  <td align="right">[% 'Part' | $T8 %]:</td>
46  <td>[% P.part.picker('add_items[+].parts_id', '', style='width: 300px', multiple=1, id='assortment_picker', action={set_multi_items='kivi.Part.set_multi_assortment_items', commit_one='kivi.Part.add_assortment_item'}) %]</td>
47  <td>[%- L.button_tag("kivi.Part.add_assortment_item()", LxERP.t8("Add")) %]</td>
48  <td>[% L.button_tag('$("#assortment_picker").data("part_picker").open_dialog()', LxERP.t8('Add multiple items')) %]</td>
49  <td>[% L.hidden_tag('add_items[].qty_as_number', 1) %]</td>
50  [% ELSE %]
51  <td></td>
52  <td></td>
53  <td></td>
54  <td></td>
55  <td></td>
56  [% END %]
57  <td></td>
58  <td></td>
59  <td align="right">[% 'Totals' | $T8 %]:</td>
60  <th id="items_sellprice_sum" class="numeric">[%- LxERP.format_amount(items_sellprice_sum, 2, 0) %]</th>
61  <th id="items_lastcost_sum"  class="numeric">[%- LxERP.format_amount(items_lastcost_sum,  2, 0) %]</th>
62  <th id="items_sum_diff"      class="numeric">[%- LxERP.format_amount(items_sum_diff,      2, 0) %]</th>
63 </tr>
64 <tr>
65  [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
66  <td></td>
67  <td></td>
68  [% END %]
69  <td></td>
70  <td></td>
71  <td></td>
72  <td></td>
73  <td></td>
74  <td></td>
75  <td></td>
76  <td></td>
77  <td align="right">[% L.button_tag("kivi.Part.set_assortment_sellprice()", LxERP.t8("Set sellprice")) %]</td>
78  <td align="right">[% L.button_tag("kivi.Part.set_assortment_lastcost()",  LxERP.t8("Set lastcost"))  %]</td>
79  <td></td>
80 </tr>
81 </tbody>
82 </table>
83 </div>
84 [% L.sortable_element('#assortment_rows') %]
85
86 </div>
87
88 <script type="text/javascript">
89   $(function() {
90     $("#assortment").on( "focusout", ".recalc", function( event )  {
91       kivi.Part.assortment_recalc();
92     });
93
94     $("#assortment").on( "change", ":checkbox", function( event )  {
95       kivi.Part.assortment_recalc();
96     });
97
98     $('#assortment_rows').on('sortstop', function(event, ui) {
99       $('#assortment thead a img').remove();
100       kivi.Part.renumber_positions();
101     });
102   })
103 </script>