Documentation Index
Fetch the complete documentation index at: https://mintlify.com/obando1998/Proyecto_UCP/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Consultation Panel provides read-only access to view the history of product returns, shortages, and surpluses in DevolutionSync. Users with consultation access (Grado 3) or higher can search, filter, and review historical return data.Access Requirements: All authenticated users can access the consultation panel. Different user grades (Grado 1, 2, 3) may see different interfaces, but the core functionality remains the same.
Accessing the Consultation Panel
Log in to DevolutionSync
Navigate to the system login page and enter your credentials. All authenticated users with valid sessions can access consultation features.
Navigate to the consultation panel
Access the appropriate URL based on your role:
- Administrator:
index.php?url=consulta/index - Auxiliary:
index.php?url=consulta/auxiliar - Consultation: Use the consultation link in your navigation menu
Understanding the History Table
The consultation panel displays a comprehensive table with the following columns:| Column | Description |
|---|---|
| ID | Unique identifier for the return record (e.g., #1234) |
| Fecha | Date of return creation (format: DD/MM/YYYY) |
| Cliente | Client name from the return record |
| Factura | Invoice number (if available, otherwise displays “N/A”) |
| Estado | Current status badge with visual indicator |
| Acciones | Action button to view detailed information |
Understanding Status Badges
Return records display color-coded status badges:Pendiente
⏳ PendienteYellow badge indicating the return is awaiting administrator review.
- Background:
#fff3cd - Text color:
#856404 - Status: Not yet processed
Aprobado
✅ AprobadoGreen badge indicating the return was approved by an administrator.
- Background:
#d4edda - Text color:
#155724 - Status: Approved
Rechazado
❌ RechazadoRed badge indicating the return was rejected by an administrator.
- Background:
#f8d7da - Text color:
#721c24 - Status: Rejected
CSS Implementation
Status badges are styled using the following CSS (lines 18-20):Viewing Return Details
To view comprehensive information about any return record:Click the 'Ver Detalles' button
In the Acciones column, click the “👁️ Ver Detalles” button for the record you want to review.
Wait for details to load
A modal window opens displaying:
- Loading state: ”⌛ Cargando detalles del registro #…”
- The system fetches data via AJAX from
index.php?url=consulta/detalles&id={id}
Review the complete information
The modal displays all available information including:
- Client information (name and details)
- Current status
- Observations and notes
- Additional fields from the database record
ConsultaController::detalles() (lines 34-58).Download PDF (optional)
Click the ”📥 Descargar PDF” button to export the return details as a PDF document.
- Filename format:
Devolucion_{id}.pdf - Uses
html2pdf.jslibrary for conversion - PDF settings: A4 format, portrait orientation, 10mm margins
Details Modal Functionality
The details modal is implemented with the following features:AJAX Loading
Details are fetched dynamically using JavaScript:Server-Side Response
The controller returns JSON with HTML content:PDF Export Functionality
The consultation panel includes built-in PDF export capabilities:How PDF Generation Works
PDF Export Settings
| Setting | Value | Purpose |
|---|---|---|
| Margin | 10mm | Space around page edges |
| Format | A4 | Standard paper size (210 × 297 mm) |
| Orientation | Portrait | Vertical page layout |
| Image Quality | 0.98 | High-quality image rendering |
| Scale | 2 | Higher resolution for better quality |
| CORS | Enabled | Load images from external sources |
Empty State Handling
If no records exist in the system, the table displays a friendly empty state:- No returns have been registered yet
- Or the database query returned no results
- Check with administrators if you expect to see data
Data Retrieval Process
Understanding how consultation data is fetched:Database query execution
The model executes a SQL query:Default limit: 100 records (can be customized)
Statistics Overview
The panel header displays a total count badge:Modal Design and Styling
The details modal features a modern, responsive design:Modal Structure
Visual Features
- Backdrop: Semi-transparent dark overlay with blur effect
- Animation: Smooth slide-in effect (0.3s ease)
- Responsiveness: 80% width, max 900px
- Scrolling: Max height 75vh with vertical scroll
- Rounded corners: 12px border radius
- Shadow: Elevated card with box-shadow
Animation Keyframes
Best Practices for Using the Consultation Panel
Efficient Searching
Efficient Searching
- Use browser search (Ctrl+F / Cmd+F) to find specific client names or IDs
- Note the date format (DD/MM/YYYY) when looking for specific time periods
- Check status badges for quick filtering by approval state
- Reference invoice numbers for accounting reconciliation
Understanding Return Status
Understanding Return Status
- Pendiente: Return awaits administrator review - expect processing soon
- Aprobado: Return was approved - check approval observations for details
- Rechazado: Return was rejected - review rejection reason in observations
- Track return IDs to monitor progress from submission to resolution
Using PDF Exports
Using PDF Exports
- Export critical records for offline review or archival
- PDFs maintain official format for compliance and auditing
- Share PDFs with stakeholders who don’t have system access
- Keep exported PDFs organized by date or status for easy reference
Data Interpretation
Data Interpretation
- Cross-reference return dates with delivery schedules
- Analyze patterns in rejection reasons to improve submission quality
- Note which clients have frequent returns for follow-up
- Review administrator observations for process improvement insights
Security and Access Control
Session Validation
The consultation controller verifies user authentication:- Users must have an active logged-in session
- No session = automatic redirect to login page
- All authenticated users can view consultation data
Read-Only Access
The consultation panel is strictly read-only:- No edit or delete capabilities
- No form submissions
- No data modification permitted
- Only viewing and exporting allowed
This design ensures data integrity and provides safe access for users who need visibility without modification rights.
Error Handling
The system handles various error scenarios gracefully:AJAX Request Failures
If the details request fails:- Network connectivity issues
- Server timeout
- Invalid return ID
- Database connection failure
Record Not Found
If a return ID doesn’t exist:Database Errors
The model includes error handling:- Errors are logged to server error log
- Empty array returned to prevent crashes
- User sees empty table state
Troubleshooting
Can’t See Any Records
- Cause: No returns have been registered, or database is empty
- Solution: Contact administrators to verify data exists. If you’re an auxiliary user, try registering a test return.
Modal Won’t Open
- Cause: JavaScript errors or browser compatibility issues
- Solution:
- Check browser console for errors (F12)
- Ensure JavaScript is enabled
- Try refreshing the page
- Clear browser cache
Details Won’t Load in Modal
- Cause: Network error, invalid ID, or server issue
- Solution:
- Check your internet connection
- Verify the return ID exists
- Try a different record
- Contact technical support if issue persists
PDF Export Not Working
- Cause: CDN not accessible, browser compatibility, or popup blocker
- Solution:
- Check if cdn.cloudflare.com is accessible
- Disable popup/download blockers temporarily
- Try a different browser
- Check browser console for errors
Status Badge Colors Wrong
- Cause: CSS not loaded or browser caching issue
- Solution: Hard refresh the page (Ctrl+Shift+R / Cmd+Shift+R) to reload styles
Can’t Access Consultation Panel
- Cause: Not logged in or session expired
- Solution:
- Navigate back to login page
- Re-enter your credentials
- If issue persists, contact system administrator
Advanced Features (Future Development)
The consultation panel includes placeholder functions for future enhancements:Filtering
Currently displays a message: “Función de filtrado en desarrollo” Planned features:- Filter by status (Pendiente, Aprobado, Rechazado)
- Filter by date range
- Filter by client name or NIT
- Filter by product
- Filter by return reason
Export Options
Currently displays a message: “Función de exportación en desarrollo” Planned features:- Export full table to Excel/CSV
- Export filtered results
- Export date range summaries
- Scheduled report generation
Understanding the Database Query
The consultation panel retrieves data using:- **SELECT ***: Fetches all columns from the table
- ORDER BY fecha_creacion DESC: Sorts by creation date, newest first
- LIMIT ?: Restricts results (default 100 records)
id- Unique identifiernit- Client tax IDnombre_cliente- Client namedireccion- Delivery addressitem_producto- Product item codedescripcion_producto- Product descriptionunidad- Unit of measurementkg- Weight per unitmotivo- Return reasoncantidad_und- Quantity in unitscantidad_kg- Quantity in kilogramsobservacion- User observationsusuario_creador- Username who created the returnestado- Current statusfecha_creacion- Creation timestampevidencia- Path to evidence photocodigo_admin- Administrator authorization codeobservacion_admin- Administrator observationsusuario_revisor- Username who reviewedfecha_revision- Review timestamp
Related Resources
- Administrator Guide - Learn how to review and approve returns
- Auxiliary User Guide - Learn how to register new returns
- API Reference - Technical controller documentation
- Database Schema - Complete table structure