[
https://issues.apache.org/jira/browse/FINERACT-9?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Adam Saghy reassigned FINERACT-9:
---------------------------------
Assignee: (was: Benura Abeywardena)
> Repayment Transactions allocated to FINANCIAL_ACTIVITY.LIABILITY_TRANSFER
> -------------------------------------------------------------------------
>
> Key: FINERACT-9
> URL: https://issues.apache.org/jira/browse/FINERACT-9
> Project: Apache Fineract
> Issue Type: Bug
> Components: Loan
> Reporter: Dayna Harp
> Priority: Major
> Labels: UpdateRequired, p2
>
> https://mifosforge.jira.com/browse/MIFOSX-2438
> All repayment transactions after an account transfer transaction are
> allocated to FINANCIAL_ACTIVITY.LIABILITY_TRANSFER accountAll repayment
> transactions after an account transfer transaction are allocated to
> FINANCIAL_ACTIVITY.LIABILITY_TRANSFER account.
> This is cause by the "isAccountTransfer" boolean outside the for loop on line
> 108 in
> "https://github.com/openMF/mifosx/blob/develop/mifosng-provider/src/main/java/org/mifosplatform/accounting/journalentry/service/AccountingProcessorHelper.java"
> The boolean should be in the for loop.
> boolean isAccountTransfer = (Boolean)
> accountingBridgeData.get("isAccountTransfer");
> @SuppressWarnings("unchecked")
> final List<Map<String, Object>> newTransactionsMap =
> (List<Map<String, Object>>) accountingBridgeData.get("newLoanTransactions");
> for (final Map<String, Object> map : newTransactionsMap) {
> final Long transactionOfficeId = (Long) map.get("officeId");
> final String transactionId = ((Long) map.get("id")).toString();
> final Date transactionDate = ((LocalDate)
> map.get("date")).toDate();
> final LoanTransactionEnumData transactionType =
> (LoanTransactionEnumData) map.get("type");
> final BigDecimal amount = (BigDecimal) map.get("amount");
> final BigDecimal principal = (BigDecimal)
> map.get("principalPortion");
> final BigDecimal interest = (BigDecimal)
> map.get("interestPortion");
> final BigDecimal fees = (BigDecimal) map.get("feeChargesPortion");
> final BigDecimal penalties = (BigDecimal)
> map.get("penaltyChargesPortion");
> final BigDecimal overPayments = (BigDecimal)
> map.get("overPaymentPortion");
> final boolean reversed = (Boolean) map.get("reversed");
> final Long paymentTypeId = (Long) map.get("paymentTypeId");
> final List<ChargePaymentDTO> feePaymentDetails = new
> ArrayList<>();
> final List<ChargePaymentDTO> penaltyPaymentDetails = new
> ArrayList<>();
> // extract charge payment details (if exists)
> if (map.containsKey("loanChargesPaid")) {
> @SuppressWarnings("unchecked")
> final List<Map<String, Object>> loanChargesPaidData =
> (List<Map<String, Object>>) map.get("loanChargesPaid");
> for (final Map<String, Object> loanChargePaid :
> loanChargesPaidData) {
> final Long chargeId = (Long)
> loanChargePaid.get("chargeId");
> final Long loanChargeId = (Long)
> loanChargePaid.get("loanChargeId");
> final boolean isPenalty = (Boolean)
> loanChargePaid.get("isPenalty");
> final BigDecimal chargeAmountPaid = (BigDecimal)
> loanChargePaid.get("amount");
> final ChargePaymentDTO chargePaymentDTO = new
> ChargePaymentDTO(chargeId, loanChargeId, chargeAmountPaid);
> if (isPenalty) {
> penaltyPaymentDetails.add(chargePaymentDTO);
> } else {
> feePaymentDetails.add(chargePaymentDTO);
> }
> }
> }
> if (!isAccountTransfer) {
--
This message was sent by Atlassian Jira
(v8.20.10#820010)