diff --git a/backend/src/receipt-import/receipt-import.service.ts b/backend/src/receipt-import/receipt-import.service.ts index 15a0a910..21222831 100644 --- a/backend/src/receipt-import/receipt-import.service.ts +++ b/backend/src/receipt-import/receipt-import.service.ts @@ -81,7 +81,7 @@ function inferPackageDebugFromRawName(rawName: string): { } // e.g. "5dl", "1,5l" - const singlePack = /(\d+(?:[\.,]\d+)?)\s*(ml|cl|dl|l|g|kg)\b/i.exec(normalized); + const singlePack = /(\d+(?:[\.,]\d+)?)\s*(ml|cl|dl|l|g|kg)\b/i.exec(normalized.replace(/([\d.,]+)(ml|cl|dl|l|g|kg)\b/i, '$1 $2')); if (singlePack) { const qty = Number.parseFloat(singlePack[1].replace(',', '.')); const unit = singlePack[2].toLowerCase();