The Inventario module provides end-to-end asset lifecycle management for the cooperative: from purchase order registration and automatic asset creation, through warehouse assignments and state changes tracked as signed actas (PDF acts), to maintenance records and warranty alerts. All routes are grouped underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/corpentunida-org/corpen/llms.txt
Use this file to discover all available pages before exploring further.
/inventario with auth middleware. The module integrates Chart.js dashboards at both the global (tablero) and per-resource level, and supports PDF and Excel exports using DomPDF and PhpSpreadsheet.
Key Sub-modules
Assets (Activos)
The central entity. Each
InvActivo is created automatically when a purchase detail line is saved. It holds nombre, codigo_activo, serial, id_Estado, id_ultimo_usuario_asignado, warranty dates, and a link back to its purchase detail. Search and filter by text, warehouse, brand, subgroup, and state.Warehouses (Bodegas)
InvBodega records define physical storage locations. Assets are associated with a warehouse via the InvReferencia link (id_InvBodegas). The dashboard shows per-warehouse asset counts.Purchases (Compras)
InvCompra records capture supplier invoices (numero_factura, fecha_factura, total_pago, payment method, optional S3 egreso attachment). Each purchase has detail lines (InvDetalleCompra) that drive automatic InvActivo creation in a single DB transaction.Movements (Movimientos)
Actas de movimiento group one or more assets under a single
codigo_acta. Each acta updates the state and assigned user of every included asset. Signed PDF actas can be uploaded back to S3 via POST /inventario/movimientos/{id}/upload.Full Sub-module List
| Controller | Route prefix | Purpose |
|---|---|---|
TableroInventarioController | inventario/tablero | Main dashboard with Chart.js graphs |
CompraController | inventario/compras | Purchase (invoice) CRUD + auto asset generation |
MovimientoController | inventario/movimientos | Movement actas with signed PDF upload |
MantenimientoController | inventario/mantenimientos | Maintenance and repair records |
ActivoController | inventario/activos | Asset master file with PDF/Excel reports and warranty alerts |
MarcaController | inventario/marcas | Brand catalog |
BodegaController | inventario/bodegas | Warehouse catalog |
EstadoController | inventario/estados | Asset state catalog |
MetodoPagoController | inventario/metodos-pago | Payment method catalog |
ClasificacionController | inventario/clasificacion | Hierarchical classification: Grupo → Linea → Tipo → Subgrupo |
Database Tables
| Table | Purpose |
|---|---|
inv_activos | Asset master records |
inv_compras | Purchase/invoice headers |
inv_detalle_compras | Purchase line items (with soft deletes) |
inv_movimientos | Movement acta headers |
inv_movimientos_detalle | Per-asset entries within a movement |
inv_mantenimientos | Maintenance/repair records |
inv_referencias | Product reference catalog (links marca + subgrupo + bodega) |
inv_marcas | Brand catalog |
inv_bodegas | Warehouse catalog |
inv_estados | Asset state catalog (also used as movement type) |
inv_metodos | Payment method catalog |
inv_subgrupos | Classification subgroups |
inv_tipos | Classification types |
inv_lineas | Classification lines |
inv_grupos | Classification groups |
Adding a New Asset to Inventory
Set up the reference catalog
Before recording a purchase, ensure the asset’s product reference exists. Navigate to Existing references can be updated inline via
GET /inventario/compras/create and use the Nueva Referencia modal (AJAX) to create one if needed.PUT /inventario/referencias/ajax/{id}.Record the purchase
Submit IVA and miscellaneous costs are stored as zero-quantity
POST /inventario/compras. The controller wraps everything in a DB transaction:InvDetalleCompra lines with descriptive detalle values (IVA Total ($) / Otros Costos / Varios ($)).Automatic asset creation
For each purchase detail line, the controller creates
(int) $item['cantidad'] InvActivo records in a loop. Each asset is initialized with:nombre→ the subgroup name from the referenceid_Estado = 1(first/default state)id_MaeMunicipios = 382invReferencias_id→ from the detailfecha_inicio_garantia→ the purchase dateid_InvDetalleCompras→ the detail line ID
Update the asset's technical record
Open
GET /inventario/activos/{id}/edit to fill in the remaining fields: codigo_activo, serial, id_Estado, vida_util_meses, warranty end date, assigned user, and municipality. Changes are persisted via PUT /inventario/activos/{id}.Generate a movement acta
Navigate to The controller wraps creation in a DB transaction. If the selected state name contains
GET /inventario/movimientos/create and select one or more assets plus an assignment type (state). Submit POST /inventario/movimientos:disponible or devuel (case-insensitive), the acta is treated as a return and id_ultimo_usuario_asignado is set to null; otherwise the user is assigned.Download the unsigned acta PDF via GET /inventario/movimientos/{id}/pdf. Upload the signed version via POST /inventario/movimientos/{id}/upload (mimes:pdf, max 5 MB → stored at corpentunida/inventario/{timestamp}_{original_name}).Warranty Alerts
GET /inventario/activos/alertas surfaces all assets whose fecha_fin_garantia is set and falls on or before 30 days from today (i.e., already expired or expiring soon). The view includes two KPI cards (expired vs. expiring) and a Chart.js pie chart. Filters by search (name or codigo_activo) and estado_garantia (vencido / por_vencer) are available.
Reports
- PDF Report
- Excel Report
- Purchase Invoice PDF
letter landscape report with asset totals. Downloaded as Reporte_Inventario_{Ymd}.pdf.Classification Hierarchy
Asset categorization follows a four-level hierarchy managed byClasificacionController:
InvReferencia is linked to one InvSubgrupo. Dynamic AJAX selects are available to populate dependent levels: