From 0f19ca7ee7e34f2598e8fd59053abd59b40311ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 28 Jan 2020 15:23:40 +0100 Subject: [PATCH] Helper::Inventory: warnings --- SL/Helper/Inventory.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.20.1