The Reportes module provides a unified view of operational data across two record types: raw-material intake history from theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanDiego3030/Planta_Milenio/llms.txt
Use this file to discover all available pages before exploring further.
Historial model and personnel access history from the AccesoPersona model. Supervisors can filter either dataset by date range, review the records on screen, and download a formatted PDF suitable for filing or external review. All PDFs are generated server-side with WeasyPrint and served as direct file downloads.
Required Permission
Access requires thepermiso_reportes permission. Users without it are redirected on all requests to /reportes/.
Report Types
Switch between report types using thetipo query parameter. The default when tipo is omitted is materia_prima.
- Materia Prima
- Personal
URL parameter:
?tipo=materia_primaQueries the local Historial table — the same records created by the Control de Entradas module. Each row in the report shows:| Column | Description |
|---|---|
| Vehicle plate | Vehiculo_Placa of the entering vehicle |
| Order number | fact_num of the associated purchase order |
| Product description | Product line registered at entry |
| Entry timestamp | hora_entrada auto-set at registration |
| Pending amount | Remaining quantity on the order at time of entry |
Date Filtering
Both report types acceptfecha_inicio and fecha_fin as optional ISO-format date parameters. Filtering is applied on the entry timestamp field for both models.
fecha_inicio (to see everything from a start date forward) or only fecha_fin (to see everything up to a date). When neither is supplied, the view returns up to 200 records.
Downloading PDFs
Each report type has a dedicated PDF download endpoint. Append the same date filters you used in the on-screen view to get a matching PDF export.Content-Type: application/pdfContent-Disposition: attachment— the browser will prompt a file download rather than attempting to display the PDF inline
Quick Reference
Materia Prima Report
On-screen view:
GET /reportes/?tipo=materia_primaPDF export: GET /reporte_pdf/materia_prima/Source model: Historial (local SQLite)Personal Report
On-screen view:
GET /reportes/?tipo=personalPDF export: GET /reporte_pdf/personal/Source model: AccesoPersona (local SQLite)