=== Testing Restored Partial Payment Formula === ╔══════════════════════════════════════════════════════════════╗ ║ Test Case 1: URL013572 (Using Restored Formula) ║ ╚══════════════════════════════════════════════════════════════╝ Loan Parameters: ├─ Principal: 6,397,076.00 ├─ Annual Rate: 12% ├─ Monthly Rate: 0.010000 ├─ Total Tenure: 36 months └─ Installments Paid: 5 Calculation Details: ├─ (1 + r)^n = 1.430769 ├─ (1 + r)^m = 1.051010 ├─ Numerator: (1+r)^n - (1+r)^m = 0.379759 ├─ Denominator: (1+r)^n - 1 = 0.430769 └─ Ratio: 0.881584 Results: ├─ Calculated Payoff: 5,639,557.86 ├─ Previous Expected: 3,774,876.79 └─ Method: Partial Payment Formula B = P₀ * [(1+r)^n - (1+r)^m] / [(1+r)^n - 1] ╔══════════════════════════════════════════════════════════════╗ ║ Test Case 2: Regular URA Loan ║ ╚══════════════════════════════════════════════════════════════╝ Loan Parameters: ├─ Principal: 1,000,000.00 ├─ Annual Rate: 12% ├─ Total Tenure: 12 months └─ Installments Paid: 3 Results: ├─ Calculated Payoff: 761,080.29 └─ Method: Partial Payment Formula ╔══════════════════════════════════════════════════════════════╗ ║ Test Case 3: Large Loan (URL002224 type) ║ ╚══════════════════════════════════════════════════════════════╝ Loan Parameters: ├─ Principal: 18,980,000.00 ├─ Annual Rate: 12% ├─ Total Tenure: 49 months └─ Installments Paid: 15 Results: ├─ Calculated Payoff: 14,117,743.53 └─ Method: Partial Payment Formula ╔══════════════════════════════════════════════════════════════╗ ║ SUMMARY ║ ╚══════════════════════════════════════════════════════════════╝ ✓ Implementation: RESTORED from EmployeeLoanController13.php ✓ Formula: B = P₀ * [(1+r)^n - (1+r)^m] / [(1+r)^n - 1] Where: - P₀ = Original principal (requested_amount) - r = Monthly interest rate - n = Total tenure - m = Installments paid Controller Path: app/Http/Controllers/EmployeeLoanController.php Method: handleTopUpPayoffBalance() -> calculatePartialPaymentBalance() === Test Complete ===