You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "somasorosdpc (via GitHub)" <gi...@apache.org> on 2026/05/11 13:27:45 UTC
[PR] FINERACT-2455: Working Capital Loan Transaction - Goodwill Credit - Accounting [fineract]
somasorosdpc opened a new pull request, #5837:
URL: https://github.com/apache/fineract/pull/5837
## Description
Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)
## Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
- [ ] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#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](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made.
- [ ] Follow our [coding conventions](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
- [ ] [This PR must not be a "code dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit). Large changes can be made in a branch, with assistance. Ask for help on the [developer mailing list](https://fineract.apache.org/#contribute).
Your assigned reviewer(s) will follow our [guidelines for code reviews](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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Transaction - Goodwill Credit - Accounting [fineract]
Posted by "peter-kovacs-dpc (via GitHub)" <gi...@apache.org>.
peter-kovacs-dpc commented on code in PR #5837:
URL: https://github.com/apache/fineract/pull/5837#discussion_r3265630045
##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/WorkingCapitalLoanAccountStepDef.java:
##########
@@ -2728,19 +2730,26 @@ public void verifyMultipleWorkingCapitalLoanTransactionsJournalEntries(int expec
public void verifyReversedWorkingCapitalLoanTransactionJournalEntries(String transactionType, String transactionDate, DataTable table)
throws IOException {
Long loanId = getCreatedLoanId();
- List<GetWorkingCapitalLoanTransactionIdResponse> transactionsMatch = findMatchingTransactions(loanId, transactionType,
+ TransactionType resolvedTransactionType = resolveTransactionType(transactionType);
+ List<GetWorkingCapitalLoanTransactionIdResponse> transactionsMatch = findMatchingTransactions(loanId, resolvedTransactionType,
transactionDate, true);
verifyJournalEntries(transactionsMatch, loanId, table);
}
- private List<GetWorkingCapitalLoanTransactionIdResponse> findMatchingTransactions(Long loanId, String transactionType,
+ private TransactionType resolveTransactionType(String transactionType) {
+ return Arrays.stream(TransactionType.values()).filter(t -> t.name().equalsIgnoreCase(transactionType.replace(" ", "_"))).findFirst()
Review Comment:
done
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Transaction - Goodwill Credit - Accounting [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5837:
URL: https://github.com/apache/fineract/pull/5837#discussion_r3258726622
##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForWorkingCapitalLoan.java:
##########
@@ -47,7 +49,7 @@ public class CashBasedAccountingProcessorForWorkingCapitalLoan implements Workin
private final JournalEntryRepository journalEntryRepository;
@Override
- public void postJournalEntriesForRepayment(final WorkingCapitalLoan loan, final WorkingCapitalLoanTransaction txn,
+ public void postJournalEntriesForRepaymentLikeTransaction(final WorkingCapitalLoan loan, final WorkingCapitalLoanTransaction txn,
Review Comment:
Would it make sense to rename this method to "postJournalEntries"?
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Transaction - Goodwill Credit - Accounting [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5837:
URL: https://github.com/apache/fineract/pull/5837#discussion_r3258734658
##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForWorkingCapitalLoan.java:
##########
@@ -63,12 +65,27 @@ public void postJournalEntriesForRepayment(final WorkingCapitalLoan loan, final
final BigDecimal overpaymentPortion = txn.getTransactionAmount().subtract(principalPortion).subtract(feesPortion)
.subtract(penaltiesPortion).max(BigDecimal.ZERO);
- if (isChargedOff) {
- postChargedOffRepaymentEntries(office, productId, currencyCode, transactionDate, paymentTypeId, txn, principalPortion,
- feesPortion, penaltiesPortion, overpaymentPortion);
- } else {
- postRegularRepaymentEntries(office, productId, currencyCode, transactionDate, paymentTypeId, txn, principalPortion, feesPortion,
- penaltiesPortion, overpaymentPortion);
+ if (LoanTransactionType.REPAYMENT.equals(txn.getTypeOf())) {
Review Comment:
Would it make sense use switch here instead and list all supported transaction type?
Would it make sense to throw error if unsupported transaction type is found?
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Transaction - Goodwill Credit - Accounting [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #5837:
URL: https://github.com/apache/fineract/pull/5837#discussion_r3258755315
##########
fineract-provider/src/main/java/org/apache/fineract/accounting/journalentry/service/CashBasedAccountingProcessorForWorkingCapitalLoan.java:
##########
@@ -63,12 +65,27 @@ public void postJournalEntriesForRepayment(final WorkingCapitalLoan loan, final
final BigDecimal overpaymentPortion = txn.getTransactionAmount().subtract(principalPortion).subtract(feesPortion)
.subtract(penaltiesPortion).max(BigDecimal.ZERO);
- if (isChargedOff) {
- postChargedOffRepaymentEntries(office, productId, currencyCode, transactionDate, paymentTypeId, txn, principalPortion,
- feesPortion, penaltiesPortion, overpaymentPortion);
- } else {
- postRegularRepaymentEntries(office, productId, currencyCode, transactionDate, paymentTypeId, txn, principalPortion, feesPortion,
- penaltiesPortion, overpaymentPortion);
+ if (LoanTransactionType.REPAYMENT.equals(txn.getTypeOf())) {
+ if (isChargedOff) {
+ postChargedOffRepaymentEntries(office, productId, currencyCode, transactionDate, paymentTypeId, txn, principalPortion,
+ feesPortion, penaltiesPortion, overpaymentPortion);
+ } else {
+ postRegularRepaymentEntries(office, productId, currencyCode, transactionDate, paymentTypeId, txn, principalPortion,
+ feesPortion, penaltiesPortion, overpaymentPortion);
+ }
+ }
+ if (LoanTransactionType.GOODWILL_CREDIT.equals(txn.getTypeOf()) && !isChargedOff) {
Review Comment:
Would it make sense to handle these use cases, similarly as above repayment does?
- Having condition whether need to create journal entries for non charged-off loan?
- Having condition whether need to create journal entries for charged-off loan? -> unsupported yet...
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Transaction - Goodwill Credit - Accounting [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #5837:
URL: https://github.com/apache/fineract/pull/5837
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2455: Working Capital Loan Transaction - Goodwill Credit - Accounting [fineract]
Posted by "oleksii-novikov-onix (via GitHub)" <gi...@apache.org>.
oleksii-novikov-onix commented on code in PR #5837:
URL: https://github.com/apache/fineract/pull/5837#discussion_r3249610031
##########
fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/WorkingCapitalLoanAccountStepDef.java:
##########
@@ -2728,19 +2730,26 @@ public void verifyMultipleWorkingCapitalLoanTransactionsJournalEntries(int expec
public void verifyReversedWorkingCapitalLoanTransactionJournalEntries(String transactionType, String transactionDate, DataTable table)
throws IOException {
Long loanId = getCreatedLoanId();
- List<GetWorkingCapitalLoanTransactionIdResponse> transactionsMatch = findMatchingTransactions(loanId, transactionType,
+ TransactionType resolvedTransactionType = resolveTransactionType(transactionType);
+ List<GetWorkingCapitalLoanTransactionIdResponse> transactionsMatch = findMatchingTransactions(loanId, resolvedTransactionType,
transactionDate, true);
verifyJournalEntries(transactionsMatch, loanId, table);
}
- private List<GetWorkingCapitalLoanTransactionIdResponse> findMatchingTransactions(Long loanId, String transactionType,
+ private TransactionType resolveTransactionType(String transactionType) {
+ return Arrays.stream(TransactionType.values()).filter(t -> t.name().equalsIgnoreCase(transactionType.replace(" ", "_"))).findFirst()
Review Comment:
I think we do not need an array and stream here, it could be simplified `toTransactionType.valueOf(transactionType.toUpperCase().replace(' ', '_'))`
--
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: issues-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org