Make sure our transactions are always positive

Amount cannot be negative
This commit is contained in:
2025-07-09 21:06:23 +02:00
parent 02e91a3951
commit 93037b581c
2 changed files with 9 additions and 5 deletions

View File

@@ -55,8 +55,12 @@ export const parseTransactionLine = (line: string): PastedTransaction | null =>
const quantity = parseInt(quantityStr.replace(/,/g, ''));
// Parse prices
const unitPrice = parseISKAmount(unitPriceStr);
const totalPrice = parseISKAmount(totalAmountStr);
let unitPrice = parseISKAmount(unitPriceStr);
let totalPrice = parseISKAmount(totalAmountStr);
if (totalPrice < 0) {
totalPrice = -totalPrice;
}
return {
date: date.toISOString(),