7 <div id="assortment" class="wrapper" style="overflow-y: auto; height:65vh;">
9 [% L.hidden_tag('assortment_id', SELF.part.id) %]
11 <table id="assortment_items" class="tbl-list">
12 <caption>[% 'Assortment items' | $T8 %]</caption>
15 <th style="display:none"></th>
16 [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
17 <th style="text-align:center"><img src="image/close.png" alt="[% LxERP.t8('delete item') %]"></th>
19 <th>[% 'Position' | $T8 %] </th>
20 [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
21 <th style="text-align:center"><img src="image/updown.png" alt="[% LxERP.t8('reorder item') %]"></th>
23 <th id="partnumber_header_id" >
24 <a href='javascript:kivi.Part.reorder_items("partnumber")'>[% 'Partnumber' | $T8 %]</a>
26 <th id="partdescription_header_id">
27 <a href='javascript:kivi.Part.reorder_items("description")'>[% 'Description' | $T8 %]</a>
29 <th id="qty_header_id">
30 <a href='javascript:kivi.Part.reorder_items("qty")'>[% 'Qty' | $T8 %]</a>
32 <th>[% 'Unit' | $T8 %] </th>
33 <th>[% 'Charge' | $T8 %] </th>
34 <th>[% 'Line Total' | $T8 %] </th>
35 <th class="right">[% 'Price Factor' | $T8 %]</th>
36 <th id="sellprice_header_id" class="right">
37 <a href='javascript:kivi.Part.reorder_items("sellprice")'> [% 'Sellprice' | $T8 %]</a>
39 <th id="lastcost_header_id" class="right">
40 <a href='javascript:kivi.Part.reorder_items("lastcost")'> [% 'Lastcost' | $T8 %]</a>
42 <th id="_header_id" class="right">
43 <a href='javascript:kivi.Part.reorder_items("partsgroup")'> [% 'Partsgroup' | $T8 %]</a>
47 <tbody id="assortment_rows">
50 <tfoot id="assortment_input">
52 [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
57 [% P.part.picker('add_items[+].parts_id', '', class='wi-lightwide', multiple=1, id='assortment_picker', action={set_multi_items='kivi.Part.set_multi_assortment_items', commit_one='kivi.Part.add_assortment_item'}, placeholder=LxERP.t8('Search & Add Article')) %]
58 [% L.button_tag("kivi.Part.add_assortment_item()", LxERP.t8("Add")) %]
59 [% L.hidden_tag('add_items[].qty_as_number', 1) %]
71 <td class="numeric" id="items_sellprice_sum">[% LxERP.format_amount(items_sellprice_sum, 2, 0) %]</td>
72 <td class="numeric" id="items_lastcost_sum" >[% LxERP.format_amount(items_lastcost_sum, 2, 0) %]</td>
73 <td class="numeric" id="items_sum_diff" >[% LxERP.format_amount(items_sum_diff, 2, 0) %]</td>
76 [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
80 <td colspan="2">[% L.button_tag('$("#assortment_picker").data("part_picker").open_dialog()', LxERP.t8('Add multiple items'), class='neutral') %]</td>
91 <td class="right">[% L.button_tag("kivi.Part.set_assortment_sellprice()", LxERP.t8("Set sellprice")) %]</td>
92 <td class="right">[% L.button_tag("kivi.Part.set_assortment_lastcost()", LxERP.t8("Set lastcost")) %]</td>
97 </table><!-- /#assortment.wrapper -->
99 [% L.sortable_element('#assortment_rows') %]
103 <script type="text/javascript">
105 $('#assortment').on( 'focusout', '.recalc', function( event ) {
106 kivi.Part.assortment_recalc();
109 $('#assortment').on( 'change', ':checkbox', function( event ) {
110 kivi.Part.assortment_recalc();
113 $('#assortment_rows').on('sortstop', function(event, ui) {
114 $('#assortment thead a img').remove();
115 kivi.Part.renumber_positions();