From: Sven Schöling Date: Fri, 16 Oct 2020 16:08:20 +0000 (+0200) Subject: Inventory: production order und recipe features entfernt X-Git-Tag: kivitendo-mebil_0.1-0~9^2~595 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e6291c8bcf7f446b8b5493efdb9aa986b32b2b6b;p=kivitendo-erp.git Inventory: production order und recipe features entfernt --- 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