X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=js%2Fkivi.DeliveryOrder.js;h=00a929450168c0c6d8fa96d058789e385ecd2e18;hb=1268bf670c06f5a66ad78a75e41ad6c15061d9bc;hp=87fca36fb124604c447ff993594d0af01d39b633;hpb=8ee7fcb0ed6575b116050ccbe711a26f7d1a86fc;p=kivitendo-erp.git diff --git a/js/kivi.DeliveryOrder.js b/js/kivi.DeliveryOrder.js index 87fca36fb..00a929450 100644 --- a/js/kivi.DeliveryOrder.js +++ b/js/kivi.DeliveryOrder.js @@ -91,8 +91,8 @@ namespace('kivi.DeliveryOrder', function(ns) { type: $("#type").val(), parts_id: $row.find("[name$=parts_id]").val(), unit: $row.find("[name$=unit]").val(), - qty_as_number: $("qty_" + id).val(), - stock: $("stock_" + id).val(), + qty_as_number: $row.find("[name$=qty_as_number]").val(), + stock: $row.find("[name$=stock_info]").val(), item_id: id, row: $row.attr("id"), }, @@ -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"); } );