From d1bbf57d9a501696c9d604b1bcddd67686c33eb5 Mon Sep 17 00:00:00 2001 From: sheminanto Date: Mon, 29 Nov 2021 17:57:20 +0530 Subject: [PATCH] FINERACT-1447 : Fix - Overdraft interest calculated is wrong --- .../portfolio/savings/domain/SavingsAccountTransaction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);