=== Testing Exact ESS Loan Topup Calculation (No Payoff Factor) === Testing Loan: URL013572 -------------------------------------------------- Original Principal: 6,397,076.00 Total Tenure: 36 months Installments Paid: 5 Effective Principal Factor: 0.6695 Effective Principal: 4,282,842.38 Calculated Payoff: 3,775,683.99 Expected Payoff: 3,774,876.79 ✗ ERROR: Difference of 807.20 ============================================================ Testing Loan: TEST002 -------------------------------------------------- Original Principal: 5,000,000.00 Total Tenure: 36 months Installments Paid: 10 Effective Principal Factor: 0.6695 Effective Principal: 3,347,500.00 Calculated Payoff: 2,534,482.49 ============================================================ Testing Loan: TEST003 -------------------------------------------------- Original Principal: 3,000,000.00 Total Tenure: 24 months Installments Paid: 5 Effective Principal Factor: 0.6695 Effective Principal: 2,008,500.00 Calculated Payoff: 1,628,668.61 ============================================================ DETAILED CALCULATION FOR URL013572: ============================================================ Step 1: Convert original principal to effective principal Original: 6,397,076.00 Factor: 0.6695 Effective: 4,282,842.38 Step 2: Calculate interest factors Annual Rate: 12% Monthly Rate: 1.0000% (1 + r)^n = 1.4307687835916 (1 + r)^m = 1.0510100501 Step 3: Apply reducing balance formula Numerator: (1+r)^n - (1+r)^m = 0.379759 Denominator: (1+r)^n - 1 = 0.430769 Ratio: 0.881584 Step 4: Calculate final payoff Payoff = Effective Principal × Ratio Payoff = 4,282,842.38 × 0.881584 Payoff = 3,775,683.99 RESULT: The exact payoff amount is 3,775,683.99 Expected: 3,774,876.79 Difference: 807.20