Add negative stock values to import [SCI-10855]

This commit is contained in:
Anton 2024-07-12 13:23:40 +02:00
parent 7b1b71cfff
commit 9c5b564bd0

View file

@ -167,7 +167,7 @@ class RepositoryStockValue < ApplicationRecord
end
def self.import_from_text(text, attributes, _options = {})
digit, unit = text.match(/(^\d*\.?\d*)(\D*)/).captures
digit, unit = text.match(/(^-?\d*\.?\d*)(\D*)/).captures
digit.strip!
unit.strip!
return nil if digit.blank?