]> wagnertech.de Git - mfinanz.git/blobdiff - templates/webpages/part/_assortment.html
date error in mapping
[mfinanz.git] / templates / webpages / part / _assortment.html
index 934bdc459b587000a46d5b11e9cd6d19146952f0..6622311e159baacf6d9f40876e6cdfee3f99cf95 100644 (file)
@@ -2,6 +2,7 @@
 [%- USE HTML %]
 [%- USE LxERP %]
 [%- USE L %]
+[%- USE P %]
 
 <div id="assortment" name="assortment">
 
 
 [% L.hidden_tag('assortment_id', SELF.part.id) %]
 
+<div style="overflow-y: auto; height:65vh;">
 <table id="assortment_items">
  <thead>
    <tr class="listheading">
      <th class="listheading" style='display:none'></th>
-     [% IF SELF.orphaned %]
+     [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
      <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
      [% END %]
      <th class="listheading" nowrap width="3" >[%- 'position'     | $T8 %] </th>
-     [% IF SELF.orphaned %]
+     [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
      <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
      [% END %]
      <th id="partnumber_header_id"  class="listheading" nowrap width="15"><a href='#' onClick='javascript:kivi.Part.reorder_items("partnumber")'> [%- 'Partnumber'  | $T8 %]</a></th>
@@ -26,6 +28,7 @@
      <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
      <th class="listheading" nowrap width="5" >[%- 'Charge'       | $T8 %] </th>
      <th class="listheading" nowrap width="5" >[%- 'Line Total'   | $T8 %] </th>
+     <th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
      <th id="sellprice_header_id"   class="listheading" nowrap width="10" ><a href='#' onClick='javascript:kivi.Part.reorder_items("sellprice")'> [%- 'Sellprice'   | $T8 %]</a></th>
      <th id="lastcost_header_id"   class="listheading" nowrap width="10" ><a href='#' onClick='javascript:kivi.Part.reorder_items("lastcost")'> [%- 'Lastcost'      | $T8 %]</a></th>
      <th id="_header_id"   class="listheading" nowrap width="15" ><a href='#' onClick='javascript:kivi.Part.reorder_items("partsgroup")'> [%- 'Partsgroup'       | $T8 %]</a></th>
 </tbody>
 <tbody id="assortment_input">
 <tr>
- [% IF SELF.orphaned %]
+ [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
  <td></td>
  <td></td>
  <td align="right">[% 'Part' | $T8 %]:</td>
- <td>[% L.part_picker('add_items[+].parts_id', '', style='width: 300px', multiple=1, id='assortment_picker', action={set_multi_items='kivi.Part.set_multi_assortment_items'}) %]</td>
+ <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>
  <td>[%- L.button_tag("kivi.Part.add_assortment_item()", LxERP.t8("Add")) %]</td>
  <td>[% L.button_tag('$("#assortment_picker").data("part_picker").open_dialog()', LxERP.t8('Add multiple items')) %]</td>
  <td>[% L.hidden_tag('add_items[].qty_as_number', 1) %]</td>
  <td></td>
  <td></td>
  <td></td>
- <td></td>
  [% END %]
  <td></td>
+ <td></td>
  <td align="right">[% 'Totals' | $T8 %]:</td>
- <th id="items_sellprice_sum" class="numeric">[%- LxERP.format_amount(items_sellprice_sum, 2, 0) %]</td>
- <th id="items_lastcost_sum"  class="numeric">[%- LxERP.format_amount(items_lastcost_sum,  2, 0) %]</td>
- <th id="items_sum_diff"      class="numeric">[%- LxERP.format_amount(items_sum_diff,      2, 0) %]</td>
+ <th id="items_sellprice_sum" class="numeric">[%- LxERP.format_amount(items_sellprice_sum, 2, 0) %]</th>
+ <th id="items_lastcost_sum"  class="numeric">[%- LxERP.format_amount(items_lastcost_sum,  2, 0) %]</th>
+ <th id="items_sum_diff"      class="numeric">[%- LxERP.format_amount(items_sum_diff,      2, 0) %]</th>
 </tr>
 <tr>
- [% IF SELF.orphaned %]
+ [% IF SELF.orphaned || AUTH.assert('assortment_edit', 1) %]
  <td></td>
  <td></td>
  [% END %]
  <td></td>
  <td></td>
  <td></td>
+ <td></td>
  <td align="right">[% L.button_tag("kivi.Part.set_assortment_sellprice()", LxERP.t8("Set sellprice")) %]</td>
  <td align="right">[% L.button_tag("kivi.Part.set_assortment_lastcost()",  LxERP.t8("Set lastcost"))  %]</td>
  <td></td>
 </tr>
 </tbody>
 </table>
-
+</div>
 [% L.sortable_element('#assortment_rows') %]
 
 </div>