Overview
The inventory system tracks products available for sale, manages stock levels, monitors pricing margins, and integrates with the POS system for automatic stock deduction.Prerequisites
- Permission:
productos.ver(View Products) - Active user account (typically Administrador or Cajero role)
Product Management
Accessing Product Catalog
Navigate to/productos to view and manage inventory.
The products page displays:
- Product name and barcode
- Category and type
- Purchase and sale prices with margin calculation
- Current stock levels
- Active/Inactive status
src/pages/productos.jsx
Product Data Structure
Creating Products
const existeCodigoRegistrado = (codigo, idActual = null) => {
const codigoNormalizado = normalizarCodigo(codigo);
if (!codigoNormalizado) return false;
return productos.some((p) => {
const mismoCodigo = normalizarCodigo(p.codigo) === codigoNormalizado;
const otroProducto = idActual ? p.id !== idActual : true;
return mismoCodigo && otroProducto;
});
};
Barcode codes must be unique across all products. The system alerts you on blur if a duplicate is detected.
Editing Products
There are two ways to edit products:1. Edit from Product Table
Click “Editar” on any product row to open the edit modal with pre-filled data.2. Quick Edit by Barcode
Click “Modificar por codigo” to:- Scan or type the product barcode
- System searches for matching product
- Edit modal opens with that product’s data
- Make changes and save
The “Modificar por codigo” feature is perfect for quick price updates or stock adjustments using a barcode scanner.
Stock Management
Manual Stock Adjustment
- Edit the product
- Update the Stock field
- Save changes
Automatic Stock Deduction
Stock decreases automatically when:- Product sold in POS:
- Service boleta items consumed:
- When a service with attached parts list is sold
- Products listed in
servicio.boleta.itemsare deducted - Service flagged with
boletaStockAjustado: true
Stock Validation in POS
src/pages/POS.jsx:702-777
Pricing & Margins
Margin Calculation
The system displays profit margin for each product:- Purchase Price: $50
- Sale Price: $89
- Margin: 78%
Price Comparison Tool
During POS sales, click “Comparar” to view marketplace prices and adjust your pricing strategy. See:src/components/modal_comparador_precios.jsx
Product Types
Producto (Product)
Standard retail items for sale:- Consumer electronics
- Accessories
- Peripherals
Refacción (Replacement Part)
Parts used in repairs:- Laptop screens
- Hard drives
- RAM modules
- Batteries
Servicio (Service)
Billable services without physical inventory:- Software installation
- Virus removal
- Data recovery
All types follow the same stock management rules. “Servicio” type products can have stock = 0 if they’re purely labor.
Low Stock Alerts
ThestockMinimo field sets the reorder threshold:
Implement a custom report or dashboard widget to monitor products below minimum stock levels for proactive reordering.
Service Boletas
Services can include a parts list (boleta) tracking components used:- Technician adds parts to service boleta during repair
- Service marked as “Listo”
- Service added to POS cart
- POS calculates total stock requirements (cart + boleta)
- On sale confirmation, all boleta items deducted from inventory
- Service flagged:
boletaStockAjustado: true
src/pages/POS.jsx:131-171
Barcode Scanning
The system supports standard USB barcode scanners:- In POS: Scan to add products to cart
- In Products: Use “Modificar por codigo” for quick edits
- Barcodes should be unique identifiers (EAN, UPC, or internal SKUs)
src/pages/POS.jsx:235-255
Deleting Products
- Click “Eliminar” on product row
- Confirm deletion in alert dialog
- Product removed from database
Best Practices
Unique Barcodes
Always use unique barcode identifiers to prevent scanning conflicts in POS.
Set Minimum Stock
Configure stockMinimo for critical items to avoid stockouts during repairs.
Track Margins
Monitor profit margins to ensure sustainable pricing across product categories.
Deactivate, Don't Delete
Set activo=false for discontinued items instead of deleting them.
Reporting
Inventory Value
Potential Revenue
Low Stock Items
Troubleshooting
“Codigo ya esta dado de alta” error?- Barcode already exists in system
- Search for existing product by code
- Update existing product instead of creating duplicate
- Use internal SKU if manufacturer barcode conflicts
- Should never happen with validation in place
- Indicates manual database modification or race condition
- Reset to 0 and investigate transaction history
- Check both cart quantities and service boleta items
- One product may be required in multiple places
- Update stock levels if physical inventory is higher
- Verify scanner is in keyboard emulation mode
- Test by scanning into a text editor
- Check for correct terminator character (usually Enter)
- Ensure 120ms auto-add delay is sufficient for your scanner
Related Workflows
- Processing Sales - How POS uses inventory
- Creating Service Tickets - Service boleta creation
- Permissions & Roles - Understanding the
productos.verpermission
