Skip to main content
The Sales Tracking module provides complete visibility into your transaction history with powerful filtering, search capabilities, and detailed reporting metrics.

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

🔍 Buscar por # venta, cliente o producto...
Search across multiple fields:
  • 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:
[Start Date] [End Date]
Use date range filtering to generate period-specific reports:
  • Daily sales summaries
  • Weekly performance reviews
  • Monthly revenue reports
  • Year-over-year comparisons

Status Filter

  • Todos los estados - Show all transactions
  • Completada - Successfully processed sales
  • Pendiente - Sales awaiting completion
  • Cancelada - Canceled transactions
  • Reembolsada - Refunded sales

Export Functionality

📥 Exportar
Export filtered sales data for:
  • External reporting
  • Accounting integration
  • Tax preparation
  • Performance analysis

Sales History Table

The main table displays detailed transaction information:

Table Columns

ColumnDescriptionExample
# VentaUnique transaction ID#1047
FechaDate and time17/02/2026
10:42 AM
ClienteCustomer nameMaría García
ProductosItem count2 productos
SubtotalPre-tax amount$330.00
DescuentoApplied discount$10.00
TotalFinal amount$320.00
EstadoStatus badgeCompletada
AccionesView details buttonVer Detalle

Transaction Examples

The system displays real transaction data with full context:

Completed Sale

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)
This represents a successful transaction with a $10 discount applied.

Pending Transaction

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)
Transaction awaiting completion - possibly pending payment or fulfillment.

Canceled Sale

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)
Canceled transaction with no customer information recorded.

Refunded Transaction

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)
Completed sale that was later refunded to the customer.

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
import { auth } from "./firebase.js";
import { onAuthStateChanged, signOut } from "firebase-auth.js";

Customer Information

Transaction records capture customer data: Registered Customers:
  • Full name displayed
  • Links to customer profile
  • Purchase history tracking
  • Contact information
Unregistered Sales:
  • Shows “Sin registrar”
  • Anonymous transactions
  • No customer tracking
Encourage staff to collect customer names during checkout to build a customer database for marketing and loyalty programs.

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:
17/02/2026
10:42 AM
Format:
  • 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:
2 productos
3 productos  
5 productos
Format: [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):
onAuthStateChanged(auth, async (usuario) => {
    if (!usuario) {
        window.location.href = "login.html";
    }
});
Security Features:
  • Requires active login session
  • Redirects to login if not authenticated
  • Protects sensitive sales data
  • Logout button in header
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
Best Practice: Review sales history daily to identify trends, catch errors, and ensure all transactions are properly categorized with the correct status.

Build docs developers (and LLMs) love