my %parts_to_allocate;
for my $assembly ($part->assemblies) {
- next if $assembly->part->dispotype eq 'no_stock';
-
- 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;
+ $parts_to_allocate{ $assembly->part->id } += $assembly->qty * $qty;
}
my @allocations;
The two new functions C<get_stock> and C<get_onhand> encapsulate these principles and
allow simple access with some optional filters for chargenumbers or warehouses.
Both of them have a batch mode that can be used to get these information to
-supllement smiple reports.
+supplement simple reports.
To address the safe assembly creation a new function has been added.
C<allocate> will try to find the requested quantity of a part in the inventory