ShopOrder: billing_email zusätzlich als invoice_mail ...
[kivitendo-erp.git] / js / kivi.DeliveryOrder.js
index 3877e9b..00a9294 100644 (file)
@@ -106,8 +106,12 @@ namespace('kivi.DeliveryOrder', function(ns) {
 
     let data = [];
     $("#stock-in-out-table tr.listrow").each((i,row) => {
+      let qty = kivi.parse_amount($(row).find(".data-qty").val());
+
+      if (qty === 0) return;
+
       data.push({
-        qty:         kivi.parse_amount($(row).find(".data-qty").val()),
+        qty:                           qty,
         warehouse_id:                  $(row).find(".data-warehouse-id").val(),
         bin_id:                        $(row).find(".data-bin-id").val(),
         chargenumber:                  $(row).find(".data-chargenumber").val(),
@@ -121,12 +125,14 @@ namespace('kivi.DeliveryOrder', function(ns) {
 
     $.post("controller.pl",
       kivi.serialize({
-        action:     "DeliveryOrder/pack_stock_information",
+        action:     "DeliveryOrder/update_stock_information",
+        unit:       $("#" + row).find("[name$=unit]").val(),
         stock_info: data,
         row:        row
       }),
       (data) => {
-        $("#" + row + " .data-stock-info").val(data);
+        $("#" + row + " .data-stock-info").val(data.stock_info);
+        $("#" + row + " .data-stock-qty").text(data.stock_qty)
         $("#stock_in_out_dialog").dialog("close");
       }
     );