X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FCsvImport%2FInventory.pm;h=e6f6794710aca6de69d5f3615c444164a800c36d;hb=d6fed9b55a11dca1cfd9cd6f43940a945533d318;hp=456963ba5d7b1d22d206f551f6222fd59c05951c;hpb=17b4e6866fb03df7e2c2a428bcfca11f2f21ee35;p=kivitendo-erp.git diff --git a/SL/Controller/CsvImport/Inventory.pm b/SL/Controller/CsvImport/Inventory.pm index 456963ba5..e6f679471 100644 --- a/SL/Controller/CsvImport/Inventory.pm +++ b/SL/Controller/CsvImport/Inventory.pm @@ -276,11 +276,20 @@ sub check_part { # This imports inventories when target_qty is given, transfers else. # So we get the actual qty in stock and transfer the difference in case of # a given target_qty -sub check_qty{ +sub check_qty { my ($self, $entry) = @_; my $object = $entry->{object}; + # parse qty (may be float values) + if (exists $entry->{raw_data}->{target_qty}) { + $entry->{raw_data}->{target_qty} = $::form->parse_amount(\%::myconfig, $entry->{raw_data}->{target_qty}); + # $object->target_qty($entry->{raw_data}->{target_qty}); + } + if (exists $entry->{raw_data}->{qty}) { + $entry->{raw_data}->{qty} = $::form->parse_amount(\%::myconfig, $entry->{raw_data}->{qty}); + $object->qty($entry->{raw_data}->{qty}); + } if (! exists $entry->{raw_data}->{target_qty} && ! exists $entry->{raw_data}->{qty}) { push @{ $entry->{errors} }, $::locale->text('Error: A quantity or a target quantity must be given.'); return 0;