From 8ee7fcb0ed6575b116050ccbe711a26f7d1a86fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 22 Nov 2021 00:13:36 +0100 Subject: [PATCH] DeliveryOrder: stock info im dom speichern --- SL/Controller/DeliveryOrder.pm | 20 +++++++++++-------- js/kivi.DeliveryOrder.js | 10 ++++++---- .../webpages/delivery_order/stock_dialog.html | 1 + .../webpages/delivery_order/tabs/_row.html | 1 + 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/SL/Controller/DeliveryOrder.pm b/SL/Controller/DeliveryOrder.pm index 42ee5d5ad..61e614e66 100644 --- a/SL/Controller/DeliveryOrder.pm +++ b/SL/Controller/DeliveryOrder.pm @@ -890,10 +890,12 @@ sub action_return_from_create_part { sub action_stock_in_out_dialog { my ($self) = @_; - my $part = SL::DB::Part->load_cached($::form->{parts_id}) or die "need parts_id"; - my $stock = $::form->{stock}; - my $unit = $::form->{unit}; - my $qty = _parse_number($::form->{qty_as_number}); + my $part = SL::DB::Part->load_cached($::form->{parts_id}) or die "need parts_id"; + my $stock = $::form->{stock}; + my $unit = $::form->{unit}; + my $row = $::form->{row}; + my $item_id = $::form->{item_id}; + my $qty = _parse_number($::form->{qty_as_number}); my $inout = $self->type_data->transfer; @@ -904,10 +906,12 @@ sub action_stock_in_out_dialog { $self->render("delivery_order/stock_dialog", { layout => 0 }, WHCONTENTS => $self->order->delivered ? $stock_info : \@contents, - part => $part, - do_qty => $qty, - do_unit => $unit, - delivered => $self->order->delivered, + part => $part, + do_qty => $qty, + do_unit => $unit, + delivered => $self->order->delivered, + row => $row, + itme_id => $item_id, ); } diff --git a/js/kivi.DeliveryOrder.js b/js/kivi.DeliveryOrder.js index d937a51ce..87fca36fb 100644 --- a/js/kivi.DeliveryOrder.js +++ b/js/kivi.DeliveryOrder.js @@ -119,12 +119,14 @@ namespace('kivi.DeliveryOrder', function(ns) { let row = $(".data-row").val(); - $.post("controller.pl", kivi.serialize({ - action: "DeliveryOrder/pack_stock_information", - stock_info: data + $.post("controller.pl", + kivi.serialize({ + action: "DeliveryOrder/pack_stock_information", + stock_info: data, + row: row }), (data) => { - $("[name=stock_info_" + row + "]").val(data); + $("#" + row + " .data-stock-info").val(data); $("#stock_in_out_dialog").dialog("close"); } ); diff --git a/templates/webpages/delivery_order/stock_dialog.html b/templates/webpages/delivery_order/stock_dialog.html index 40fa8556c..f4935cf4f 100644 --- a/templates/webpages/delivery_order/stock_dialog.html +++ b/templates/webpages/delivery_order/stock_dialog.html @@ -30,6 +30,7 @@ [% L.hidden_tag("do_qty", do_qty) %] [% L.hidden_tag("do_unit", do_unit) %] [% L.hidden_tag("row", row, class="data-row") %] + [% L.hidden_tag("item_id", item_id) %]

diff --git a/templates/webpages/delivery_order/tabs/_row.html b/templates/webpages/delivery_order/tabs/_row.html index d6aebb949..ce9ce75ae 100644 --- a/templates/webpages/delivery_order/tabs/_row.html +++ b/templates/webpages/delivery_order/tabs/_row.html @@ -16,6 +16,7 @@ [%- END %] [% L.hidden_tag("orderitem_ids[+]", ID) %] [% L.hidden_tag("converted_from_orderitems_ids[+]", ITEM.converted_from_orderitems_id) %] + [% L.hidden_tag("stock_info[+]", ITEM.stock_info, class="data-stock-info") %] [% L.hidden_tag("order.orderitems[+].id", ITEM.id, id='item_' _ ID) %] [% L.hidden_tag("order.orderitems[].parts_id", ITEM.parts_id) %] -- 2.20.1