diff --git a/name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/csv/CSVAccountTransactionExtractor.java b/name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/csv/CSVAccountTransactionExtractor.java index d1852b1363..f118625791 100644 --- a/name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/csv/CSVAccountTransactionExtractor.java +++ b/name.abuchen.portfolio/src/name/abuchen/portfolio/datatransfer/csv/CSVAccountTransactionExtractor.java @@ -236,6 +236,17 @@ private Type inferType(String[] rawValues, Map field2column, Sec type = amount.isNegative() ? AccountTransaction.Type.REMOVAL : AccountTransaction.Type.DIVIDENDS; else type = amount.isNegative() ? AccountTransaction.Type.REMOVAL : AccountTransaction.Type.DEPOSIT; + } else { + if (amount.isNegative()) { + if (type == AccountTransaction.Type.DEPOSIT) + type = AccountTransaction.Type.REMOVAL; + else if (type == AccountTransaction.Type.REMOVAL) + type = AccountTransaction.Type.DEPOSIT; + else if (type == AccountTransaction.Type.BUY) + type = AccountTransaction.Type.SELL; + else if (type == AccountTransaction.Type.SELL) + type = AccountTransaction.Type.BUY; + } } return type; }