The Credit Management module is the core of CashMan H.A.’s lending operations. It handles every stage of a credit request — from the initial customer application through dual-level institutional review (Management and Presidency), contract signing, monthly installment generation, payment processing, and final archiving once the obligation is fulfilled or cancelled. All database interactions are performed exclusively through stored procedures; no raw SQL is written in the application layer.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.
Credit Types
CashMan H.A. offers three credit products. Each product defines its own interest rate range, financing limits, and eligible client types.Personal Loans (Personales)
Available for Asalariado (salaried), Independiente (self-employed), and Jubilado (retired) clients.
- Interest rate: 3%–20% monthly
- Max financing: $10,000 (salaried/retired) · $15,000 (self-employed)
- Max term: 120 months
Mortgage Loans (Hipotecarios)
Available for Asalariado and Independiente clients.
- Interest rate: 1.05%–12% monthly
- Financing: $30,000–$3,000,000 (up to 90% of property value)
- Max term: 20 years
Vehicle Loans (Vehiculos)
Available for Asalariado and Independiente clients.
- Interest rate: 10%–60% monthly
- Max financing: $100,000 (salaried) · $200,000 (self-employed)
- Max term: 90 months
- Includes GPS service fee added to monthly installment
Credit Lifecycle
Every credit request passes through a strict sequential workflow before funds are disbursed and installments begin.Application — Customer Service Staff
A Customer Service employee (Role 4) registers a new credit assignment on behalf of the client. The model method
RegistroNuevaAsignacionesCreditosClientes() calls the stored procedure IngresoSolicitudNuevosPrestamosClientes_NuevasAsignaciones.The record includes the client type (Asalariado, Independiente, or Jubilado), requested financing amount, desired term, salary information, and personal/work references. The initial progreso_solicitud is set to 0.First Review — Gerencia (Management)
Management (Role 3) reviews the application and records observations. The method
ActualizacionPrimeraRevisionNuevaAsignacionesCreditosClientes() calls SP ActualizacionDatosNuevasSolicitudesCreditos_PrimeraRevision.At this stage, Management can:- Approve the application for forwarding to Presidency
- Deny the application outright
- Flag for restructuring (
reestructuracion)
progreso_solicitud field advances, and ObservacionesGerencia is populated.Second Review — Presidencia (Presidency)
Presidency (Role 2) issues the final institutional decision via
ActualizacionSegundaRevisionNuevaAsignacionesCreditosClientes(), which calls SP ActualizacionRevisionFinalPresidencia_SolicitudCreditoClientes.Only after Presidency approval does the credit status transition to aprobado and the progreso_solicitud reach 100. The ObservacionesPresidencia field is recorded for audit purposes.Contract & Installment Generation
Once approved, Customer Service generates the monthly installment schedule. The method
RegistroAsignacionCuotasMensualesClientes() calls SP RegistrarCuotasMensualesNuevosCreditosClientes, which creates one installment record per month for the agreed term.Simultaneously, a signed contract copy is generated as a PDF (using the FPDF library) and saved. The contract path is stored via RegistroCopiaContratoFinalClientes() — SP RegistroCopiaContratoClientesFinal.Payment Processing — Orden de Pago
Clients pay monthly installments through Customer Service. The method
PagosCuotasClientes_TransaccionesCreditos() calls SP RegistroPagoCuotasCreditosClientes_OrdenPagosCashManHa.After each successful payment, the database trigger CambioEstadoCuotas_OrdenPagoCreditosClientes automatically updates the installment record to estadocuota = 'cancelado'. The progreso_pagocredito field (0–100 tinyint) advances proportionally with each paid installment.Archiving — Historic Records
When a credit is completed or cancelled, it is moved to the historic tables:
- Credit record:
EnvioSolicitudesCreditosAlHistoricoCreditos()— SPEnvioHistoricoSolicitudesCreditos→ writes tohistoricocreditos - Installment records:
RegistroAsignacionCuotasMensualesClientesHistorico()→ writes tohistoricocuotascreditos
Credit Status Values
Theestado_actual column on the creditos table tracks where a request stands at any given point.
| Status | Meaning |
|---|---|
en proceso | Application received; under review by Gerencia or Presidencia |
aprobado | Presidency has approved; installments generated |
denegado | Denied by Gerencia or Presidencia |
cancelado | Credit fully repaid or manually cancelled |
reestructuracion | Flagged by Gerencia for balance adjustment before continuation |
Progress Fields
Twotinyint(3) columns (range 0–100) provide a visual progress indicator in the UI:
| Field | Tracks |
|---|---|
progreso_solicitud | Advances as the application moves through each review stage (0 → 100) |
progreso_pagocredito | Advances as monthly installments are paid (0 → 100) |
Key Model Methods
| Method | Stored Procedure | Purpose |
|---|---|---|
ConsultaGeneralCreditosAprobadosActivos() | ConsultaListadoGeneralCreditosAprobados_EnCurso | List all active approved credits |
ConsultaGeneralCreditosDenegadosClientes() | ConsultaGeneralSolicitudesCreditosDenegadasClientes | List denied requests |
ConsultaClientesMorososCuotas() | ConsultaGeneralListadoGeneralCuotasClientesMorosos | Delinquent clients with overdue installments |
RegistroCopiaContratoFinalClientes() | RegistroCopiaContratoClientesFinal | Save the signed contract copy path |
ActualizacionSaldoCreditosClientes_Reestructuracion() | ActualizacionSaldoCreditosClientes_ReestructuracionSolicitudes | Update outstanding balance for restructured credits |
Credit Restructuring
Credits flagged with statusreestructuracion by Gerencia can have their remaining balance adjusted. Management calls ActualizacionSaldoCreditosClientes_Reestructuracion() to update the saldo_actual field, then the review workflow continues normally toward a final Presidency decision.
PDF Contract Generation: Contract copies are automatically generated using the FPDF library, with a separate template for each credit product (Personal, Mortgage, Vehicle). Generated PDF files are stored on the server under
vista/copiacontratosclientes/. Clients and staff can download these documents at any time from the credit detail view.