From: Sven Schöling Date: Fri, 17 Dec 2021 18:18:03 +0000 (+0100) Subject: DeliveryOrder: absicherung gegen leere stock Einträge X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~216^2~20 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4bd6ac8abe7a2080328d203354c8c532f9187a88;p=kivitendo-erp.git DeliveryOrder: absicherung gegen leere stock Einträge --- diff --git a/SL/Controller/DeliveryOrder.pm b/SL/Controller/DeliveryOrder.pm index fe24d753f..b6c720945 100644 --- a/SL/Controller/DeliveryOrder.pm +++ b/SL/Controller/DeliveryOrder.pm @@ -1061,7 +1061,7 @@ sub action_transfer_stock { my $transfer = SL::DB::Inventory->new_from($stock); $transfer->trans_type($trans_type); - push @transfer_requests, $transfer; + push @transfer_requests, $transfer if defined $transfer->qty && $transfer->qty != 0; }; } @@ -1378,7 +1378,7 @@ sub make_item { $obj->$_($line->{$_}) for qw(bin_id warehouse_id chargenumber qty unit); $obj->bestbefore_as_date($line->{bestfbefore}) if $line->{bestbefore} && $::instance_conf->get_show_bestbefore; - push @save, $obj; + push @save, $obj if $obj->qty; } $item->delivery_order_stock_entries(@save); diff --git a/js/kivi.DeliveryOrder.js b/js/kivi.DeliveryOrder.js index 82149b1c8..00a929450 100644 --- a/js/kivi.DeliveryOrder.js +++ b/js/kivi.DeliveryOrder.js @@ -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(),