From: Sven Schöling Date: Tue, 28 Jan 2020 14:23:40 +0000 (+0100) Subject: Helper::Inventory: warnings X-Git-Tag: kivitendo-mebil_0.1-0~9^2~610 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0f19ca7ee7e34f2598e8fd59053abd59b40311ac;p=kivitendo-erp.git Helper::Inventory: warnings --- diff --git a/SL/Helper/Inventory.pm b/SL/Helper/Inventory.pm index 17a7d98c0..9d4ee96a0 100644 --- a/SL/Helper/Inventory.pm +++ b/SL/Helper/Inventory.pm @@ -187,9 +187,9 @@ sub allocate { # sort results so that reserve_for is first, then chargenumbers, then wanted bins, then wanted warehouses my @sorted_results = sort { (!!$b->{reserve_for_id}) <=> (!!$a->{reserve_for_id}) # sort by existing reserve_for_id first. - || $chargenumbers{$b->{chargenumber}} <=> $chargenumbers{$a->{chargenumber}} # then prefer wanted chargenumbers - || $bin_whitelist{$b->{bin_id}} <=> $bin_whitelist{$a->{bin_id}} # then prefer wanted bins - || $wh_whitelist{$b->{warehouse_id}} <=> $wh_whitelist{$a->{warehouse_id}} # then prefer wanted bins + || exists $chargenumbers{$b->{chargenumber}} <=> exists $chargenumbers{$a->{chargenumber}} # then prefer wanted chargenumbers + || exists $bin_whitelist{$b->{bin_id}} <=> exists $bin_whitelist{$a->{bin_id}} # then prefer wanted bins + || exists $wh_whitelist{$b->{warehouse_id}} <=> exists $wh_whitelist{$a->{warehouse_id}} # then prefer wanted bins } @filtered_results; my @allocations; my $rest_qty = $qty;