Overview
The Inventory Management module provides complete control over product catalog, stock levels, pricing, and profit margins. It integrates seamlessly with the POS system for automatic stock deduction.Key Features
Product Catalog
Manage products, parts, and services with detailed information and categorization
Barcode Integration
Assign and manage unique barcodes for quick scanning at point of sale
Stock Tracking
Real-time inventory levels with minimum stock alerts
Profit Margins
Automatic margin calculation between purchase and sale prices
Quick Lookup
“Modify by Code” feature for rapid product updates via barcode scanner
Active/Inactive
Control product visibility in POS without deleting records
Product Data Structure
Field Descriptions
| Field | Required | Description |
|---|---|---|
| nombre | Yes | Product name displayed in POS |
| codigo | Yes | Unique barcode identifier |
| categoria | No | Product category (e.g., “RAM”, “Discos”) |
| tipo | Yes | Product type: product, part, or service |
| precioCompra | No | Purchase cost (for margin calculation) |
| precioVenta | Yes | Selling price |
| stock | Yes | Current inventory quantity |
| stockMinimo | No | Alert threshold for low stock |
| compatible | No | Device compatibility notes |
| generaPuntos | Yes | Whether purchase earns loyalty points |
| activo | Yes | Product availability in POS |
Product List Interface
The main inventory page shows all products in a comprehensive table:Table Columns
| Column | Displays |
|---|---|
| Producto | Product name |
| Codigo | Barcode number |
| Categoria | Product category |
| Compra | Purchase price |
| Venta | Sale price |
| Margen | Calculated profit percentage |
| Stock | Current inventory |
| Estado | Active/Inactive badge |
| Acciones | Edit and Delete buttons |
Creating Products
Standard Creation Flow
- Click ”+ Nuevo Producto” button
- Fill in the product form:
- System validates required fields
- Duplicate code check is performed
- Product is saved to Firestore
The barcode field (codigo) must be unique across all products. The system will alert you if you try to use a duplicate code.
Product Form Fields
Basic Information
Basic Information
- Nombre: Product display name
- Codigo de barras: Scannable barcode
- Categoria: Optional grouping (e.g., “Componentes”, “Periféricos”)
Product Type
Product Type
Three options available:
- Producto: Finished goods for sale
- Refaccion: Repair parts/components
- Servicio: Service items (labor, diagnostics)
Pricing
Pricing
- Precio compra: Your acquisition cost
- Precio venta: Customer price (required)
- Margin is auto-calculated on save
Inventory
Inventory
- Stock: Current quantity on hand
- Stock minimo: Reorder point threshold
- System doesn’t auto-reorder, but highlights low stock
Additional
Additional
- Compatible con: Free text for device compatibility
- Example: “Laptop HP 15-dy2xxx, Dell Inspiron 15”
Barcode-Based Editing
The “Modificar por codigo” feature enables rapid updates:Workflow
- Click “Modificar por codigo” button
- Modal appears with barcode input
- Scan or type barcode
- Press Enter or click “Buscar producto”
- System searches for matching product:
- Product form opens pre-filled
- Make changes and save
Duplicate Code Prevention
The system enforces unique barcodes:- On blur of the codigo field
- Before saving (create or update)
Profit Margin Calculation
Margins are automatically calculated and displayed:Stock Management
Manual Stock Updates
Automatic Stock Deduction (POS)
When a sale is completed in POS:Stock Validation in POS
Before allowing a sale:Low Stock Monitoring
Products with stock belowstockMinimo should be visually highlighted:
While the current UI doesn’t automatically display low stock alerts, you can implement a dashboard widget to show products needing reorder.
Product Types and Usage
Producto (Product)
- Finished goods for direct sale
- Examples: Keyboards, mice, cables
- Generates loyalty points by default
- Full stock tracking
Refaccion (Part)
- Components used in repairs
- Examples: RAM modules, hard drives, screens
- Often added to service boletas (parts lists)
- Stock deducted when service is paid
Servicio (Service)
- Service catalog items
- Examples: OS installation, virus removal
- Typically doesn’t affect physical inventory
- Can be sold standalone in POS
Product Activation States
Active Products
Inactive Products
Editing Products
Edit Flow
- Click “Editar” button on product row
- Form opens with current values:
- Modify fields
- Code uniqueness is validated (excluding current product)
- Save updates product in Firestore
Constraints
- Codigo: Can be changed if new code is unique
- Stock: Can be manually adjusted
- Prices: No restrictions on changes
- History: No audit trail in current implementation
Deleting Products
Firebase Operations
Create Product
Update Product
Load All Products
Integration with Other Modules
POS Integration
- Products loaded on POS mount
- Real-time stock validation
- Barcode scanning for quick lookup
- Price display and cart addition
Service Boletas
- Parts can be added to service boletas
- Stock reserved when service marked “listo”
- Stock deducted when service paid in POS
Reports
- Sales by product
- Profit margins by item
- Stock movement history
- Low stock alerts
Best Practices
Barcode Standards
Use standard barcode formats (UPC, EAN) for products. For custom items, create a consistent internal numbering system.
Stock Audits
Regularly verify physical stock matches system records. Update discrepancies immediately.
Pricing Strategy
Set purchase prices to accurately calculate margins. Review margins regularly to ensure profitability.
Categories
Establish consistent category names to simplify inventory organization and reporting.
Technical Implementation
The inventory system uses:src/pages/productos.jsx- Main interfacesrc/js/services/POS_firebase.js- Data layersrc/css/productos.css- Styling
- Collection:
productos - Indexes:
codigo,activo - Security: Write requires authentication
