Skip to main content

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.

CashMan H.A. uses a MySQL database named cashmanha with the utf8mb4 character set. The schema is substantial: 21 tables, 148 stored procedures, 67 views, 21 triggers, and 5 scheduled events. The application contains no inline SQL queries — every database interaction goes through a named stored procedure. Importing all objects in the correct order is therefore essential; a partially imported database will cause stored procedure calls to fail at runtime. The SQL scripts are located in the ScriptSQL/ directory of the repository:
ScriptSQL/
├── Database/              # Full single-file dump
│   └── cashmanha.sql
├── Tables/
│   ├── tbl_cashmanha.sql  # CREATE TABLE statements
│   └── indices.sql        # Indexes and foreign key constraints
├── Insert Data/
│   └── data_inserttables_cashmanha.sql
├── Views/
│   └── vw_cashmanha.sql
├── Stored Procedure/
│   └── sp_cashmanha.sql
├── Triggers/
│   └── tg_cashmanha.sql
└── Events/
    └── ev_cashmanha.sql
Trigger precision bug — fix before importing triggers. The RecalcularSaldoFinal_CreditosClientes trigger contains a variable declaration with insufficient numeric precision that causes incorrect final-balance calculations when processing monthly loan payments. Before importing tg_cashmanha.sql, open the file and change:
-- Original (incorrect precision):
DECLARE _saldocredito decimal(9,2);

-- Corrected:
DECLARE _saldocredito decimal(15,6);
The current version of the repository already includes this fix. If you cloned an older copy of the repository, apply this change manually before executing the trigger script.
Import the scripts in the order below. Using MySQL Workbench is strongly recommended over phpMyAdmin, as Workbench handles large scripts with stored procedures and triggers more reliably.
1

Create the database schema

Connect to your MySQL/MariaDB server and create the database. The application’s connection file defaults to the name cashmanha; if you choose a different name you must update modelo/conexion.php accordingly.
CREATE DATABASE IF NOT EXISTS cashmanha
  CHARACTER SET utf8mb4
  COLLATE utf8mb4_general_ci;

USE cashmanha;
2

Import tables

Execute the table definitions. This creates all 21 InnoDB tables with utf8mb4 charset:
mysql -u root -p cashmanha < ScriptSQL/Tables/tbl_cashmanha.sql
3

Import seed data

Populate the tables with the default reference data (roles, product types, initial users, etc.):
mysql -u root -p cashmanha < "ScriptSQL/Insert Data/data_inserttables_cashmanha.sql"
4

Import indexes and foreign keys

Add the relational constraints and performance indexes after all data has been inserted to avoid constraint violations during the initial load:
mysql -u root -p cashmanha < ScriptSQL/Tables/indices.sql
5

Import views

Create all 67 views. Views depend on the tables existing, so this step must follow the table and data imports:
mysql -u root -p cashmanha < ScriptSQL/Views/vw_cashmanha.sql
6

Import stored procedures

Create all 148 stored procedures. These are the only SQL interface the application uses:
mysql -u root -p cashmanha < "ScriptSQL/Stored Procedure/sp_cashmanha.sql"
7

Import triggers

Apply the trigger precision fix described in the warning above, then import:
mysql -u root -p cashmanha < ScriptSQL/Triggers/tg_cashmanha.sql
8

Import events

Create the 5 scheduled events (used for automated late-payment fee calculations and other time-based jobs). Ensure the MySQL Event Scheduler is enabled on your server (SET GLOBAL event_scheduler = ON;):
mysql -u root -p cashmanha < ScriptSQL/Events/ev_cashmanha.sql

Alternative: One-Step Full Dump Import

If you prefer a single-command import, use the complete database dump. This file contains all objects in dependency order:
mysql -u root -p cashmanha < ScriptSQL/Database/cashmanha.sql
If the one-step import reports any warnings or errors, it means the database was only partially loaded. In that case, drop the schema, re-create it, and follow the step-by-step import above to isolate and resolve the failing statement. After any import method, verify that the object counts match: 21 tables, 148 stored procedures, 67 views, 21 triggers, 5 events.

Database Connection Configuration

The file modelo/conexion.php contains the database credentials and establishes 8 MySQLi connections — one primary connection ($conectarsistema) and seven auxiliary connections ($conectarsistema1 through $conectarsistema7) used on pages that execute multiple concurrent queries.
class conexion
{
    private $servidor = "localhost"; // NOMBRE SERVIDOR
    private $usuario  = "root";      // USUARIO SERVIDOR
    private $clave    = "";          // CONTRASEÑA SERVIDOR (SI LO REQUIERE)
    private $base     = "cashmanha"; // NOMBRE DE BASE DE DATOS
    // ...
}
Update the four credential values to match your MySQL server before starting the application:
PropertyVariableDefaultDescription
Host$servidorlocalhostMySQL server hostname or IP address
Username$usuariorootMySQL user with full privileges on the database
Password$clave"" (empty)MySQL user password
Database$basecashmanhaSchema name created in step 1

Build docs developers (and LLMs) love