diff --git a/app/src/main/java/org/foxarmy/barcodescannerforemployees/Parser.kt b/app/src/main/java/org/foxarmy/barcodescannerforemployees/Parser.kt index e046688..91c2f68 100644 --- a/app/src/main/java/org/foxarmy/barcodescannerforemployees/Parser.kt +++ b/app/src/main/java/org/foxarmy/barcodescannerforemployees/Parser.kt @@ -13,8 +13,9 @@ class Parser constructor() { val found = foundByRegex.groupValues[0] text = text.replace(found, "") netWeight = stripNetWeight(found) -// } return Triple(text, netWeight, found) + } else { + return Triple(text, 0.0, "") } } return Triple("", 0.0, "") @@ -40,7 +41,9 @@ class Parser constructor() { "мл" -> { 3 } "шт" -> { 4 } - else -> { -1 } + else -> { + 4 + } } return AbstractProduct(0, "", name, netWeight, "", 0, unitNumber)