CashMan H.A. uses standard loan amortization formulas to calculate monthly installments, additional fees, and total disbursement amounts for each credit product type. All calculations are performed at the time a credit application is submitted and stored in the database. Subsequent installment payments update the remaining balance using a trigger (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DanielRivera03/SistemaBancario/llms.txt
Use this file to discover all available pages before exploring further.
RecalcularSaldoFinal_CreditosClientes) that recalculates the credit balance after each payment is recorded.
Monthly Installment Formula
CashMan H.A. uses the standard amortization (declining-balance) formula to calculate the fixed monthly payment that fully amortizes a loan over its term.Example
A personal loan of $8,000.00 at 5% monthly interest over 36 months:The monthly interest rate
i is stored as a percentage in the database column interescredito. The formula always divides by 100 before use: i = interescredito / 100. Ensure this conversion is applied consistently in any custom reporting queries or exports.Additional Fees
Beyond the base installment, three types of fees may apply to a credit. These are calculated per product type and configured based on the credit amount range.Debt Insurance Fee (Seguro de Deuda)
A monthly protection fee added to each installment. It functions as unemployment/disability insurance for the borrower and is expressed as a percentage of the outstanding credit balance or a fixed amount per bracket.
- Applies to: Personal, Mortgage, and Vehicle loans
- Added to: Monthly installment (
cuotamensual) - Purpose: Unemployment protection — covers payments if the client loses their income source
Administrative Fee (Gastos Administrativos)
A one-time fee deducted from the principal at the moment of disbursement. The client receives less than the face value of the approved loan.
- Applies to: Personal, Mortgage, and Vehicle loans
- Timing: Deducted at disbursement (not spread across installments)
- Effect on installment: The monthly payment is calculated on the full approved principal
P, not the disbursed net amount
GPS Service Fee (Servicio GPS)
A monthly fee for the GPS tracking device installed on the financed vehicle.
- Applies to: Vehicle loans only
- Added to: Monthly installment (
cuotamensual), in addition to the debt insurance fee - Purpose: Enables the lender to locate collateral in the event of non-payment
Total Disbursement Amount
The actual cash amount received by the client after all upfront deductions:The GPS monthly service fee is added to installments, not deducted from disbursement. Only any one-time GPS setup component (if configured in the product) would reduce the disbursed amount.
Fee Summary by Product
| Fee | Personal | Mortgage | Vehicle |
|---|---|---|---|
| Debt Insurance | ✅ Added to installment | ✅ Added to installment | ✅ Added to installment |
| Administrative Fee | ✅ Deducted at disbursement | ✅ Deducted at disbursement | ✅ Deducted at disbursement |
| GPS Monthly Fee | ❌ | ❌ | ✅ Added to installment |
Delinquency (Mora) Calculation
When a client misses an installment payment, a daily late fee accumulates on the overdue installment. The system standard is:consulta-listado-morosos route (accessible to Roles 1 and 3) lists all clients with outstanding delinquency balances.
Credit Balance Precision Fix
The New clones of the repository already include this fix.
saldocredito field that tracks the remaining credit balance uses decimal(15,6) precision. This was increased from the original decimal(9,2) to fix a precision bug where the RecalcularSaldoFinal_CreditosClientes trigger produced incorrect residual balances after multiple payment cycles — particularly on large mortgage amounts or high-precision amortization schedules.If you cloned the repository before this correction was published, update the trigger variable declaration manually:Number-to-Words Conversion for Contracts
Legal contract PDFs require monetary amounts written out in Spanish. CashMan H.A. uses theluecano/numero-a-letras Composer package for this conversion:
PDF Contract Generation Flow
Credit Approved
Once Presidencia grants final approval, the system marks
habilitarsistema = 1 for the client and generates installment records.Contract Data Assembled
The controller fetches the credit details, client personal data, and product information via stored procedure calls.
Monetary Conversion
NumeroALetras converts the principal, total interest, and total payment amounts to Spanish text.PDF Rendered
FPDF (
FPDF/fpdf.php) builds the contract layout, embeds the client’s digital signature image from vista/images/fotofirmas/, and outputs the PDF.