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;
$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,
);
}
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");
}
);
[% 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) %]
<p>
<table id="stock-in-out-table">
[%- 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) %]
</td>