feat: Migrate label printing module from legacy app

- Created labels module with complete structure in app/modules/labels/
- Implemented print_module.py with database functions:
  * get_unprinted_orders_data() - Retrieve unprinted orders from database
  * get_printed_orders_data() - Retrieve printed orders from database
  * update_order_printed_status() - Mark orders as printed
  * search_orders_by_cp_code() - Search orders by production code
- Created routes.py with Flask Blueprint and API endpoints:
  * GET /labels/ - Module home page with feature launchers
  * GET /labels/print-module - Main label printing interface
  * GET /labels/print-lost-labels - Lost label reprinting interface
  * GET /labels/api/unprinted-orders - API for unprinted orders
  * GET /labels/api/printed-orders - API for printed orders
  * POST /labels/api/search-orders - Search orders API
  * POST /labels/api/update-printed-status/<id> - Update status API
- Migrated HTML templates from legacy app with theme support:
  * print_module.html - Thermal label printing with QZ Tray integration
  * print_lost_labels.html - Lost label search and reprint interface
  * Added comprehensive CSS variables for dark/light mode theming
  * Preserved all original JavaScript functionality for printing
- Created index.html module home page with feature launchers
- Registered labels blueprint in app/__init__.py with /labels prefix
- Added 'Label Printing' module card to dashboard with print icon

All functionality preserved from original implementation:
- QZ Tray thermal printer integration
- JsBarcode barcode generation (horizontal + vertical)
- PDF export fallback
- Session-based authentication for all routes
- Database integration with proper error handling
This commit is contained in:
Quality App Developer
2026-02-02 01:18:54 +02:00
parent f54e1bebc3
commit 2f6bb5d029
8 changed files with 3095 additions and 1 deletions

View File

@@ -143,14 +143,16 @@ def register_blueprints(app):
from app.modules.settings.routes import settings_bp
from app.modules.warehouse.routes import warehouse_bp
from app.modules.warehouse.boxes_routes import boxes_bp
from app.modules.labels.routes import labels_bp
app.register_blueprint(main_bp)
app.register_blueprint(quality_bp, url_prefix='/quality')
app.register_blueprint(settings_bp, url_prefix='/settings')
app.register_blueprint(warehouse_bp, url_prefix='/warehouse')
app.register_blueprint(boxes_bp)
app.register_blueprint(labels_bp, url_prefix='/labels')
app.logger.info("Blueprints registered: main, quality, settings, warehouse, boxes")
app.logger.info("Blueprints registered: main, quality, settings, warehouse, boxes, labels")
def register_error_handlers(app):