diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java index c9db05ff0..b2b71a28f 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccountTransaction.java @@ -571,7 +571,7 @@ public final class SavingsAccountTransaction extends AbstractPersistableCustom { endOfDayBalance = openingBalance.plus(getAmount(currency)); } else if (isWithdrawal() || isChargeTransactionAndNotReversed()) { - if (openingBalance.isGreaterThanZero()) { + if (openingBalance.isGreaterThanZero() || this.savingsAccount.allowOverdraft()) { endOfDayBalance = openingBalance.minus(getAmount(currency)); } else { endOfDayBalance = Money.of(currency, this.runningBalance); @@ -603,7 +603,7 @@ public final class SavingsAccountTransaction extends AbstractPersistableCustom { // } } else if (isWithdrawal() || isChargeTransactionAndNotReversed()) { // endOfDayBalance = openingBalance.minus(getAmount(currency)); - if (endOfDayBalance.isGreaterThanZero()) { + if (endOfDayBalance.isGreaterThanZero() || this.savingsAccount.allowOverdraft()) { endOfDayBalance = endOfDayBalance.minus(getAmount(currency)); } else { endOfDayBalance = Money.of(currency, this.runningBalance);