]> wagnertech.de Git - mfinanz.git/blobdiff - templates/webpages/order/tabs/basic_data.html
Auftrags-Controller: linetotal nach Ändern von Menge/Preis/Rabatt neu berechnen.
[mfinanz.git] / templates / webpages / order / tabs / basic_data.html
index fffd88c19998e271e7e9217329c0357916789d03..2c9598d52c99a61ad6ec3a13360bd99619e4200c 100644 (file)
@@ -216,6 +216,12 @@ function recalc_amounts_and_taxes() {
   $.post("controller.pl", data, kivi.eval_json_result);
 }
 
+function redisplay_linetotals(data) {
+  $('.row_entry [name="linetotal"]').each(function(idx, elt) {
+    $(elt).html(data[idx]);    
+  });
+}
+
 function row_table_scroll_down() {
   $('#row_table_scroll_id').scrollTop($('#row_table_scroll_id')[0].scrollHeight);
 }
@@ -227,24 +233,29 @@ function row_set_keyboard_events_by_id(item_id) {
 }
 
 function row_set_keyboard_events(rows) {
-  console.log(rows);
-
   $(rows).keydown(function(event) {
     if(event.keyCode == 40 && event.shiftKey == true) {
       // shift arrow down
       event.preventDefault();
-      var row = $(event.target).parents("tbody").first();
+      var row = $(event.target).parents(".row_entry").first();
       $(row).children().not(':first').show();
       return false;
     }
     if(event.keyCode == 38 && event.shiftKey == true) {
       // shift arrow up
       event.preventDefault();
-      var row = $(event.target).parents("tbody").first();
+      var row = $(event.target).parents(".row_entry").first();
       $(row).children().not(':first').hide();
       return false;
     }
   });
+
+  $(rows).dblclick(function(event) {
+      event.preventDefault();
+      var row = $(event.target).parents(".row_entry").first();
+      $(row).children().not(':first').toggle();
+      return false;
+  });
 }
 
 $(function(){
@@ -259,6 +270,7 @@ $(function(){
     }
   });
   row_set_keyboard_events($('.row_entry'));
+  $('.recalc').change(recalc_amounts_and_taxes);
 });
 
 </script>