From ecc3f8bc2af5b6f64ddf3a58967f3cb2cbac3977 Mon Sep 17 00:00:00 2001 From: "Martin Helmling martin.helmling@octosoft.eu" Date: Wed, 23 Oct 2019 16:03:00 +0200 Subject: [PATCH] =?utf8?q?Inventory=20Helper:=20Dokument=20f=C3=BCr=20Allo?= =?utf8?q?cations=20extra?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sollen beim Produzieren/Abfüllen für die notwendigen Artikel auch Dokumente angegeben werden, so müssen diese extra in die Allocation Struktur eingebracht werden. Automatischer Test angepasst: Inventoryhelper nun mit Parameter oe_id zu #11216 --- SL/Helper/Inventory.pm | 13 ++++++++++--- t/wh/inventory.t | 4 +++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/SL/Helper/Inventory.pm b/SL/Helper/Inventory.pm index 1225a7d52..4da9bb798 100644 --- a/SL/Helper/Inventory.pm +++ b/SL/Helper/Inventory.pm @@ -207,6 +207,7 @@ sub allocate { bestbefore => $chunk->{bestbefore}, reserve_for_id => $chunk->{reserve_for_id}, reserve_for_table => $chunk->{reserve_for_table}, + oe_id => undef, ); $rest_qty -= $qty; } @@ -346,7 +347,7 @@ sub produce_assembly { trans_type => $trans_type_out, shippingdate => $shippingdate, employee => SL::DB::Manager::Employee->current, - oe_id => $oe_id, + oe_id => $allocation->oe_id, ); } @@ -381,7 +382,7 @@ sub produce_assembly { } package SL::Helper::Inventory::Allocation { - my @attributes = qw(parts_id qty bin_id warehouse_id chargenumber bestbefore comment reserve_for_id reserve_for_table); + my @attributes = qw(parts_id qty bin_id warehouse_id chargenumber bestbefore comment reserve_for_id reserve_for_table oe_id); my %attributes = map { $_ => 1 } @attributes; for my $name (@attributes) { @@ -463,6 +464,7 @@ SL::WH - Warehouse and Inventory API bestbefore => undef, reserve_for_id => undef, reserve_for_table => undef, + oe_id => $my_document, ); # produce_assembly: @@ -750,12 +752,17 @@ each of the following attributes to be set at creation time: =item * reserve_for_table +=item * oe_id + +Must be explicit set if the allocation needs also an (other) document. + =back -C, C, C and C may +C, C, C, C and oe_id may be C (but must still be present at creation time). Instances are considered immutable. + =head1 CONSTRAINTS # whitelist constraints diff --git a/t/wh/inventory.t b/t/wh/inventory.t index 1a6306d2c..c209436f5 100644 --- a/t/wh/inventory.t +++ b/t/wh/inventory.t @@ -88,7 +88,9 @@ is_deeply(\%{ $allocations[0] }, { reserve_for_id => undef, reserve_for_table => undef, warehouse_id => $wh->id, - }, 'allocatiion works'); + comment => undef, + oe_id => undef, + }, 'allocation works'); # simple -- 2.20.1