# CERSAI Hypothecation Charges in Loan Agreement --- ## CRED-5991 — 2026-03-11 ### Overview Added CERSAI (Central Registry of Securitisation Asset Reconstruction and Security Interest) Hypothecation Charges of **₹118/-** to the legal charges in the post-approval journey. --- ### Business Rules - **Applicable lenders**: KMGC (`lender_id = 2`) and Black Soil (`lender_id = 20`, ref `BlackSoil::$lender_id`) - **Eligibility check**: `net_loan_amount > merchant.hypothecation_charges` - The `merchant.hypothecation_charges` column stores the minimum threshold: - **Non-SSE merchants**: 50,000 (₹50K) - **SSE merchants**: 10,00,000 (₹10L) - Net loan amount is computed via `autoBRE->calculateNetLoanAmount($loan_amount, $active_offer)` - **Charge amount** (by Net Loan Amount): - Net Loan Amount **< ₹5,00,000** → **₹59** (`CERSAI_HYPOTHECATION_CHARGE_BELOW_5L`) - Net Loan Amount **≥ ₹5,00,000** → **₹118** (`CERSAI_HYPOTHECATION_CHARGE_ABOVE_5L`) - SSE cases: threshold applies on the ₹10L net loan amount cases. - **Backward compatibility**: the sub-₹5L ₹59 rate applies only to applications whose latest `approved` log is on/after `2026-06-12 00:00:00`; older approved cases retain the earlier flat ₹118. No GST applied separately. - **Storage**: Saved in `emi_calculation.legal_charges` as a combined value with existing stamp duty charges (`stamp_duty + cersai_charge`) --- ### Logic Added #### Eligibility Method `DisbursementController::getCersaiHypothecationCharge($application)` - Returns the net-loan-based charge (`₹59` below ₹5L / `₹118` at or above ₹5L) if all conditions met, `0` otherwise - Conditions: lender is KMGC or Black Soil → merchant has `hypothecation_charges` set → `net_loan_amount >= merchant->hypothecation_charges` #### EMI Calculation - `getEMIs()`: CERSAI charge is added on top of stamp duty before being passed into the EMI calculation engine, so `payable_by_customer` includes it - `generateEMI()`: After `fill($data)`, the combined `legal_charges` (stamp duty + CERSAI) is explicitly computed and saved to `emi_calculation.legal_charges` — covers both the create and update paths Doubt........ #### Payment Link (Post-Approval Journey) - `FrontController::getFeesData()`: Condition updated so that legal charges appear in the payment link for KMGC lender whenever `legal_charges > 0`, independent of processing fee status #### Documents - **KFS (English/Hindi/Marathi + Black Soil)** — Point No. 8 (iv): - Row b) "Legal document charges" now shows the **combined** amount = Stamp Paper Charges + CERSAI Hypothecation Charges, and this single value contributes to `$payable_to_third_party_RE` (column B total). - The separate row c) "CF legal document processing fee charges" and row d) "Cersai Hypothecation charges" have been **removed** from the KFS. - Black Soil KFS no longer hardcodes stamp duty (previously `100`); it derives Stamp Paper + CERSAI the same way as the common KFS. Black Soil stamp paper charge is ₹300 (`BLACKSOIL_LEGAL_CHARGES_AMOUNT`). - **Disbursement Advice (`per_forma_invoice`)**: Stamp duty and CERSAI are shown as separate line items in both the merchant-collected and CF-collected sections. Net disbursement deduction uses the combined `legal_charges` value (unchanged) --- ### Impact — Files Changed / Added | File | Type | Change | |------|------|--------| | `app/Merchant.php` | Modified | Added `'hypothecation_charges'` to `$fillable` | | `app/Http/Controllers/Admin/DisbursementController.php` | Modified | Added `getCersaiHypothecationCharge()` method; added `use App\MerchantOffers` import | | `app/Http/Controllers/Admin/EMICalculation.php` | Modified | `getEMIs()`: loads `merchant` relation, adds CERSAI to `$legal_charges`; `generateEMI()`: explicitly saves combined `legal_charges` in both create and update paths | | `app/Http/Controllers/FrontController.php` | Modified | `getFeesData()`: relaxed legal charges condition for KMGC — now shows when `$legal_charges > 0` instead of requiring `$kmPFavailable` | | `app/Http/Controllers/Admin/ConsumerDocument.php` | Modified | Added `'cersai_hypothecation_charges'` key to `$process` array (passed to all document views) | | `resources/views/admin/documents/common_KFS.blade.php` | Modified | Row b) shows stamp duty only; Row d) shows CERSAI amount; both accumulate into `$payable_to_third_party_RE` | | `resources/views/admin/documents/common_hindi_KFS.blade.php` | Modified | Same as above (Hindi labels); added Row d) for CERSAI | | `resources/views/admin/documents/common_marathi_KFS.blade.php` | Modified | Same as above (Marathi labels); added Row d) for CERSAI | | `resources/views/admin/documents/per_forma_invoice.blade.php` | Modified | Added separate "Cersai Hypothecation charges" row in both merchant-collected and CF-collected sections | | `database/migrations/2026_03_02_180538_add_hypothecation_charges_column_to_merchant_table.php` | Added | Migration that added `hypothecation_charges` column to `merchant` table | --- ## Multi-Stage Disbursement Fix — 2026-03-31 ### Overview Extended CERSAI hypothecation charges to cover **multi-stage disbursement** cases. Two places that computed `legal_charges` independently were not including the CERSAI charge, causing incorrect deduction amounts for multi-stage loans. --- ### Logic Changed Both files previously called only `getLegalChargesAmount($application)` for their `$legal_charges` value. They now also call `getCersaiHypothecationCharge($application)` and add the result, so the combined value (stamp duty + CERSAI) is used consistently. --- ### Impact — Files Changed | File | Type | Change | |------|------|--------| | `app/Http/Controllers/Admin/AccountingController.php` | Modified | `$legal_charges` computation in the disbursement detail view now adds `getCersaiHypothecationCharge()` on top of `getLegalChargesAmount()` | | `app/MultiStageDisbursement.php` | Modified | `$legal_charges` computation used during multi-stage disbursement processing now adds `getCersaiHypothecationCharge()` on top of `getLegalChargesAmount()` | --- ## Merchant Hypothecation Charge UI Update — 2026-04-21 ### Overview Added the `hypothecation_charges` field to the Merchant Edit page so that it can be configured manually for each merchant. --- ### Logic Added - In `resources/views/admin/merchant/edit.blade.php`, added an **"Applicable Amount"** (`hypothecation_charges`) numeric input field below the **"Activate Loan Hypothecation"** checkbox within the Process tab. - Added JavaScript logic to dynamically show/hide the "Applicable Amount" input based on whether the "Activate Loan Hypothecation" checkbox is checked. --- ### Impact — Files Changed | File | Type | Change | |------|------|--------| | `resources/views/admin/merchant/edit.blade.php` | Modified | Added `hypothecation_charges` field and corresponding JavaScript toggle logic. | --- ## CERSAI Hypothecation Charge Caching — 2026-04-21 ### Overview Updated the CERSAI charge logic to cache the calculated charge inside the `pro_forma_invoice` table so that it is only calculated once per application, preventing repeated evaluations and improving efficiency. --- ### Logic Changed - Modified `DisbursementController::getCersaiHypothecationCharge($application)` to check if a `pro_forma_invoice` exists and if its `cersai_hypothecation_charge` column is populated. - If populated, it returns the cached `118` or `0` immediately. - If not populated, it calculates the charge using the existing eligibility rules and updates the `pro_forma_invoice` record with the result before returning it. --- ### Impact — Files Changed | File | Type | Change | |------|------|--------| | `app/Http/Controllers/Admin/DisbursementController.php` | Modified | Updated `getCersaiHypothecationCharge()` to fetch and save the CERSAI charge into the database. | | `app/ProFormaInvoice.php` | Modified | Added `cersai_hypothecation_charge` to `$fillable` fields. | | `database/migrations/*_add_cersai_hypothecation_charge_to_pro_forma_invoice_table.php` | Added | Migration that added `cersai_hypothecation_charge` column to `pro_forma_invoice` table. |