You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by pt...@apache.org on 2021/11/29 18:56:55 UTC
[fineract] branch develop updated: FINERACT-1447 : Fix - Overdraft interest calculated is wrong
This is an automated email from the ASF dual-hosted git repository.
ptuomola pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new d1bbf57 FINERACT-1447 : Fix - Overdraft interest calculated is wrong
d1bbf57 is described below
commit d1bbf57d9a501696c9d604b1bcddd67686c33eb5
Author: sheminanto <sh...@gmail.com>
AuthorDate: Mon Nov 29 17:57:20 2021 +0530
FINERACT-1447 : Fix - Overdraft interest calculated is wrong
---
.../fineract/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 c9db05f..b2b71a2 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);