From 2951ed3090fdde3f3fd7f4af23e6ec61d1b52e3b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 16 Oct 2020 14:11:05 +0200 Subject: [PATCH] Inventory Helper: _qty auf _number umgestellt --- SL/Helper/Inventory.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SL/Helper/Inventory.pm b/SL/Helper/Inventory.pm index cd5090780..92c495141 100644 --- a/SL/Helper/Inventory.pm +++ b/SL/Helper/Inventory.pm @@ -13,7 +13,7 @@ use SL::Locale::String qw(t8); use SL::MoreCommon qw(listify); use SL::DBUtils qw(selectall_hashref_query selectrow_query); use SL::DB::TransferType; -use SL::Helper::Number qw(_round_qty _qty); +use SL::Helper::Number qw(_number _round_number); use SL::X; our @EXPORT_OK = qw(get_stock get_onhand allocate allocate_for_assembly produce_assembly check_constraints); @@ -226,15 +226,15 @@ sub allocate { reserve_for_table => $chunk->{reserve_for_table}, for_object_id => undef, ); - $rest_qty -= _round_qty($qty); + $rest_qty -= _round_number($qty, 5); } - $rest_qty = _round_qty($rest_qty); + $rest_qty = _round_number($rest_qty, 5); last if $rest_qty == 0; } if ($rest_qty > 0) { die SL::X::Inventory::Allocation->new( error => 'not enough to allocate', - msg => t8("can not allocate #1 units of #2, missing #3 units", _qty($qty), $part->displayable_name, _qty($rest_qty)), + msg => t8("can not allocate #1 units of #2, missing #3 units", _number(\%::myconfig, $qty), $part->displayable_name, _number(\%::myconfig, $rest_qty)), ); } else { if ($params{constraints}) { @@ -313,7 +313,7 @@ sub check_constraints { $err .= ' '.t8('part \'#\'1 in bin \'#2\' only with qty #3 (need additional #4) and chargenumber \'#5\'.', SL::DB::Part->load_cached($_->parts_id)->description, SL::DB::Bin->load_cached($_->bin_id)->full_description, - _qty($_->qty), _qty($needed), $_->chargenumber ? $_->chargenumber : '--') for @allocs; + _number($_->qty), _number($needed), $_->chargenumber ? $_->chargenumber : '--') for @allocs; die SL::X::Inventory::Allocation->new( error => 'allocation constraints failure', msg => $err, -- 2.20.1