JohnAlva commented on code in PR #4886:
URL: https://github.com/apache/fineract/pull/4886#discussion_r2265515664
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountInterestPostingServiceImpl.java:
##########
@@ -444,6 +546,26 @@ protected void recalculateDailyBalances(final Money
openingAccountBalance, final
accountTransaction.updateRunningBalance(runningBalance);
addTransactionToExisting(accountTransaction,
savingsAccountData);
+ isTransactionsModified = true;
+ } else if
(overdraftAmount.isNotEqualTo(Money.of(savingsAccountData.getCurrency(),
transaction.getOverdraftAmount()))
+ &&
MathUtil.isLessThanZero(transaction.getRunningBalance())) {
+ SavingsAccountTransactionData accountTransaction =
transaction;
+ if (transaction.isChargeTransaction()) {
+ Set<SavingsAccountChargesPaidByData> chargesPaidBy =
transaction.getSavingsAccountChargesPaid();
+ final Set<SavingsAccountChargesPaidByData>
newChargePaidBy = new HashSet<>();
+ chargesPaidBy.forEach(
+ x ->
newChargePaidBy.add(SavingsAccountChargesPaidByData.instance(x.getChargeId(),
x.getAmount())));
+
transaction.getSavingsAccountChargesPaid().addAll(newChargePaidBy);
+ }
+ // if
(MathUtil.isGreaterThanZero(savingsAccountData.getSummary().getAccountBalance())){
Review Comment:
he unused code has been removed as suggested.
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountInterestPostingServiceImpl.java:
##########
@@ -444,6 +546,26 @@ protected void recalculateDailyBalances(final Money
openingAccountBalance, final
accountTransaction.updateRunningBalance(runningBalance);
addTransactionToExisting(accountTransaction,
savingsAccountData);
+ isTransactionsModified = true;
+ } else if
(overdraftAmount.isNotEqualTo(Money.of(savingsAccountData.getCurrency(),
transaction.getOverdraftAmount()))
+ &&
MathUtil.isLessThanZero(transaction.getRunningBalance())) {
+ SavingsAccountTransactionData accountTransaction =
transaction;
+ if (transaction.isChargeTransaction()) {
+ Set<SavingsAccountChargesPaidByData> chargesPaidBy =
transaction.getSavingsAccountChargesPaid();
+ final Set<SavingsAccountChargesPaidByData>
newChargePaidBy = new HashSet<>();
+ chargesPaidBy.forEach(
+ x ->
newChargePaidBy.add(SavingsAccountChargesPaidByData.instance(x.getChargeId(),
x.getAmount())));
+
transaction.getSavingsAccountChargesPaid().addAll(newChargePaidBy);
+ }
+ // if
(MathUtil.isGreaterThanZero(savingsAccountData.getSummary().getAccountBalance())){
+ // transaction.reverse();
+ // }
+ if (overdraftAmount.isGreaterThanZero()) {
+
transaction.updateOverdraftAmount(overdraftAmount.getAmount());
+ }
+ transaction.updateRunningBalance(runningBalance);
+ // addTransactionToExisting(accountTransaction,
savingsAccountData);
Review Comment:
Same here, it has been removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]