From e6291c8bcf7f446b8b5493efdb9aa986b32b2b6b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 16 Oct 2020 18:08:20 +0200 Subject: [PATCH] Inventory: production order und recipe features entfernt --- SL/Helper/Inventory.pm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/SL/Helper/Inventory.pm b/SL/Helper/Inventory.pm index 69338622e..6c8066c3f 100644 --- a/SL/Helper/Inventory.pm +++ b/SL/Helper/Inventory.pm @@ -217,8 +217,7 @@ sub allocate_for_assembly { for my $assembly ($part->assemblies) { next if $assembly->part->dispotype eq 'no_stock'; - my $tmpqty = $assembly->assembly_part->is_recipe ? $assembly->qty * $qty / $assembly->assembly_part->scalebasis - : $assembly->part->unit eq 'Stck' ? ceil($assembly->qty * $qty) + my $tmpqty = $assembly->part->unit eq 'Stck' ? ceil($assembly->qty * $qty) : $assembly->qty * $qty; $parts_to_allocate{ $assembly->part->id } //= 0; $parts_to_allocate{ $assembly->part->id } += $tmpqty; @@ -302,7 +301,6 @@ sub produce_assembly { my $for_object_id = $params{for_object_id}; my $comment = $params{comment} // ''; - my $production_order_item = $params{production_order_item}; my $invoice = $params{invoice}; my $project = $params{project}; @@ -318,7 +316,7 @@ sub produce_assembly { if (!$params{no_check_allocations} && !$params{auto_allocate}) { my %allocations_by_part = map { $_->parts_id => $_->qty } @$allocations; for my $assembly ($part->assemblies) { - $allocations_by_part{ $assembly->parts_id } -= $assembly->qty * $qty; # TODO recipe factor + $allocations_by_part{ $assembly->parts_id } -= $assembly->qty * $qty; } die "allocations are insufficient for production" if any { $_ < 0 } values %allocations_by_part; @@ -351,7 +349,6 @@ sub produce_assembly { project => $project, invoice => $invoice, comment => $comment, - prod => $production_order_item, employee => SL::DB::Manager::Employee->current, oe_id => $for_object_id, ); @@ -461,7 +458,6 @@ SL::WH - Warehouse and Inventory API comment => $comment, # optional # links, all optional - production_order_item => $item, ); =head1 DESCRIPTION -- 2.20.1