Overview Metrics
At the top of the sales history page, three key metric cards summarize the selected period:Total del Período
$32,840 across 124 transactions for the selected date range
Promedio por Venta
$265 average transaction value with trend comparison
Canceladas
3 sales canceled, representing 2% of total transactions
Metrics automatically update based on your selected date range and filter criteria, providing dynamic insights into sales performance.
Search and Filter System
The sales history page features comprehensive filtering tools:Search Input
- Sale number (e.g., #1047)
- Customer name (e.g., María García)
- Product names in the transaction
Date Range Filter
Two date picker inputs for selecting custom periods:Status Filter
Transaction Status Options
Transaction Status Options
- Todos los estados - Show all transactions
- Completada - Successfully processed sales
- Pendiente - Sales awaiting completion
- Cancelada - Canceled transactions
- Reembolsada - Refunded sales
Export Functionality
- External reporting
- Accounting integration
- Tax preparation
- Performance analysis
Sales History Table
The main table displays detailed transaction information:Table Columns
| Column | Description | Example |
|---|---|---|
| # Venta | Unique transaction ID | #1047 |
| Fecha | Date and time | 17/02/2026 10:42 AM |
| Cliente | Customer name | María García |
| Productos | Item count | 2 productos |
| Subtotal | Pre-tax amount | $330.00 |
| Descuento | Applied discount | $10.00 |
| Total | Final amount | $320.00 |
| Estado | Status badge | Completada |
| Acciones | View details button | Ver Detalle |
Transaction Examples
The system displays real transaction data with full context:Completed Sale
Sale #1047 - María García
Sale #1047 - María García
Transaction Details:
- Sale Number: #1047
- Date: 17/02/2026 at 10:42 AM
- Customer: María García
- Products: 2 items
- Subtotal: $330.00
- Discount: $10.00
- Total: $320.00
- Status: ✅ Completada (green badge)
Pending Transaction
Sale #1045 - Ana Torres
Sale #1045 - Ana Torres
Transaction Details:
- Sale Number: #1045
- Date: 16/02/2026 at 05:58 PM
- Customer: Ana Torres
- Products: 3 items
- Subtotal: $210.50
- Discount: $20.00
- Total: $190.50
- Status: ⚠️ Pendiente (orange badge)
Canceled Sale
Sale #1044 - Unregistered Customer
Sale #1044 - Unregistered Customer
Transaction Details:
- Sale Number: #1044
- Date: 16/02/2026 at 02:30 PM
- Customer: Sin registrar
- Products: 5 items
- Subtotal: $89.99
- Discount: —
- Total: $89.99
- Status: ❌ Cancelada (red badge)
Refunded Transaction
Sale #1043 - Pedro Martínez
Sale #1043 - Pedro Martínez
Transaction Details:
- Sale Number: #1043
- Date: 15/02/2026 at 11:00 AM
- Customer: Pedro Martínez
- Products: 2 items
- Subtotal: $398.00
- Discount: $15.00
- Total: $383.00
- Status: ⚪ Reembolsada (gray badge)
Transaction Status Badges
Color-coded badges provide instant visual status recognition:Completada
Green badge indicates successful, finalized transaction
Pendiente
Orange badge for transactions awaiting action
Cancelada
Red badge marks canceled sales
Reembolsada
Gray badge indicates refunded transactions
Transaction Details
Click “Ver Detalle” on any transaction to access:- Complete product list with quantities
- Individual item prices
- Payment method used
- Staff member who processed the sale
- Customer contact information
- Transaction timestamps
- Receipt generation
The detail view functionality is referenced in the interface but requires implementation in ventas.js for full transaction drill-down capabilities.
Data Integration
The sales history integrates with Firebase (ventas.js:1) to:- Load transaction history from database
- Real-time sync of new sales
- Update transaction statuses
- Maintain historical records
Customer Information
Transaction records capture customer data: Registered Customers:- Full name displayed
- Links to customer profile
- Purchase history tracking
- Contact information
- Shows “Sin registrar”
- Anonymous transactions
- No customer tracking
Discount Tracking
The system tracks all applied discounts:- Amount: Dollar value of discount
- Display: Shows ”—” when no discount applied
- Impact: Subtotal minus discount equals total (before tax)
Quick Actions
From the sales history page: Header Actions:- + Nueva Venta - Jump to POS system
- 📥 Exportar - Export filtered data
- 🔔 Notifications - System alerts
- ❓ Help - Support resources
Reporting Insights
The sales history provides data for:Performance Metrics
- Total revenue by period
- Average transaction value
- Sales velocity (transactions per day)
- Peak sales times
- Customer purchase frequency
Financial Analysis
- Discount impact on revenue
- Cancellation and refund rates
- Payment method distribution
- Tax collection totals
Inventory Planning
- Best-selling products
- Sales trends by category
- Stock turnover rates
- Seasonal patterns
Date and Time Display
Transactions show precise timing:- Date: DD/MM/YYYY
- Time: 12-hour format with AM/PM
- Displayed in gray text below date
Timestamp precision helps identify peak business hours and staffing needs.
Historical Data Range
The default view shows “Últimos 30 días” (Last 30 days), but you can customize the range using date filters.Product Count Display
Each transaction shows the number of items:[quantity] productos
This gives a quick sense of transaction size without viewing details.
Authentication Integration
The sales history page includes authentication checks (ventas.js:8):- Requires active login session
- Redirects to login if not authenticated
- Protects sensitive sales data
- Logout button in header
Navigation
Access sales history from:- Sidebar: “Registro de Ventas” under Ventas section
- Dashboard: Recent activity feed links
- POS: After completing a transaction
Data Persistence
All transaction data is:- Stored permanently in Firebase
- Backed up automatically
- Available for historical reporting
- Never deleted (only status changed)
Data Retention: Sales records are maintained indefinitely for accounting and audit purposes. Canceled and refunded transactions remain visible with updated status badges.
Future Enhancements
Potential features visible in the codebase structure:- Detailed transaction drill-down views
- Advanced analytics and charts
- Multi-currency support
- Receipt printing and email
- Customer loyalty tracking
- Payment gateway integration