Commit Graph

17 Commits

Author SHA1 Message Date
Quality App Developer
4784d1395c fix: Add inline styles to barcode frames for correct positioning
- Added inline styles to #barcode-frame div:
  * position: absolute; bottom: 10px; left: 11.34px
  * width: 227.4px; z-index: 5; text-align: center
- Added inline styles to #barcode-display SVG:
  * display: block; margin: 0 auto; height: 50px
- Added inline styles to #vertical-barcode-frame div:
  * position: absolute; right: 0; top: 65.7px
  * width: 32px; height: 321.3px; z-index: 5
  * display: flex; align-items: center; justify-content: center
- Added inline styles to #vertical-barcode-display SVG:
  * width: 100%; height: auto; transform: rotate(-90deg)
- Inline styles take precedence over CSS rules
- Ensures barcodes are positioned at bottom and right of label
2026-02-02 02:19:21 +02:00
Quality App Developer
834bcc808a fix: Improve barcode positioning in label preview
- Repositioned #barcode-frame to bottom (10px from bottom, left: 11.34px)
- Set barcode-frame width to 227.4px (label content width)
- Added SVG height styling for horizontal barcode (50px)
- Repositioned #vertical-barcode-frame to right side (right: 0)
- Set vertical barcode frame dimensions (32px width, 321.3px height)
- Added SVG rotation for vertical barcode (-90 degrees)
- Improved flexbox centering for vertical barcode
2026-02-02 02:13:48 +02:00
Quality App Developer
6dc5885b74 fix: Add barcode positioning CSS for label preview
- Added CSS for #barcode-frame: positioned at bottom center, width 227.4px
- Added CSS for #vertical-barcode-frame: positioned on right side, vertical orientation
- Barcode frames use absolute positioning within the label preview
- Horizontal barcode at bottom of label
- Vertical barcode on right side with 90-degree rotation
2026-02-02 01:51:15 +02:00
Quality App Developer
b2ac1fad5b fix: Restructure print_module layout - label preview on left side
- Changed main container to flexbox layout with gap
- Left column: Fixed width (400px) for label preview card
- Right column: Flexible width for data preview table
- Label preview now positioned on left as in original app
- Data table fills remaining space on the right
- Responsive flexbox layout preserves functionality
2026-02-02 01:42:41 +02:00
Quality App Developer
7d7f3ce4fe fix: Comment out missing help page references in label printing templates
- Commented out floating help button HTML in print_module.html and print_lost_labels.html
- Commented out floating help button CSS in both templates
- Help page functionality not implemented yet, will be added in future updates
- Allows templates to render without 500 errors
2026-02-02 01:36:26 +02:00
Quality App Developer
aa9882c3b1 feat: Add order_for_labels table to database initialization
- Added order_for_labels table to initialize_db.py with columns:
  * comanda_productie: Production order code (indexed)
  * cod_articol: Article code
  * descr_com_prod: Production order description
  * cantitate: Quantity
  * com_achiz_client: Client purchase order
  * nr_linie_com_client: Client order line number
  * customer_name: Customer name
  * customer_article_number: Customer's article reference
  * open_for_order: Open for order flag
  * line_number: Line number reference
  * printed_labels: Print status (indexed, default 0)
  * data_livrara: Delivery date
  * dimensiune: Dimensions
  * Indexes on: comanda_productie, printed_labels, created_at
- Added order_for_labels schema verification to db_schema_verifier.py
- Table supports labels printing module with proper indexing for queries
- Timestamps: created_at, updated_at for audit trail
2026-02-02 01:24:38 +02:00
Quality App Developer
2f6bb5d029 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
2026-02-02 01:18:54 +02:00
Quality App Developer
f54e1bebc3 feat: Add Set Orders on Boxes feature with debouncing and page refresh
- Created warehouse_orders.py module with 8 order management functions
- Added /warehouse/set-orders-on-boxes route and 7 API endpoints
- Implemented 4-tab interface: assign, find, move, and view orders
- Changed assign input from dropdown to text field with BOX validation
- Fixed location join issue in warehouse.py (use boxes_crates.location_id)
- Added debouncing flag to prevent multiple rapid form submissions
- Added page refresh after successful order assignment
- Disabled assign button during processing
- Added page refresh with 2 second delay for UX feedback
- Added CP code validation in inventory page
- Improved modal styling with theme support
- Fixed set_boxes_locations page to refresh box info after assignments
2026-02-02 01:06:03 +02:00
Quality App Developer
39a3a0084c Fix PyMySQL DictCursor usage in warehouse functions
Fixed incorrect pymysql.cursors.DictCursor instantiation in 4 functions:
- get_cp_inventory_list()
- search_cp_code()
- search_by_box_number()
- get_cp_details()

PyMySQL connection pool doesn't support cursor_factory parameter.
Now manually converting tuples to dicts using cursor.description instead.
2026-01-30 15:20:49 +02:00
Quality App Developer
07f77603eb Implement approved/rejected quantity triggers and warehouse inventory
Database Triggers Implementation:
- Added automatic quantity calculation triggers for scanfg_orders
- Added automatic quantity calculation triggers for scan1_orders (T1 phase)
- Triggers calculate based on CP_base_code grouping (8 digits)
- Quality code: 0 = approved, != 0 = rejected
- Quantities set at insertion time (BEFORE INSERT trigger)
- Added create_triggers() function to initialize_db.py

Warehouse Inventory Enhancement:
- Analyzed old app database quantity calculation logic
- Created comprehensive trigger implementation guide
- Added trigger verification and testing procedures
- Documented data migration strategy

Documentation Added:
- APPROVED_REJECTED_QUANTITIES_ANALYSIS.md - Old app logic analysis
- DATABASE_TRIGGERS_IMPLEMENTATION.md - v2 implementation guide
- WAREHOUSE_INVENTORY_IMPLEMENTATION.md - Inventory view feature

Files Modified:
- initialize_db.py: Added create_triggers() function and call in main()
- Documentation: 3 comprehensive guides for database and inventory management

Quality Metrics:
- Triggers maintain legacy compatibility
- Automatic calculation ensures data consistency
- Performance optimized at database level
- Comprehensive testing documented
2026-01-30 12:30:56 +02:00
Quality App Developer
b15cc93b9d FG Scan form validation improvements with warehouse module updates
- Fixed 3 JavaScript syntax errors in fg_scan.html (lines 951, 840-950, 1175-1215)
- Restored form field validation with proper null safety checks
- Re-enabled auto-advance between form fields
- Re-enabled CP code auto-complete with hyphen detection
- Updated validation error messages with clear format specifications and examples
- Added autocomplete='off' to all input fields
- Removed auto-prefix correction feature
- Updated warehouse routes and modules for box assignment workflow
- Added/improved database initialization scripts
- Updated requirements.txt dependencies

Format specifications implemented:
- Operator Code: OP + 2 digits (example: OP01, OP99)
- CP Code: CP + 8 digits + hyphen + 4 digits (example: CP00000000-0001)
- OC1/OC2 Codes: OC + 2 digits (example: OC01, OC99)
- Defect Code: 3 digits only
2026-01-30 10:50:06 +02:00
Quality App Developer
ac24e20fe1 fix: Remove extra '>' character from theme CSS link tag in base.html
This was causing a literal '>' character to appear at the top of all pages.
2026-01-28 01:04:11 +02:00
Quality App Developer
8de85ca87f feat: Implement warehouse module roles with auto-schema repair and remove module access section
- Add SchemaVerifier class for automatic database schema verification and repair
- Implement warehouse_manager (Level 75) and warehouse_worker (Level 35) roles
- Add zone-based access control for warehouse workers
- Implement worker-manager binding system with zone filtering
- Add comprehensive database auto-repair on Docker initialization
- Remove Module Access section from user form (role-based access only)
- Add autocomplete attributes to password fields for better UX
- Include detailed documentation for warehouse implementation
- Update initialize_db.py with schema verification as Step 0
2026-01-28 00:46:59 +02:00
Quality App Developer
e6ff40184a UX: Improve FG scan success notification styling
- Changed notification to small popup on right side of screen
- Added smooth slide-in/slide-out animations
- Positioned at top-right (30px from edges)
- Higher z-index (9999) to appear above all content
- Improved shadow and padding for better visibility
- Only affects FG scan page
2026-01-27 18:01:52 +02:00
Quality App Developer
59e82c0209 Fix: Resolve 'Column date cannot be null' error in FG scan
- Added default date/time handling in save_fg_scan() function
- Backend now uses current date/time if values not provided
- Added hidden date/time form fields in frontend
- Updated JavaScript to populate hidden fields before submission
- Prevents null database errors when scanning orders
2026-01-27 17:52:57 +02:00
Quality App Developer
e1f3302c6b Implement boxes management module with auto-numbered box creation
- Add boxes_crates database table with BIGINT IDs and 8-digit auto-numbered box_numbers
- Implement boxes CRUD operations (add, edit, update, delete, delete_multiple)
- Create boxes route handlers with POST actions for all operations
- Add boxes.html template with 3-panel layout matching warehouse locations module
- Implement barcode generation and printing with JsBarcode and QZ Tray integration
- Add browser print fallback for when QZ Tray is not available
- Simplify create box form to single button with auto-generation
- Fix JavaScript null reference errors with proper element validation
- Convert tuple data to dictionaries for Jinja2 template compatibility
- Register boxes blueprint in Flask app initialization
2026-01-26 22:08:31 +02:00
Quality App Developer
3c5a273a89 Initial commit: Quality App v2 - FG Scan Module with Reports 2026-01-25 22:25:18 +02:00