]> wagnertech.de Git - mfinanz.git/blob - templates/webpages/part/_assembly.html
date error in mapping
[mfinanz.git] / templates / webpages / part / _assembly.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE LxERP %]
4 [%- USE L %]
5 [%- USE P %]
6
7 <div id="assembly" name="assembly">
8
9 <h2>[% 'Assembly items' | $T8 %]</h2>
10
11 [% L.hidden_tag('assembly_id', SELF.part.id) %]
12
13 <div style="overflow-y: auto; height:65vh;">
14 <table id="assembly_items">
15  <thead>
16    <tr class="listheading">
17      <th class="listheading" style='display:none'></th>
18      [% IF SELF.orphaned || AUTH.assert('assembly_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('assembly_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="5"><a href='#' onClick='javascript:kivi.Part.reorder_items("partnumber")' >[%- 'Partnumber'  | $T8 %]</a></th>
26      <th class="listheading" nowrap width="5">[% 'Type' | $T8 %]</th>
27      <th id="partdescription_header_id"  class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Part.reorder_items("description")' >[%- 'Description' | $T8 %]</a></th>
28      <th id="qty_header_id"         class="listheading" nowrap width="15" ><a href='#' onClick='javascript:kivi.Part.reorder_items("qty")'        >[%- 'Qty'         | $T8 %]</a></th>
29      <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
30      <th class="listheading" nowrap width="5" >[%- 'BOM'          | $T8 %] </th>
31      <th class="listheading" nowrap width="5" >[%- 'Line Total'   | $T8 %] </th>
32      <th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
33      <th id="sellprice_header_id"   class="listheading" nowrap width="10" ><a href='#' onClick='javascript:kivi.Part.reorder_items("sellprice")' >[%- 'Sellprice'       | $T8 %]</a></th>
34      <th id="lastcost_header_id"   class="listheading" nowrap width="10" ><a href='#' onClick='javascript:kivi.Part.reorder_items("lastcost")'   >[%- 'Lastcost'       | $T8 %]</a></th>
35      <th id="_header_id"   class="listheading" nowrap width="15" ><a href='#' onClick='javascript:kivi.Part.reorder_items("partsgroup")'         >[%- 'Partsgroup'       | $T8 %]</a></th>
36    </tr>
37  </thead>
38 <tbody id="assembly_rows">
39   [% assembly_html %]
40 </tbody>
41 <tbody id="assembly_input">
42 <tr>
43  [% IF SELF.orphaned || AUTH.assert('assembly_edit', 1) %]
44  <td></td>
45  <td></td>
46  <td align="right">[% 'Part' | $T8 %]:</td>
47  <td>[% P.part.picker('add_items[+].parts_id', '', style='width: 300px', multiple=1, id='assembly_picker', action={set_multi_items='kivi.Part.set_multi_assembly_items', commit_one='kivi.Part.add_assembly_item'}) %]</td>
48  <td>[%- L.button_tag("kivi.Part.add_assembly_item()", LxERP.t8("Add")) %]</td>
49  <td>[% L.button_tag('$("#assembly_picker").data("part_picker").open_dialog()', LxERP.t8('Add multiple items')) %]</td>
50  <td>[% L.hidden_tag('add_items[].qty_as_number', 1) %]</td>
51  [% ELSE %]
52  <td></td>
53  <td></td>
54  <td></td>
55  <td></td>
56  <td></td>
57  [% END %]
58  <td></td>
59  <td></td>
60  <td align="right">[% 'Totals' | $T8 %]:</td>
61  <td></td>
62  <td id="items_sellprice_sum" class="numeric">[%- LxERP.format_amount(items_sellprice_sum, 2, 0) %]</td>
63  <td id="items_lastcost_sum"  class="numeric">[%- LxERP.format_amount(items_lastcost_sum,  2, 0) %]</td>
64  <td></td>
65 </tr>
66 <tr>
67  [% IF SELF.orphaned || AUTH.assert('assembly_edit', 1) %]
68  <td></td>
69  <td></td>
70  [% END %]
71  <td></td>
72  <td></td>
73  <td></td>
74  <td></td>
75  <td></td>
76  <td></td>
77  <td></td>
78  <td align="right">[% 'Margepercent' | $T8 %]:</td>
79  <td></td>
80  <td class="numeric">
81  [% IF items_sellprice_sum > 0 %]
82    [%- LxERP.format_amount(100 - (items_lastcost_sum / items_sellprice_sum * 100), 2, 0) %]
83  [% END %]
84  </td>
85 </tr>
86 <tr>
87  [% IF SELF.orphaned || AUTH.assert('assembly_edit', 1) %]
88  <td></td>
89  <td></td>
90  [% END %]
91  <td></td>
92  <td></td>
93  <td></td>
94  <td></td>
95  <td></td>
96  <td></td>
97  <td></td>
98  <td align="right">[% 'Margetotal' | $T8 %]:</td>
99  <td></td>
100  <td id="items_sum_diff"      class="numeric">[%- LxERP.format_amount(items_sum_diff,      2, 0) %]</td>
101 </tr>
102 <tr>
103  [% IF SELF.orphaned || AUTH.assert('assembly_edit', 1) %]
104  <td></td>
105  <td></td>
106  [% END %]
107  <td></td>
108  <td></td>
109  <td></td>
110  <td></td>
111  <td></td>
112  <td></td>
113  <td></td>
114  <td></td>
115  <td></td>
116  <td align="right">[% L.button_tag("kivi.Part.set_assembly_sellprice()", LxERP.t8("Set sellprice")) %]</td>
117  <td></td>
118 </tr>
119 </tbody>
120 </table>
121 </div>
122 [% L.sortable_element('#assembly_rows') %]
123
124 <div>
125 <p>
126 </p>
127 </div>
128
129
130 </div>
131
132 <script type="text/javascript">
133   $(function() {
134     $("#assembly").on( "focusout", ".recalc", function( event )  {
135       kivi.Part.assembly_recalc();
136     });
137
138     $('#assembly_rows').on('sortstop', function(event, ui) {
139       $('#assembly thead a img').remove();
140       kivi.Part.renumber_positions();
141     });
142   })
143 </script>