San-43 commented on code in PR #5816:
URL: https://github.com/apache/fineract/pull/5816#discussion_r3162233493
##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java:
##########
@@ -159,6 +164,27 @@ else if (transactionType.isInterestPaymentWaiver() ||
transactionType.isInterest
}
}
+ private void createJournalEntriesForTransfers(final LoanDTO loanDTO, final
LoanTransactionDTO loanTransactionDTO, final Office office) {
+ final Long loanProductId = loanDTO.getLoanProductId();
+ final Long loanId = loanDTO.getLoanId();
+ final String currencyCode = loanDTO.getCurrencyCode();
+
+ final String transactionId = loanTransactionDTO.getTransactionId();
+ final LocalDate transactionDate =
loanTransactionDTO.getTransactionDate();
+ final BigDecimal principalAmount = loanTransactionDTO.getPrincipal();
+
+ if (loanTransactionDTO.getTransactionType().isInitiateTransfer()) {
+ this.helper.createJournalEntriesForLoan(office, currencyCode,
AccrualAccountsForLoan.TRANSFERS_SUSPENSE.getValue(),
+ AccrualAccountsForLoan.LOAN_PORTFOLIO.getValue(),
loanProductId, null, loanId, transactionId, transactionDate,
+ principalAmount);
+ } else if (loanTransactionDTO.getTransactionType().isApproveTransfer()
Review Comment:
Agree. The two branches are almost identical; only the debit and credit
accounts are swapped.
I initially followed the style used in other methods in this processor, such
as `createJournalEntriesForAccruals`, but I agree this case is clearer if we
calculate the debit and credit account mappings first and then call
`createJournalEntriesForLoan(...)` once. I’ll update the PR with that change.
--
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]