FINERACT-1447 : Fix - Overdraft interest calculated is wrong
This commit is contained in:
committed by
Petri Tuomola
parent
b845fe277b
commit
d1bbf57d9a
+2
-2
@@ -571,7 +571,7 @@ public final class SavingsAccountTransaction extends AbstractPersistableCustom {
|
|||||||
endOfDayBalance = openingBalance.plus(getAmount(currency));
|
endOfDayBalance = openingBalance.plus(getAmount(currency));
|
||||||
} else if (isWithdrawal() || isChargeTransactionAndNotReversed()) {
|
} else if (isWithdrawal() || isChargeTransactionAndNotReversed()) {
|
||||||
|
|
||||||
if (openingBalance.isGreaterThanZero()) {
|
if (openingBalance.isGreaterThanZero() || this.savingsAccount.allowOverdraft()) {
|
||||||
endOfDayBalance = openingBalance.minus(getAmount(currency));
|
endOfDayBalance = openingBalance.minus(getAmount(currency));
|
||||||
} else {
|
} else {
|
||||||
endOfDayBalance = Money.of(currency, this.runningBalance);
|
endOfDayBalance = Money.of(currency, this.runningBalance);
|
||||||
@@ -603,7 +603,7 @@ public final class SavingsAccountTransaction extends AbstractPersistableCustom {
|
|||||||
// }
|
// }
|
||||||
} else if (isWithdrawal() || isChargeTransactionAndNotReversed()) {
|
} else if (isWithdrawal() || isChargeTransactionAndNotReversed()) {
|
||||||
// endOfDayBalance = openingBalance.minus(getAmount(currency));
|
// endOfDayBalance = openingBalance.minus(getAmount(currency));
|
||||||
if (endOfDayBalance.isGreaterThanZero()) {
|
if (endOfDayBalance.isGreaterThanZero() || this.savingsAccount.allowOverdraft()) {
|
||||||
endOfDayBalance = endOfDayBalance.minus(getAmount(currency));
|
endOfDayBalance = endOfDayBalance.minus(getAmount(currency));
|
||||||
} else {
|
} else {
|
||||||
endOfDayBalance = Money.of(currency, this.runningBalance);
|
endOfDayBalance = Money.of(currency, this.runningBalance);
|
||||||
|
|||||||
Reference in New Issue
Block a user