Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,77 @@ Feature: Working Capital Goodwill Credit Accounting Entries
| EXPENSE | 744003 | Goodwill Expense Account | | 270.0 |
| INCOME | 404008 | Fee Charge off | | 30.0 |

Scenario: Verify Working Capital loan Goodwill Credit transaction GL entries on closed loan posts expense debit and overpayment liability credit
When Admin sets the business date to "01 January 2026"
And Admin creates a client with random data
And Admin creates a working capital loan with the following data:
| LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPaymentVolume | periodPaymentRate | discount |
| WCLP_ACC_DEF_REV_AM | 01 January 2026 | 01 January 2026 | 9000 | 100000 | 18 | 0 |
And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026"
And Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount
When Admin sets the business date to "20 January 2026"
And Customer makes repayment on "20 January 2026" with 9000.0 transaction amount on Working Capital loan
Then Working Capital loan status will be "CLOSED_OBLIGATIONS_MET"
When Admin sets the business date to "21 January 2026"
And Customer makes "GOODWILL_CREDIT" transaction on "21 January 2026" with 100.0 transaction amount on Working Capital loan
Then Working Capital loan status will be "OVERPAID"
And Working Capital loan balance overpaymentAmount is "100.00"
And Working Capital Loan Transactions tab has a "GOODWILL_CREDIT" transaction with date "21 January 2026" which has the following Journal entries:
| Type | Account code | Account name | Debit | Credit |
| EXPENSE | 744003 | Goodwill Expense Account | 100.0 | |
| LIABILITY | 245000 | Other Credit Liability | | 100.0 |
And Customer makes credit balance refund on "21 January 2026" with 100.0 transaction amount on Working Capital loan
Then Working Capital loan status will be "CLOSED_OBLIGATIONS_MET"

Scenario: Verify Working Capital loan Goodwill Credit transaction GL entries on overpaid loan posts posts expense debit and overpayment liability credit
When Admin sets the business date to "01 January 2026"
And Admin creates a client with random data
And Admin creates a working capital loan with the following data:
| LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPaymentVolume | periodPaymentRate | discount |
| WCLP_ACC_DEF_REV_AM | 01 January 2026 | 01 January 2026 | 9000 | 100000 | 18 | 0 |
And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026"
And Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount
When Admin sets the business date to "20 January 2026"
And Customer makes repayment on "20 January 2026" with 9100.0 transaction amount on Working Capital loan
Then Working Capital loan status will be "OVERPAID"
And Working Capital loan balance overpaymentAmount is "100.00"
When Admin sets the business date to "21 January 2026"
And Customer makes "GOODWILL_CREDIT" transaction on "21 January 2026" with 50.0 transaction amount on Working Capital loan
Then Working Capital loan status will be "OVERPAID"
And Working Capital loan balance overpaymentAmount is "150.00"
And Working Capital Loan Transactions tab has a "GOODWILL_CREDIT" transaction with date "21 January 2026" which has the following Journal entries:
| Type | Account code | Account name | Debit | Credit |
| EXPENSE | 744003 | Goodwill Expense Account | 50.0 | |
| LIABILITY | 245000 | Other Credit Liability | | 50.0 |
And Customer makes credit balance refund on "21 January 2026" with 150.0 transaction amount on Working Capital loan
Then Working Capital loan status will be "CLOSED_OBLIGATIONS_MET"

Scenario: Verify Working Capital loan UNDO Goodwill Credit transaction GL entries on closed loan posts mirror overpayment liability entries
When Admin sets the business date to "01 January 2026"
And Admin creates a client with random data
And Admin creates a working capital loan with the following data:
| LoanProduct | submittedOnDate | expectedDisbursementDate | principalAmount | totalPaymentVolume | periodPaymentRate | discount |
| WCLP_ACC_DEF_REV_AM | 01 January 2026 | 01 January 2026 | 9000 | 100000 | 18 | 0 |
And Admin successfully approves the working capital loan on "01 January 2026" with "9000" amount and expected disbursement date on "01 January 2026"
And Admin successfully disburse the Working Capital loan on "01 January 2026" with "9000" EUR transaction amount
When Admin sets the business date to "20 January 2026"
And Customer makes repayment on "20 January 2026" with 9000.0 transaction amount on Working Capital loan
Then Working Capital loan status will be "CLOSED_OBLIGATIONS_MET"
When Admin sets the business date to "21 January 2026"
And Customer makes "GOODWILL_CREDIT" transaction on "21 January 2026" with 100.0 transaction amount on Working Capital loan
Then Working Capital Loan Transactions tab has a "GOODWILL_CREDIT" transaction with date "21 January 2026" which has the following Journal entries:
| Type | Account code | Account name | Debit | Credit |
| EXPENSE | 744003 | Goodwill Expense Account | 100.0 | |
| LIABILITY | 245000 | Other Credit Liability | | 100.0 |
When Customer undo "1"th "GOODWILL_CREDIT" transaction made on "21 January 2026" on Working Capital loan
Then Working Capital loan status will be "CLOSED_OBLIGATIONS_MET"
And Working Capital Loan Transactions tab has a reversed "GOODWILL_CREDIT" transaction with date "21 January 2026" which has the following Journal entries:
| Type | Account code | Account name | Debit | Credit |
| EXPENSE | 744003 | Goodwill Expense Account | 100.0 | |
| LIABILITY | 245000 | Other Credit Liability | | 100.0 |
| EXPENSE | 744003 | Goodwill Expense Account | | 100.0 |
| LIABILITY | 245000 | Other Credit Liability | 100.0 | |

@TestRailId:C85336
Scenario: Verify Working Capital loan UNDO Goodwill Credit transaction GL entries - UC4: reversal with overpayment
When Admin sets the business date to "01 January 2026"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private LoanStatus getNextStatus(final WorkingCapitalLoanEvent event, final Work
case LOAN_REJECTED -> from.isSubmittedAndPendingApproval() ? LoanStatus.REJECTED : null;
case LOAN_DISBURSED -> from.isApproved() ? LoanStatus.ACTIVE : null;
case LOAN_DISBURSAL_UNDO -> from.isActive() ? LoanStatus.APPROVED : null;
case LOAN_REPAID_IN_FULL -> from.isActive() ? LoanStatus.CLOSED_OBLIGATIONS_MET : null;
case LOAN_REPAID_IN_FULL -> (from.isActive() || from.isOverpaid()) ? LoanStatus.CLOSED_OBLIGATIONS_MET : null;
case LOAN_OVERPAID -> (from.isActive() || from.isClosedObligationsMet() || from.isOverpaid()) ? LoanStatus.OVERPAID : null;
case LOAN_REOPENED -> (from.isOverpaid() || from.isClosedObligationsMet()) ? LoanStatus.ACTIVE : null;
case LOAN_CREDIT_BALANCE_REFUND_IN_FULL -> from.isOverpaid() ? LoanStatus.CLOSED_OBLIGATIONS_MET : null;
Expand Down
Loading