Skip to content

Commit

Permalink
Merge pull request #1221 from fiterlatam/fix/FSF-59-QA
Browse files Browse the repository at this point in the history
Fix/fsf 59 qa
  • Loading branch information
BrianMuhimbura authored Oct 17, 2024
2 parents 3ae0a19 + 6f54673 commit bb66692
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1454,9 +1454,9 @@ public void validateAccountBalanceDoesNotBecomeNegative(final BigDecimal transac
LocalDate lastSavingsDate = null;
final BigDecimal withdrawalFee = null;
for (final SavingsAccountTransaction transaction : transactionsSortedByDate) {
if (transaction.isNotReversed() && transaction.isCredit() && !transaction.isReversalTransaction()) {
if (transaction.isNotReversed() && transaction.isCredit() && !transaction.isReversalTransaction() && !transaction.isAmountRelease()) {
runningBalance = runningBalance.plus(transaction.getAmount(this.currency));
} else if (transaction.isNotReversed() && transaction.isDebit() && !transaction.isReversalTransaction()) {
} else if (transaction.isNotReversed() && transaction.isDebit() && !transaction.isReversalTransaction() && !transaction.isAmountOnHold()) {
runningBalance = runningBalance.minus(transaction.getAmount(this.currency));
} else {
continue;
Expand Down Expand Up @@ -1535,9 +1535,9 @@ public void validateAccountBalanceDoesNotBecomeNegative(final String transaction
Money minRequiredBalance = minRequiredBalanceDerived(getCurrency());
LocalDate lastSavingsDate = null;
for (final SavingsAccountTransaction transaction : transactionsSortedByDate) {
if (transaction.isNotReversed() && transaction.isCredit()) {
if (transaction.isNotReversed() && transaction.isCredit() && !transaction.isAmountRelease()) {
runningBalance = runningBalance.plus(transaction.getAmount(this.currency));
} else if (transaction.isNotReversed() && transaction.isDebit()) {
} else if (transaction.isNotReversed() && transaction.isDebit() && !transaction.isAmountOnHold()) {
runningBalance = runningBalance.minus(transaction.getAmount(this.currency));
}

Expand Down

0 comments on commit bb66692

Please sign in to comment.