MIFOSX-601: fix issue with negative interest been calculated due to incorrect calculation of end of day balance.
This commit is contained in:
+4
-1
@@ -277,7 +277,10 @@ public final class SavingsAccountTransaction extends AbstractPersistable<Long> {
|
||||
if (isDeposit()) {
|
||||
endOfDayBalance = openingBalance.plus(getAmount(currency));
|
||||
} else if (isWithdrawal() || isWithdrawalFeeAndNotReversed()) {
|
||||
endOfDayBalance = openingBalance.minus(getAmount(currency));
|
||||
|
||||
if (openingBalance.isGreaterThanZero()) {
|
||||
endOfDayBalance = openingBalance.minus(getAmount(currency));
|
||||
}
|
||||
}
|
||||
|
||||
return EndOfDayBalance.from(getTransactionLocalDate(), openingBalance, endOfDayBalance, this.balanceNumberOfDays);
|
||||
|
||||
Reference in New Issue
Block a user