You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Aman-Mittal (via GitHub)" <gi...@apache.org> on 2026/10/16 07:58:05 UTC

[I] Working Capital loan product: add GL account mappings, charge-off/write-off reason mappings and payment allocation [fineract-backoffice-ui]

Aman-Mittal opened a new issue, #775:
URL: https://github.com/apache/fineract-backoffice-ui/issues/775

   ## Summary
   
   The Working Capital loan product form sets only `accountingRule`. It never captures the GL accounts that the rule posts to. A product saved with an accrual or cash rule therefore has no portfolio, income, write-off or fund-source accounts configured from this UI. Accounting for the product has to be fixed through the API before any transaction can post correctly.
   
   ## Evidence (`main` @ `8da1086f`)
   
   `src/app/features/working-capital/loan-products/wc-loan-product-form.component.ts` contains `accountingRule` (7 references). It has no `*AccountId` field, no `writeOffReasonsToExpenseMappings`, no `chargeOffReasonToExpenseAccountMappings`, no `paymentChannelToFundSourceMappings` and no payment-allocation section.
   
   ## Platform support
   
   `POST` / `PUT /v1/working-capital-loan-products[/{id}]` accept the following (see the Working Capital product constants in `fineract-working-capital-loan`):
   
   - **Asset / liability accounts:**
     - `fundSourceAccountId`, `loanPortfolioAccountId`, `transfersInSuspenseAccountId`
     - `receivableFeeAccountId`, `receivablePenaltyAccountId`
     - `overpaymentLiabilityAccountId`, `deferredIncomeLiabilityAccountId`
   - **Income accounts:**
     - `incomeFromFeeAccountId`, `incomeFromPenaltyAccountId`, `incomeFromDiscountFeeAccountId`, `incomeFromRecoveryAccountId`
     - `incomeFromChargeOff{Fees,Interest,Penalty}AccountId`
     - `incomeFromGoodwillCredit{Fees,Interest,Penalty}AccountId`
   - **Expense accounts:** `writeOffAccountId`, `chargeOffExpenseAccountId`, `chargeOffFraudExpenseAccountId`, `goodwillCreditAccountId`.
   - **Advanced mappings:**
     - `paymentChannelToFundSourceMappings`, `feeToIncomeAccountMappings`, `penaltyToIncomeAccountMappings`
     - `chargeOffReasonToExpenseAccountMappings`, `writeOffReasonsToExpenseMappings`
   - **Payment allocation rules** (`paymentAllocation`): the order in which a repayment settles fees, penalties and principal.
   
   The product template returns the selectable GL account options.
   
   ## Proposed implementation
   
   - Add an **Accounting** section that appears when the rule is not *None*. Reuse the shared GL-account select and the advanced-mapping editors already used by the regular loan product form (#288 / #289 / #290 / #294). Mark the accounts the chosen rule requires as required.
   - Add a **Payment allocation** section using the existing `payment-credit-allocation-editor`.
   - Prefill both sections on edit, and show them on the product view.
   
   ## RBAC
   
   | Action | Permission code | Typically granted to |
   |---|---|---|
   | View product (incl. mappings) | `READ_WORKINGCAPITALLOANPRODUCT` | product managers, accountants, auditors |
   | Create product | `CREATE_WORKINGCAPITALLOANPRODUCT` | product manager |
   | Edit product / mappings | `UPDATE_WORKINGCAPITALLOANPRODUCT` | product manager together with finance / accounting |
   | Choose GL accounts | the product payload carries the ids; listing accounts needs `READ_GLACCOUNT` | accountant |
   
   The GL account picker loads `/glaccounts`. A user who holds `UPDATE_WORKINGCAPITALLOANPRODUCT` but not `READ_GLACCOUNT` must get a clear message ("you need GL account read access to edit accounting"), not an empty select.
   
   ### How Fineract evaluates these permissions
   
   - A write passes with the exact code **or** `ALL_FUNCTIONS`. Reads pass with `ALL_FUNCTIONS_READ`.
   - Codes are in `scripts/permission-codes.json`.
   
   ### UI expectations
   
   - Existing routes are already guarded on `CREATE_` / `UPDATE_WORKINGCAPITALLOANPRODUCT`. Keep those guards.
   - Gate the accounting section's data load on `READ_GLACCOUNT`.
   
   ## Acceptance criteria
   
   - [ ] An accrual-based Working Capital product can be created with all required GL accounts and advanced mappings, and a disbursement and repayment then post journal entries.
   - [ ] Payment allocation can be set and is honoured.
   - [ ] Edit prefills every mapping.
   - [ ] The missing-`READ_GLACCOUNT` case is handled clearly.
   - [ ] Unit tests cover the payload for each accounting rule and the prefill.
   


-- 
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.apache.org

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


Re: [I] Working Capital loan product: add GL account mappings, charge-off/write-off reason mappings and payment allocation [fineract-backoffice-ui]

Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal commented on issue #775:
URL: https://github.com/apache/fineract-backoffice-ui/issues/775#issuecomment-6211175990

   ## Business process flow
   
   ```mermaid
   flowchart LR
       A["Product manager<br/>CREATE or UPDATE_WORKINGCAPITALLOANPRODUCT"] --> B["Details and terms"]
       B --> C{"Accounting rule"}
       C -- None --> F["Payment allocation"]
       C -- "Cash or Accrual" --> D{"READ_GLACCOUNT?"}
       D -- No --> DX["Explain: GL read access needed"]
       D -- Yes --> E["Map GL accounts<br/>assets, income, expense, liabilities"]
       E --> E2["Advanced mappings<br/>payment channel to fund source<br/>fee and penalty to income<br/>charge-off and write-off reason to expense"]
       E2 --> F
       F --> G["Review and save"]
       G --> H["Loans post journal entries correctly"]
   ```
   
   ## UI mockup
   
   ```text
   ┌ Working Capital Product · Accounting ─────────── Rule: (•) Accrual ( ) Cash ( ) None ┐
   │ ASSETS                                                                    │
   │  Fund source *               [ 10100 Cash at bank            ▾ ]          │
   │  Loan portfolio *            [ 12000 WC loan portfolio        ▾ ]          │
   │  Fees receivable *           [ 12100 Fees receivable          ▾ ]          │
   │ INCOME                                                                    │
   │  Income from fees *          [ 40100 Fee income               ▾ ]          │
   │  Income from discount fee *  [ 40150 Discount fee income      ▾ ]          │
   │  Income from recovery *      [ 40900 Recoveries               ▾ ]          │
   │ EXPENSES                                                                  │
   │  Losses written off *        [ 60100 Loan losses              ▾ ]          │
   │  Charge-off expense *        [ 60110 Charge-off expense       ▾ ]          │
   │ LIABILITIES                                                               │
   │  Overpayment liability *     [ 21000 Overpayments             ▾ ]          │
   │ ▸ Advanced mappings                                                       │
   │    Payment channel → fund source   [+ Add]                                │
   │    Charge-off reason → expense     [+ Add]   Fraud → 60120               │
   │    Write-off reason → expense      [+ Add]                                │
   ├ Payment allocation ───────────────────────────────────────────────────────┤
   │  1. Penalty  2. Fee  3. Principal   (drag to reorder)                     │
   └───────────────────────────────────────────────────────────── [Save] ──────┘
   ```
   


-- 
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: [I] Working Capital loan product: add GL account mappings, charge-off/write-off reason mappings and payment allocation [fineract-backoffice-ui]

Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal closed issue #775: Working Capital loan product: add GL account mappings, charge-off/write-off reason mappings and payment allocation
URL: https://github.com/apache/fineract-backoffice-ui/issues/775


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