You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "alberto-art3ch (via GitHub)" <gi...@apache.org> on 2025/07/25 03:21:27 UTC

[PR] FINERACT-2311: Buy Down fees - Reversal of existing transaction [fineract]

alberto-art3ch opened a new pull request, #4887:
URL: https://github.com/apache/fineract/pull/4887

   ## Description
   
   Support reversal of “Buy Down fees” transactions.
   
   - Not yet reversed “Buy Down fees” transaction is allowed to be reversed if
   Mirror JE entries will be based for reversal entry of that transaction
   There is no any not yet reversed “Buy Down fees Adjustment” that belongs to this transactions (transaction relationship)
   
   - When “Buy Down fees” transaction is reversed, all already amortized amounts should be corrected in a “Buy Down fees amortization adjustment“ transaction.
   Mirror JE entries of “Buy Down fees amortization“.
   COB will handle the adjustment transaction
   Delete related buy down fee balance
   
   [FINERACT-2311](https://issues.apache.org/jira/browse/FINERACT-2311)
   
   ## Checklist
   
   Please make sure these boxes are checked before submitting your pull request - thanks!
   
   - [ ] Write the commit message as per https://github.com/apache/fineract/#pull-requests
   - [ ] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
   - [ ] Create/update unit or integration tests for verifying the changes made.
   - [ ] Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.
   - [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
   - [ ] Submission is not a "code dump".  (Large changes can be made "in repository" via a branch.  Ask on the developer mailing list for guidance, if required.)
   
   FYI our guidelines for code reviews are at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.
   


-- 
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


Re: [PR] FINERACT-2311: Buy Down fees - Reversal of existing transaction [fineract]

Posted by "alberto-art3ch (via GitHub)" <gi...@apache.org>.
alberto-art3ch commented on code in PR #4887:
URL: https://github.com/apache/fineract/pull/4887#discussion_r2242749359


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java:
##########
@@ -707,6 +707,10 @@ public boolean isCapitalizedIncome() {
         return LoanTransactionType.CAPITALIZED_INCOME.equals(getTypeOf()) && isNotReversed();
     }
 
+    public boolean isDefferedIncome() {

Review Comment:
   Done! Typo fixed



-- 
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


Re: [PR] FINERACT-2311: Buy Down fees - Reversal of existing transaction [fineract]

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


-- 
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


Re: [PR] FINERACT-2311: Buy Down fees - Reversal of existing transaction [fineract]

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


##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanTransaction.java:
##########
@@ -707,6 +707,10 @@ public boolean isCapitalizedIncome() {
         return LoanTransactionType.CAPITALIZED_INCOME.equals(getTypeOf()) && isNotReversed();
     }
 
+    public boolean isDefferedIncome() {

Review Comment:
   typo in the method name



-- 
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


Re: [PR] FINERACT-2311: Buy Down fees - Reversal of existing transaction [fineract]

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


##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/BuyDownFeeWritePlatformServiceImpl.java:
##########
@@ -210,6 +213,40 @@ public CommandProcessingResult buyDownFeeAdjustment(final Long loanId, final Lon
                 .withClientId(loan.getClientId()).withLoanId(loan.getId()).build();
     }
 
+    @Override
+    @Transactional
+    public Optional<LoanTransaction> reverseBuyDownFee(LoanTransaction buyDownFeeTransaction) {
+        LoanTransaction amortizationTransaction = null;
+        Loan loan = buyDownFeeTransaction.getLoan();
+        BigDecimal totalAmortizationAmount = BigDecimal.ZERO;
+
+        final List<LoanTransactionRelation> loanTransactionRelations = loanTransactionRelationRepository

Review Comment:
   We dont need to fetch all the relations and go through on loan transactions (and effectively fetch them) to make this decision. Please write a simply query which returns the required information:
   - boolean
   - related transaction id 



-- 
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


Re: [PR] FINERACT-2311: Buy Down fees - Reversal of existing transaction [fineract]

Posted by "alberto-art3ch (via GitHub)" <gi...@apache.org>.
alberto-art3ch commented on code in PR #4887:
URL: https://github.com/apache/fineract/pull/4887#discussion_r2242742018


##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/BuyDownFeeWritePlatformServiceImpl.java:
##########
@@ -210,6 +213,40 @@ public CommandProcessingResult buyDownFeeAdjustment(final Long loanId, final Lon
                 .withClientId(loan.getClientId()).withLoanId(loan.getId()).build();
     }
 
+    @Override
+    @Transactional
+    public Optional<LoanTransaction> reverseBuyDownFee(LoanTransaction buyDownFeeTransaction) {
+        LoanTransaction amortizationTransaction = null;
+        Loan loan = buyDownFeeTransaction.getLoan();
+        BigDecimal totalAmortizationAmount = BigDecimal.ZERO;
+
+        final List<LoanTransactionRelation> loanTransactionRelations = loanTransactionRelationRepository

Review Comment:
   Done! Method updated to return a boolean value 



-- 
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