Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / part / _assembly_row.html
diff --git a/templates/webpages/part/_assembly_row.html b/templates/webpages/part/_assembly_row.html
new file mode 100644 (file)
index 0000000..a974212
--- /dev/null
@@ -0,0 +1,63 @@
+[%- USE T8 %]
+[%- USE HTML %]
+[%- USE LxERP %]
+[%- USE L %]
+[%- USE P %]
+  <tr class="listrow[% listrow %] assembly_item_row">
+    <td style='display:none'>
+      [% IF orphaned || AUTH.assert('assembly_edit', 1) %]
+      [% L.hidden_tag("assembly_items[+].parts_id", ITEM.part.id) %]
+      [% END %]
+    </td>
+    <td align="center" [% UNLESS orphaned || AUTH.assert('assembly_edit', 1) %]style='display:none'[% END %]>
+      [%- L.button_tag("kivi.Part.delete_item_row(this)",
+                       LxERP.t8("X")) %] [% # , confirm=LxERP.t8("Are you sure?")) %]
+    </td>
+    <td>
+      <div name="position" class="numeric">
+        [% HTML.escape(position) or HTML.escape(ITEM.position) %]
+      </div>
+    </td>
+    <td align="center" [% UNLESS orphaned || AUTH.assert('assembly_edit', 1) %]style='display:none'[% END %]>
+      <img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]" class="dragdrop">
+    </td>
+    <td nowrap>
+       [% ITEM.part.presenter.part %]
+    </td>
+    <td nowrap>
+       [% P.part.type_abbreviation(ITEM.part.part_type) %][% P.part.classification_abbreviation(ITEM.part.classification_id) %]
+    </td>
+    <td>
+       [% HTML.escape(ITEM.part.description) %]
+    </td>
+    <td>
+    [% IF orphaned || AUTH.assert('assembly_edit', 1) %]
+      [%- L.input_tag("assembly_items[].qty_as_number",
+                      ITEM.qty_as_number,
+                      size = 10,
+                      class="recalc reformat_number numeric") %]
+    [% ELSE %]
+      [% ITEM.qty_as_number | html %]
+    [% END %]
+    </td>
+    <td nowrap>
+      [% ITEM.part.unit | html %]
+    </td>
+    [% IF orphaned || AUTH.assert('assembly_edit', 1) %]
+    <td>[% L.checkbox_tag("assembly_items[].bom", checked=ITEM.bom, for_submit=1) %]</td>
+    [% ELSE %]
+    <td>[% IF ITEM.bom %][% 'Yes' | $T8 %][% ELSE %][% 'No' | $T8 %][% END %]</td>
+    [% END %]
+    <td align="right">
+      [%- L.div_tag(LxERP.format_amount(ITEM.linetotal_sellprice, 3, 0), name="linetotal") %]
+      </td>
+    <td align="right">
+      [% ITEM.part.sellprice_as_number %]
+      </td>
+    <td align="right">
+      [% ITEM.part.lastcost_as_number %]
+      </td>
+    <td align="right">
+      [% HTML.escape(ITEM.part.partsgroup.partsgroup) %]
+      </td>
+  </tr>