Skip to content

Latest commit

 

History

History
181 lines (145 loc) · 5.59 KB

File metadata and controls

181 lines (145 loc) · 5.59 KB

Sage X3 Barcode Label Designer - Setup Guide

🎉 Your Solution is Ready!

The web application is now running at: http://localhost:5000

📋 Default Login Credentials:

  • Admin: admin / admin123 (Full access + User Management)
  • User: user1 / user123 (Standard access)
  • Demo: demo / demo123 (Standard access)

Current Features Working:

🎨 Sage X3-Style Interface

  • ✅ Professional green theme matching Sage X3
  • ✅ Modern, responsive design
  • ✅ Clean login interface

👥 User Management

  • ✅ Role-based access control (Admin, User, Viewer)
  • ✅ User creation, editing, and deletion
  • ✅ Access /admin/users as admin to manage users

🏷️ Label Designer

  • ✅ Multiple field support (Product Code, Name, Price, Batch, Expiry, Custom fields)
  • ✅ Customizable layout (Font size, Barcode height, Text visibility)
  • ✅ Real-time preview at actual size (3.5cm × 2.5cm)
  • ✅ Product search functionality
  • ✅ Template save/load system

🖨️ Printing Options

  • PDF Generation: Direct PDF download for regular printers
  • ZPL Output: Optimized code for Zebra ZD220 thermal printer
  • ✅ Copy-to-clipboard functionality
  • ✅ Print preview with instructions

📊 Sample Data

  • ✅ 5 sample products for testing
  • ✅ Search functionality works with sample data
  • ✅ All features functional without database connection

🔧 Next Steps: MSSQL Integration

To connect to your actual ERP database, follow these steps:

1. Install MSSQL Driver

# Install Microsoft ODBC Driver 17 for SQL Server
# Download from: https://docs.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server

# Install pyodbc
pip install pyodbc

2. Update Database Configuration

Edit config.json:

{
  "mssql_server": "your-server-name",
  "mssql_database": "your-erp-database",
  "mssql_username": "your-username",
  "mssql_table": "your-product-table",
  "label_width_cm": 3.5,
  "label_height_cm": 2.5
}

3. Enable MSSQL in Code

In app_simple.py, uncomment the MSSQL connection code and replace the sample data functions.

4. Database Table Structure

Your MSSQL table should have these columns (adjust field names as needed):

CREATE TABLE ProductLabels (
    ProductCode NVARCHAR(50) PRIMARY KEY,
    ProductName NVARCHAR(255),
    Price NVARCHAR(50),
    BatchNumber NVARCHAR(100),
    ExpiryDate DATE,
    Category NVARCHAR(100),
    -- Add other fields as needed
);

🖨️ Thermal Printer Setup (Zebra ZD220)

Method 1: Direct ZPL Printing

  1. Use the generated ZPL code from the application
  2. Send directly to printer via:
    • USB connection
    • Network (telnet to printer IP:9100)
    • Zebra Setup Utilities

Method 2: Network Printing

# Example: Send ZPL via telnet
telnet [printer-ip] 9100
# Paste the ZPL code and press Enter

Method 3: USB Printing (Windows)

# Copy ZPL to file and send to printer
copy zpl_code.txt \\.\USB001

🔐 Security Considerations

For Production Use:

  1. Change Default Passwords: Update all default user passwords
  2. Use HTTPS: Configure SSL/TLS certificates
  3. Database Security: Use encrypted connections to MSSQL
  4. Session Security: Configure secure session settings
  5. Access Control: Implement proper network access controls

📁 File Structure

Barcode-Project/
├── app_simple.py          # Main Flask application
├── templates/             # HTML templates
│   ├── login.html         # Sage X3-style login
│   ├── index.html         # Main application
│   └── admin_users.html   # User management
├── static/
│   └── app.js            # Frontend JavaScript
├── config.json           # Configuration file
├── requirements_basic.txt # Python dependencies
└── SETUP_GUIDE.md        # This guide

🚀 Testing Your Setup

  1. Login: Use any of the default credentials
  2. Search Products: Try searching for "PRD001" or "Sample"
  3. Generate Labels: Fill in product details and click "Generate Preview"
  4. Print PDF: Click "Print PDF" to download a label
  5. Print ZPL: Click "Print ZPL" to get thermal printer code
  6. User Management: Login as admin and visit /admin/users

🔧 Troubleshooting

Common Issues:

  1. Port 5000 in use: Change port in app_simple.py
  2. PDF generation fails: Check ReportLab installation
  3. Barcode not showing: Verify product code format
  4. MSSQL connection fails: Check driver installation and credentials

Support:

  • Check browser console for JavaScript errors
  • Check Flask console for server errors
  • Verify all dependencies are installed

📈 Customization Options

Adding New Fields:

  1. Update the HTML form in templates/index.html
  2. Modify the PDF generation in generate_pdf() function
  3. Update ZPL generation in frontend JavaScript

Changing Label Size:

  1. Update LABEL_WIDTH_CM and LABEL_HEIGHT_CM in config
  2. Adjust CSS dimensions in templates
  3. Modify ZPL dimensions in JavaScript

Custom Themes:

  1. Modify CSS in templates for different color schemes
  2. Update logo and branding elements
  3. Customize fonts and layouts

🎯 Your Solution Delivers:

Professional Sage X3-style interface
Complete user management system
Flexible label designer with live preview
PDF and thermal printer support
Ready for MSSQL integration
Production-ready architecture

The application is now ready for use and can be easily integrated with your existing ERP system!