]> wagnertech.de Git - mfinanz.git/blobdiff - templates/webpages/order/tabs/_item_input.html
date error in mapping
[mfinanz.git] / templates / webpages / order / tabs / _item_input.html
index 7d76df2c09e3d2656e0976563b00081901a03b39..3db001119da0268e291b3a29367cf7c9cc85a9a1 100644 (file)
@@ -1,9 +1,10 @@
 [%- USE T8 %][%- USE HTML %][%- USE LxERP %][%- USE L %][%- USE P %]
 
- <div>
+<div>
   <table id="input_row_table_id">
     <thead>
       <tr class="listheading">
+        <th class="listheading" nowrap >[%- '+'            | $T8 %] </th>
         <th class="listheading" nowrap >[%- 'position'     | $T8 %] </th>
         <th class="listheading" nowrap >[%- 'Part'         | $T8 %] </th>
         <th class="listheading" nowrap >[%- 'Description'  | $T8 %] </th>
     </thead>
     <tbody>
       <tr valign="top" class="listrow">
+        <td class="tooltipster-html" title="[%- 'Create a new part' | $T8 -%]">
+          [% SET type_options = [[ 'part', LxERP.t8('Part') ], [ 'assembly', LxERP.t8('Assembly') ], [ 'service', LxERP.t8('Service') ] ] %]
+          [%- type_options.push([ 'assortment', LxERP.t8('Assortment')]) %]
+          [% L.select_tag('add_item.create_part_type', type_options) %]
+          [% L.button_tag('kivi.Order.create_part()', LxERP.t8('+')) %]
+        </td>
         <td>[% L.input_tag('add_item.position', '', size = 5, class="add_item_input numeric") %]</td>
         <td>
           [%- SET PARAM_KEY = SELF.cv == "customer" ? 'with_customer_partnumber' : 'with_makemodel' -%]
           [%- SET PARAM_VAL = SELF.search_cvpartnumber -%]
-          [% P.part.picker('add_item.parts_id', '', style='width: 300px', class="add_item_input",
-                            fat_set_item=1,
+          [% P.part.picker('add_item.parts_id', SELF.created_part, style='width: 300px', class="add_item_input",
                             multiple_pos_input=1,
                             action={set_multi_items='kivi.Order.add_multi_items'},
+                            classification_id=SELF.part_picker_classification_ids.as_list.join(','),
+                            not_order_locked=SELF.type_data.no_order_locked_parts,
                             $PARAM_KEY=PARAM_VAL) %]</td>
-        <td>[% L.input_tag('add_item.description', '', class="add_item_input") %]</td>
+        <td>[% L.input_tag('add_item.description', SELF.created_part.description, class="add_item_input") %]</td>
         <td>
-          [% L.input_tag('add_item.qty_as_number', '', size = 5, class="add_item_input numeric") %]
-          [% L.hidden_tag('add_item.unit', '', class="add_item_input") %]
+          [% L.input_tag('add_item.qty_as_number', '', placeholder="1", size = 5, class="add_item_input numeric") %]
+          [% L.hidden_tag('add_item.unit', SELF.created_part.unit, class="add_item_input") %]
         </td>
-        <td>[% L.input_tag('add_item.sellprice_as_number', '', size = 10, class="add_item_input numeric") %]</td>
-        <td>[% L.input_tag('add_item.discount_as_percent', '', size = 5, class="add_item_input numeric") %]</td>
+        [%- SET price = '' %]
+        [%- IF SELF.created_part %]
+          [%- SET price = LxERP.format_amount(((SELF.type == 'sales_quotation' || SELF.type == 'sales_order_intake' || SELF.type == 'sales_order') ? SELF.created_part.sellprice : SELF.created_part.lastcost), -2) -%]
+        [%- END %]
+        <td>[% L.input_tag('add_item.sellprice_as_number', price, size = 10, class="add_item_input numeric tooltipster-html") %]</td>
+        <td>[% L.input_tag('add_item.discount_as_percent', '', size = 5, class="add_item_input numeric tooltipster-html") %]</td>
         <td>[% L.button_tag('kivi.Order.add_item()', LxERP.t8('Add part')) %]</td>
       </tr>
     </tbody>