Skip to main content

Overview

The sales module allows you to process customer transactions, apply discounts and taxes, track payment methods, and view sales history in real-time.

Accessing Sales

1

Navigate to Sales

Click “Ventas” in the sidebar navigation to open the sales processing page.
2

Review the interface

The sales page has three main sections:
  • Left panel: Sales history with search and filters
  • Center: Sales form for creating new transactions
  • Right: Transaction summary and totals

Creating a Sale

Step 1: Customer Information

1

Enter customer name

In the “Cliente” field, type the customer’s name. The system can track frequent customers for future reference.
2

Select vendor (optional)

Click the “Vendedor” dropdown to assign a sales associate:
  • Click the selector to open the vendor dropdown
  • Use the search box to find a specific vendor
  • Click a vendor name to select them
  • The selected vendor appears in the field
  • System calls salesService.getVendedores() to load available staff

Step 2: Add Products

1

Search for products

In the “Buscar producto” field:
  • Type the product name or scan a barcode
  • System calls salesService.searchProducts() for real-time results
  • Select a product from the search results
2

Specify quantity

After selecting a product, enter the quantity to add to the sale.
3

Review product list

The product table shows:
  • Product name
  • Quantity
  • Unit price
  • Line total
4

Add more products

Click “Agregar producto” to add additional items to the sale.

Step 3: Configure Discounts and Taxes

1

Apply discount percentage

In the “Descuento %” field:
  • Enter a custom discount percentage (0-100)
  • Or click preset buttons for common discounts:
    • 5%
    • 10%
    • 15%
    • 20%
  • Discount amount appears in red in the totals section
2

Set IVA (tax) percentage

In the “IVA %” field:
  • Enter a custom tax percentage
  • Or click preset buttons:
    • 0% (no tax)
    • 16% (standard rate)
  • Tax amount appears in blue in the totals section

Step 4: Select Payment Method

1

Choose payment type

Click one of the payment method buttons:
  • Efectivo (Cash) - Default, green button
  • Tarjeta (Card) - Blue button
  • Transfer (Bank transfer) - Purple button
  • Cheque (Check) - Orange button
  • Digital (Digital wallet) - Indigo button
2

Verify selection

The selected method shows a border highlight and appears in the confirmation text below the buttons.

Step 5: Add Notes (Optional)

1

Enter sale notes

In the “Notas” textarea, add any relevant information:
  • Special delivery instructions
  • Customer preferences
  • Frequent customer notes
  • Any other sale-specific details

Step 6: Review and Complete

1

Check totals

Review the calculation summary:
  • Subtotal: Sum of all products before adjustments
  • Descuento: Discount amount (if applicable)
  • IVA: Tax amount (if applicable)
  • Total: Final amount to collect
2

Click Cobrar

Click the purple “Cobrar” button to process the sale.
3

Confirm transaction

The system:
  • Calls salesService.createSale() with all sale data
  • Updates inventory stock levels automatically
  • Adds the sale to the history panel
  • Clears the form for the next transaction

Viewing Sales History

The left panel shows recent sales transactions:

Filter Sales

1

Search by customer

Use the search bar to find sales by customer name.
2

Filter by time period

Click one of the filter buttons:
  • Todos: All sales
  • Hoy: Today’s sales only
  • Semana: Last 7 days
  • Mes: Last 30 days
3

View statistics

The stats panel shows:
  • Total Ventas: Sum of all filtered sales
  • Transacciones: Number of transactions

View Sale Details

1

Click a sale

Click any sale in the history list to view full details.
2

Review information

The detail view shows:
  • Customer name
  • Vendor name
  • Date and time
  • Products and quantities
  • Discount and tax breakdown
  • Payment method
  • Total amount
  • Notes

Exporting Sales Data

1

Click Exportar

Click the “Exportar” button at the top of the sales form.
2

Download file

The system:
  • Calls salesService.exportSales() to generate a CSV file
  • Includes all filtered sales data
  • Downloads to your computer automatically
  • File named with current date (e.g., ventas_2026-03-03.csv)

Updating Sale Status

For administrators only:
1

Access sale details

View a specific sale from the history panel.
2

Change status

Update the sale status using salesService.updateSaleStatus():
  • Pending
  • Completed
  • Cancelled
  • Refunded

Best Practices

Always verify the total amount with the customer before completing a sale.
  • Verify product availability: Check stock before adding items
  • Double-check quantities: Ensure correct quantities are entered
  • Apply discounts accurately: Verify discount percentages with manager
  • Select correct payment method: Important for accounting and reconciliation
  • Add helpful notes: Record special requests or customer information
  • Review before completing: Always check the total before clicking Cobrar
  • Handle returns properly: Contact administrator for refunds

Common Scenarios

Frequent Customer

1

Type customer name

Start typing a returning customer’s name in the Cliente field.
2

Select from history

If available, select the customer from previous transactions to auto-fill information.

Bulk Purchase with Discount

1

Add all products

Add multiple products with their quantities.
2

Apply bulk discount

Enter the agreed discount percentage (e.g., 15% for orders over $1000).
3

Review discounted total

Verify the final amount reflects the correct discount.

Mixed Payment Methods

For now, select the primary payment method. For split payments, contact your administrator.

Troubleshooting

Product Not Found

  • Verify the product name spelling
  • Check if product exists in inventory
  • Try searching by barcode
  • Contact inventory manager if product should exist

Sale Won’t Complete

  • Ensure all required fields are filled
  • Check that customer name is entered
  • Verify products are added to the sale
  • Confirm payment method is selected
  • Check your internet connection

Incorrect Total

  • Verify product quantities are correct
  • Check discount percentage is accurate
  • Ensure IVA rate is correct (usually 0% or 16%)
  • Recalculate manually if needed

Technical Reference

Sales operations use the salesService.js service:
  • Search products: salesService.searchProducts(searchTerm, limit)
  • Get vendors: salesService.getVendedores(includeInactive)
  • Create sale: salesService.createSale(saleData)
  • Get sales: salesService.getSales(filters)
  • Get sale details: salesService.getSale(saleId)
  • Update status: salesService.updateSaleStatus(saleId, status)
  • Export sales: salesService.exportSales(filters)
All requests require authentication and use the API base URL: https://cemac-api.vercel.app.

Build docs developers (and LLMs) love