adamsaghy commented on code in PR #2953:
URL: https://github.com/apache/fineract/pull/2953#discussion_r1102677197
##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java:
##########
@@ -104,10 +105,208 @@ else if
(loanTransactionDTO.getTransactionType().isChargeback()) {
else if
(loanTransactionDTO.getTransactionType().isChargeAdjustment()) {
createJournalEntriesForChargeAdjustment(loanDTO,
loanTransactionDTO, office);
}
+ // Logic for Charge-Off
+ else if (loanTransactionDTO.getTransactionType().isChargeoff()) {
+ createJournalEntriesForChargeOff(loanDTO, loanTransactionDTO,
office);
+ }
+ }
+ }
+
+ private void createJournalEntriesForChargeOff(LoanDTO loanDTO,
LoanTransactionDTO loanTransactionDTO, Office office) {
+ // loan properties
+ final Long loanProductId = loanDTO.getLoanProductId();
+ final Long loanId = loanDTO.getLoanId();
+ final String currencyCode = loanDTO.getCurrencyCode();
+ final boolean isMarkedFraud = loanDTO.isMarkedAsFraud();
+
+ // transaction properties
+ final String transactionId = loanTransactionDTO.getTransactionId();
+ final LocalDate transactionDate =
loanTransactionDTO.getTransactionDate();
+ final BigDecimal principalAmount = loanTransactionDTO.getPrincipal();
+ final BigDecimal interestAmount = loanTransactionDTO.getInterest();
+ final BigDecimal feesAmount = loanTransactionDTO.getFees();
+ final BigDecimal penaltiesAmount = loanTransactionDTO.getPenalties();
+ final Long paymentTypeId = loanTransactionDTO.getPaymentTypeId();
+ final boolean isReversal = loanTransactionDTO.isReversed();
+
+ Map<GLAccount, BigDecimal> accountMapForCredit = new HashMap<>();
+
+ Map<Integer, BigDecimal> accountMapForDebit = new HashMap<>();
Review Comment:
Why GLAccount is the key for credit and Integer for debit? Can we use
similar logic for both?
--
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]