Auftrags-Controller: Summen und Steuern nach Löschen von Artikeln neu berechnen.
[kivitendo-erp.git] / templates / webpages / order / tabs / basic_data.html
index 52bb065..83bd048 100644 (file)
@@ -211,6 +211,8 @@ function add_item() {
 function delete_order_item_row(clicked) {
   var row = $(clicked).parents("tr").first();
   $(row).remove();
+
+  recalc_amounts_and_taxes()
 }
 
 function set_item_values(event) {
@@ -236,6 +238,14 @@ function set_item_values(event) {
   $.post("controller.pl", data, kivi.eval_json_result);
 }
 
+function recalc_amounts_and_taxes() {
+  var data = $('#order_form').serialize();
+  data += '&action=Order/recalc_amounts_and_taxes';
+  data += '&type=' + $('#type').val();
+
+  $.post("controller.pl", data, kivi.eval_json_result);
+}
+
 function display_linetotal(item_id, amount) {
   $('#item_' + item_id).parents("tr").first().find('[name="linetotal"]').html(amount);
 }