Form Layout
The new product form uses a two-column layout for efficient data entry:Left Column
Product information, description, category, brand, and product image upload
Right Column
Pricing details, profit margin calculation, and inventory control settings
Product Information Section
The primary product details card includes essential identification fields:Product Name *
Required field - The main product name that appears throughout the system, on sales receipts, and in the POS catalog.
Product Description
- Features and specifications
- Usage instructions
- Technical details
- Compatibility information
Category Selection *
Available Categories
Available Categories
Required field - Choose from predefined categories:
- Audio - Headphones, speakers, audio equipment
- Electrónica - Electronic devices and equipment
- Periféricos - Computer peripherals (keyboards, mice)
- Accesorios - Cables, adapters, and accessories
Brand/Manufacturer
- SoundMax
- TechLine
- KeyCraft
- ErgoTech
- ConnectPro
Pricing Configuration
The pricing card manages all financial aspects of the product:Purchase Price (Cost) *
Sale Price *
Automatic Profit Margin Calculation
The system automatically calculates and displays profit margin as you enter pricing:Margin Formula:
((Sale Price - Purchase Price) / Sale Price) × 100Example:- Purchase Price: $50.00
- Sale Price: $89.99
- Calculated Margin: 44.5%
Pricing JavaScript Logic
The profit margin calculation is implemented innuevo-producto.js:5:
- Monitors both cost and sale price fields
- Validates that both values are positive
- Calculates percentage margin
- Displays result formatted to 1 decimal place
Inventory Control Settings
The Control de Inventario card manages stock tracking:Initial Quantity *
Minimum Stock Level
- When current stock drops below this number, the system displays warnings
- Dashboard shows “Stock Bajo” alerts
- Product appears with orange badge in inventory
Set minimum stock based on:
- Average daily sales velocity
- Supplier lead time
- Seasonal demand fluctuations
- Storage capacity
Maximum Stock Level
- Prevents overstocking
- Helps with warehouse space planning
- Guides reorder quantities
Product Image Upload
The image upload card provides a drag-and-drop interface:Supported Formats
- JPG/JPEG - Standard photo format
- PNG - Transparent backgrounds supported
- WEBP - Modern compressed format
File Size Limit
Maximum: 5 MB per imageForm Actions
Three action buttons control the form submission:Cancel Button
Save Draft Button
Stores product information without finalizing the entry. Allows you to:- Save work in progress
- Return later to complete details
- Prevent data loss
Save Product Button ✅
The primary action button validates and saves the product:Validation Rules
Before saving, the system validates:Required Fields
- Product Name
- Category
- Purchase Price
- Sale Price
- Initial Quantity
Data Types
- Numeric values for prices and quantities
- Positive numbers only
- Proper decimal formatting
Field Dependencies
Some fields interact with each other:Profit Margin Auto-Update
The margin field automatically recalculates when:- Purchase price changes
- Sale price changes
- Either field is cleared
Data Integration
Once saved, product data is:- Stored in Firebase database
- Appears immediately in inventory list
- Available in POS catalog for sales
- Included in reports and analytics
- Tracked for stock alerts based on minimum levels
Commented/Optional Fields
The source code includes several commented-out fields that could be enabled:Available Optional Fields
Available Optional Fields
SKU Code (panel_nuevo_producto.html:70-73)
- Unique product identifier
- Barcode scanning support
- UPC/EAN code entry
- Retail barcode standard
- Choose from supplier list
- Reorder automation
- IVA 16%
- IVA 19%
- No tax option
- Aisle and shelf position
- Physical inventory tracking
- Unit (und.)
- Kilogram (kg)
- Liter (L)
- Box (Caja)
These fields are currently disabled in the interface but can be activated by uncommenting the HTML sections for advanced inventory management features.
After Saving
When a product is successfully saved:- Confirmation message appears
- System redirects to inventory page
- New product appears in the table
- Product is available for POS transactions
- Stock tracking begins immediately