You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Luis Espinoza (Jira)" <ji...@apache.org> on 2021/05/19 16:08:00 UTC
[jira] [Commented] (FINERACT-9) Repayment Transactions allocated to
FINANCIAL_ACTIVITY.LIABILITY_TRANSFER
[ https://issues.apache.org/jira/browse/FINERACT-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17347758#comment-17347758 ]
Luis Espinoza commented on FINERACT-9:
--------------------------------------
Hi [~BLasan], do you have an update on this?
Regards.
> 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
> Assignee: Benura Abeywardena
> Priority: Major
> Labels: 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.3.4#803005)