Overview
Complete implementation for selling products by weight (meat, fruits, vegetables, dairy, bakery) using EAN-13 barcodes that encode both product identity and weight.
Barcode Format
Format: [Type:2][Product:5][Weight:5][Check:1] = 13 digits
Example: 2012345015007
+-- 20: Meat type
+-- 12345: Product ID
+-- 01500: Weight in grams (1.5kg)
+-- 7: Check digit
Key Features
EAN-13 Barcode Support
- Automatic barcode generation
- Weight encoding in barcode
- Modulo-10 checksum validation
- Standard EAN-13 format compatibility
Product Types
- Type 20: Meat & Poultry
- Type 21: Fruits & Vegetables
- Type 22: Dairy Products
- Type 23: Bakery Items
Price Calculation
- Automatic price per weight unit
- Tare weight deduction support
- Real-time price updates
- Multiple unit support (kg, g, lbs)
Scale Integration
- Label-printing scales support
- External printer integration
- Android/Tablet solutions
- PC-based POS integration
System Setup
Step 1: Database Migration
# Run the migration script
python add_weight_based_products.py
# This adds 8 new fields to products table:
- is_weight_based (boolean)
- weight_barcode_type (integer 20-23)
- weight_price_per_unit (decimal)
- weight_unit (varchar: kg, g, lbs)
- weight_tare (decimal)
- weight_barcode_prefix (varchar)
- weight_min_weight (decimal)
- weight_max_weight (decimal)
Step 2: Create Weight-Based Products
- Go to Products Management
- Click "Add New Product"
- Check "Weight-Based Product" checkbox
- Select Barcode Type (20-23)
- Enter Price Per Unit (e.g., P50/kg)
- Select Weight Unit (kg, g, lbs)
- Set Tare Weight if needed (e.g., 10g for packaging)
- Save the product
Step 3: Configure Scale
Scale Configuration Steps
- Program product database into scale
- Set barcode format to EAN-13
- Configure price per unit
- Set tare weight if applicable
- Test barcode generation
Refer to SCALE_CONFIGURATION_TEMPLATES.md for detailed instructions per scale model
Supported Scale Types
- Bizerba GLMI-800: Web interface configuration
- CAS CL-5000 Series: Keypad programming
- Toledo 8530: Touchscreen interface
- Avery Berkel HL122: Keypad config
- Digi SM-300: Network software
- Scale + Printer: Any scale with external printer
- Android/Tablet: Mobile barcode generation apps
- PC-POS: Computer-based POS integration
Point of Sale Usage
Scanning Weight-Based Products
- Weigh the product: Place item on scale
- Generate label: Scale prints barcode label with weight
- Scan at POS: Scan the barcode at checkout
- Auto-calculation: System decodes weight and calculates price
- Complete sale: Price displayed automatically
Example Transaction
Product: Beef Steak (Type 20)
Price: P250/kg
Barcode Scanned: 2012345015007
System Decodes:
+-- Type: 20 (Meat)
+-- Product ID: 12345
+-- Weight: 01500g (1.5kg)
+-- Check: 7 ?
Calculation:
Weight: 1.5kg
Price/kg: P250
Tare: 0kg
Total: P375.00
API Endpoints
| Method |
Endpoint |
Description |
| POST |
/api/v1/weight-products/parse-barcode |
Decode barcode and return product with price |
| POST |
/api/v1/weight-products/generate-barcode |
Generate barcode for product and weight |
| GET |
/api/v1/weight-products/ |
List all weight-based products |
Best Practices
- Use consistent barcode types per category
- Set realistic min/max weights
- Include tare weight for packaging
- Test barcodes before going live
- Train on proper weighing technique
- Explain barcode validation
- Practice with test products
- Keep quick reference cards handy
- Calibrate scales regularly
- Update product prices as needed
- Check label printer supplies
- Verify barcode readability