You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "taskain7 (via GitHub)" <gi...@apache.org> on 2023/04/04 01:10:04 UTC

[GitHub] [fineract] taskain7 opened a new pull request, #3100: [FINERACT-1888] Chargeback acoounting fix

taskain7 opened a new pull request, #3100:
URL: https://github.com/apache/fineract/pull/3100

   ## Description
   
   Fixing accounting for chargeback when the loan was overpaid.
   


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] taskain7 commented on a diff in pull request #3100: [FINERACT-1888] Chargeback acoounting fix

Posted by "taskain7 (via GitHub)" <gi...@apache.org>.
taskain7 commented on code in PR #3100:
URL: https://github.com/apache/fineract/pull/3100#discussion_r1156620621


##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java:
##########
@@ -418,6 +418,7 @@ private void createJournalEntriesForChargeback(LoanDTO loanDTO, LoanTransactionD
         final Long loanProductId = loanDTO.getLoanProductId();
         final Long loanId = loanDTO.getLoanId();
         final String currencyCode = loanDTO.getCurrencyCode();
+        final BigDecimal overpaidAmount = loanDTO.getOverpaidAmount();

Review Comment:
   chaged it to the suggested one



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] adamsaghy commented on a diff in pull request #3100: [FINERACT-1888] Chargeback acoounting fix

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #3100:
URL: https://github.com/apache/fineract/pull/3100#discussion_r1156614933


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -4492,6 +4492,7 @@ public Map<String, Object> deriveAccountingBridgeData(final String currencyCode,
         accountingBridgeData.put("isAccountTransfer", isAccountTransfer);
         accountingBridgeData.put("isChargeOff", isChargedOff());
         accountingBridgeData.put("isFraud", isFraud());
+        accountingBridgeData.put("overpaidAmount", calculateTotalOverpayment().getAmount().abs());

Review Comment:
   No needed



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] taskain7 commented on a diff in pull request #3100: [FINERACT-1888] Chargeback acoounting fix

Posted by "taskain7 (via GitHub)" <gi...@apache.org>.
taskain7 commented on code in PR #3100:
URL: https://github.com/apache/fineract/pull/3100#discussion_r1156620250


##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java:
##########
@@ -786,7 +787,7 @@ public Office getOfficeById(final long officeId) {
         return this.officeRepository.getReferenceById(officeId);
     }
 
-    private void createCreditJournalEntryOrReversalForLoan(final Office office, final String currencyCode, final int accountMappingTypeId,
+    public void createCreditJournalEntryOrReversalForLoan(final Office office, final String currencyCode, final int accountMappingTypeId,

Review Comment:
   reworked it, I'm using the public one with the `AccrualAccountsForLoan` parameter type



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] adamsaghy commented on a diff in pull request #3100: [FINERACT-1888] Chargeback acoounting fix

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #3100:
URL: https://github.com/apache/fineract/pull/3100#discussion_r1156613729


##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java:
##########
@@ -110,6 +110,7 @@ public LoanDTO populateLoanDtoFromMap(final Map<String, Object> accountingBridge
         boolean isAccountTransfer = (Boolean) accountingBridgeData.get("isAccountTransfer");
         boolean isLoanMarkedAsChargeOff = (Boolean) accountingBridgeData.get("isChargeOff");
         boolean isLoanMarkedAsFraud = (Boolean) accountingBridgeData.get("isFraud");
+        BigDecimal overpaidAmount = (BigDecimal) accountingBridgeData.get("overpaidAmount");

Review Comment:
   You dont need this, LoanTransactionDTO contains the overpaid amount



##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccrualBasedAccountingProcessorForLoan.java:
##########
@@ -418,6 +418,7 @@ private void createJournalEntriesForChargeback(LoanDTO loanDTO, LoanTransactionD
         final Long loanProductId = loanDTO.getLoanProductId();
         final Long loanId = loanDTO.getLoanId();
         final String currencyCode = loanDTO.getCurrencyCode();
+        final BigDecimal overpaidAmount = loanDTO.getOverpaidAmount();

Review Comment:
   final BigDecimal overPaymentAmount = loanTransactionDTO.getOverPayment();



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] adamsaghy commented on a diff in pull request #3100: [FINERACT-1888] Chargeback acoounting fix

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #3100:
URL: https://github.com/apache/fineract/pull/3100#discussion_r1156613453


##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/data/LoanDTO.java:
##########
@@ -45,4 +46,6 @@ public class LoanDTO {
     private boolean markedAsChargeOff;
     @Setter
     private boolean markedAsFraud;
+    @Setter
+    private BigDecimal overpaidAmount;

Review Comment:
   Not needed, overpayment amount can be found in the `LoanTransactionDTO`
   



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] taskain7 commented on a diff in pull request #3100: [FINERACT-1888] Chargeback acoounting fix

Posted by "taskain7 (via GitHub)" <gi...@apache.org>.
taskain7 commented on code in PR #3100:
URL: https://github.com/apache/fineract/pull/3100#discussion_r1156620322


##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java:
##########
@@ -110,6 +110,7 @@ public LoanDTO populateLoanDtoFromMap(final Map<String, Object> accountingBridge
         boolean isAccountTransfer = (Boolean) accountingBridgeData.get("isAccountTransfer");
         boolean isLoanMarkedAsChargeOff = (Boolean) accountingBridgeData.get("isChargeOff");
         boolean isLoanMarkedAsFraud = (Boolean) accountingBridgeData.get("isFraud");
+        BigDecimal overpaidAmount = (BigDecimal) accountingBridgeData.get("overpaidAmount");

Review Comment:
   removed it



##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java:
##########
@@ -4492,6 +4492,7 @@ public Map<String, Object> deriveAccountingBridgeData(final String currencyCode,
         accountingBridgeData.put("isAccountTransfer", isAccountTransfer);
         accountingBridgeData.put("isChargeOff", isChargedOff());
         accountingBridgeData.put("isFraud", isFraud());
+        accountingBridgeData.put("overpaidAmount", calculateTotalOverpayment().getAmount().abs());

Review Comment:
   removed it



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] adamsaghy commented on a diff in pull request #3100: [FINERACT-1888] Chargeback acoounting fix

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #3100:
URL: https://github.com/apache/fineract/pull/3100#discussion_r1156613528


##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/AccountingProcessorHelper.java:
##########
@@ -786,7 +787,7 @@ public Office getOfficeById(final long officeId) {
         return this.officeRepository.getReferenceById(officeId);
     }
 
-    private void createCreditJournalEntryOrReversalForLoan(final Office office, final String currencyCode, final int accountMappingTypeId,
+    public void createCreditJournalEntryOrReversalForLoan(final Office office, final String currencyCode, final int accountMappingTypeId,

Review Comment:
   Unnecessary to change the visibility



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] taskain7 commented on a diff in pull request #3100: [FINERACT-1888] Chargeback acoounting fix

Posted by "taskain7 (via GitHub)" <gi...@apache.org>.
taskain7 commented on code in PR #3100:
URL: https://github.com/apache/fineract/pull/3100#discussion_r1156619764


##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/data/LoanDTO.java:
##########
@@ -45,4 +46,6 @@ public class LoanDTO {
     private boolean markedAsChargeOff;
     @Setter
     private boolean markedAsFraud;
+    @Setter
+    private BigDecimal overpaidAmount;

Review Comment:
   removed it



-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [fineract] adamsaghy merged pull request #3100: [FINERACT-1888] Chargeback acoounting fix

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #3100:
URL: https://github.com/apache/fineract/pull/3100


-- 
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: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org