]> wagnertech.de Git - mfinanz.git/blob - templates/design40_webpages/part/_assortment.html
date error in mapping
[mfinanz.git] / templates / design40_webpages / part / _assortment.html
1 [% USE T8 %]
2 [% USE HTML %]
3 [% USE LxERP %]
4 [% USE L %]
5 [% USE P %]
6
7 <div id="assortment" class="wrapper" style="overflow-y: auto; height:65vh;">
8
9 [% L.hidden_tag('assortment_id', SELF.part.id) %]
10
11 <table id="assortment_items" class="tbl-list">
12   <caption>[% 'Assortment items' | $T8 %]</caption>
13   <thead>
14     <tr>
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>
18       [% END %]
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>
22       [% END %]
23       <th id="partnumber_header_id" >
24         <a href='javascript:kivi.Part.reorder_items("partnumber")'>[% 'Partnumber' | $T8 %]</a>
25       </th>
26       <th id="partdescription_header_id">
27         <a href='javascript:kivi.Part.reorder_items("description")'>[% 'Description' | $T8 %]</a>
28       </th>
29       <th id="qty_header_id">
30         <a href='javascript:kivi.Part.reorder_items("qty")'>[% 'Qty' | $T8 %]</a>
31       </th>
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>
38       </th>
39       <th id="lastcost_header_id" class="right">
40         <a href='javascript:kivi.Part.reorder_items("lastcost")'> [% 'Lastcost' | $T8 %]</a>
41       </th>
42       <th id="_header_id" class="right">
43         <a href='javascript:kivi.Part.reorder_items("partsgroup")'> [% 'Partsgroup' | $T8 %]</a>
44       </th>
45     </tr>
46   </thead>
47   <tbody id="assortment_rows">
48     [% assortment_html %]
49   </tbody>
50   <tfoot id="assortment_input">
51     <tr>
52       [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
53         <td></td>
54         <td></td>
55         <td></td>
56         <td colspan="4">
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) %]
60         </td>
61       [% ELSE %]
62         <td></td>
63         <td></td>
64         <td></td>
65         <td></td>
66         <td></td>
67       [% END %]
68       <td></td>
69       <td></td>
70       <td></td>
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>
74     </tr>
75     <tr class="blank">
76      [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
77        <td></td>
78        <td></td>
79        <td></td>
80        <td colspan="2">[% L.button_tag('$("#assortment_picker").data("part_picker").open_dialog()', LxERP.t8('Add multiple items'), class='neutral') %]</td>
81      [% ELSE %]
82        <td></td>
83        <td></td>
84        <td></td>
85      [% END %]
86      <td></td>
87      <td></td>
88      <td></td>
89      <td></td>
90      <td></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>
93      <td></td>
94     </tr>
95   </tfoot>
96
97 </table><!-- /#assortment.wrapper -->
98
99 [% L.sortable_element('#assortment_rows') %]
100
101 </div>
102
103 <script type="text/javascript">
104   $(function() {
105     $('#assortment').on( 'focusout', '.recalc', function( event )  {
106       kivi.Part.assortment_recalc();
107     });
108
109     $('#assortment').on( 'change', ':checkbox', function( event )  {
110       kivi.Part.assortment_recalc();
111     });
112
113     $('#assortment_rows').on('sortstop', function(event, ui) {
114       $('#assortment thead a img').remove();
115       kivi.Part.renumber_positions();
116     });
117   })
118 </script>