]> wagnertech.de Git - mfinanz.git/blobdiff - templates/webpages/order/tabs/basic_data.html
Auftrags-Controller: Zentrale Eingabe-Zeile oben.
[mfinanz.git] / templates / webpages / order / tabs / basic_data.html
index 67ce0e2faab51226d83d30a0ccbf4a4b08cabd52..52bb065d77c14f30b7289f8f6362c5faad00efdd 100644 (file)
     </tr>
   </table>
 
+ <div>
+  <table id="input_row_table_id">
+    <thead>
+      <tr class="listheading">
+        <th class="listheading" nowrap >[%- 'Part'         | $T8 %] </th>
+        <th class="listheading" nowrap width="5" >[%- 'Qty'          | $T8 %] </th>
+        <th class="listheading" nowrap width="15">[%- 'Price'        | $T8 %] </th>
+        <th class="listheading" nowrap width="5" >[%- 'Discount'     | $T8 %] </th>
+        <th></th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr valign="top" class="listrow">
+        <td>[% L.part_picker('add_item.parts_id', '', style='width: 300px') %]</td>
+        <td>[% L.input_tag('add_item.qty_as_number', '', size = 5, style='text-align:right') %]</td>
+        <td>[% L.input_tag('add_item.sellprice_as_number', '', size = 10, style='text-align:right') %]</td>
+        <td>[% L.input_tag('add_item.discount_as_percent', '', size = 5, style='text-align:right') %]</td>
+        <td>[% L.button_tag('add_item()', LxERP.t8('Add part')) %]</td>
+      </tr>
+    </tbody>
+  </table>
+
+ </div>
+
   <table width="100%">
     <tr>
       <td>
             [%- FOREACH item = SELF.order.items_sorted %]
               [%- PROCESS order/tabs/_row.html ITEM=item %]
             [%- END %]
-            [%- IF !SELF.order.items.size %]
-              [%- PROCESS order/tabs/_row.html ITEM='' %]
-            [%- END %]
           </tbody>
 
         </table>
     <tr>
     </tr>
 
-    <tr>
-      <td>[%- L.button_tag('add_order_item_row()', LxERP.t8("Add Row")) -%]</td>
-    </tr>
-
     <tr>
       <td align="right">
         <table>
           [%- IF NOT taxincluded %]
           <tr>
             <th align="right">[%- 'Subtotal' | $T8 %]</th>
-            <td align="right">[%- SELF.order.netamount_as_number %]</td>
+            <td align="right">
+              [%- L.div_tag(SELF.order.netamount_as_number, id='netamount_id') %]
+            </td>
           </tr>
           [%- END %]
           [%- FOREACH tax = SELF.taxes %]
-          <tr>
-            <th align="right">[%- tax.tax.description %] [% tax.tax.rate_as_percent %]%</th>
-            <td align="right">[%- LxERP.format_amount(tax.amount, 2, 0) %]</td>
-          </tr>
+            [%- PROCESS order/tabs/_tax_row.html TAX=tax %]
           [%- END %]
-          <tr>
+          <tr id="amount_row_id">
             <th align="right">[%- 'Total' | $T8 %]</th>
-            <td align="right">[%- SELF.order.amount_as_number %]</td>
+            <td align="right">
+              [%- L.div_tag(SELF.order.amount_as_number, id='amount_id') %]
           </tr>
         </table>
       </td>
@@ -183,10 +200,12 @@ function reload_cv_dependend_selections() {
                           }, kivi.eval_json_result);
 }
 
-function add_order_item_row() {
-  $.post("controller.pl", { 'action': 'Order/add_item_row',
-                            'type'  : function(){ return $('#type').val() }
-                          }, kivi.eval_json_result);
+function add_item() {
+  var data = $('#order_form').serialize();
+  data += '&action=Order/add_item';
+  data += '&type=' + $('#type').val();
+
+  $.post("controller.pl", data, kivi.eval_json_result);
 }
 
 function delete_order_item_row(clicked) {
@@ -217,7 +236,7 @@ function set_item_values(event) {
   $.post("controller.pl", data, kivi.eval_json_result);
 }
 
-function recalc_linetotal(item_id, amount) {
+function display_linetotal(item_id, amount) {
   $('#item_' + item_id).parents("tr").first().find('[name="linetotal"]').html(amount);
 }