- Added ?v=3 to script.js and ?v=2 to storage-utils.js
- Forces browsers to reload the fixed JavaScript files
- Resolves cached script.js with duplicate safeStorage declaration
- safeStorage is already defined in storage-utils.js which loads first
- Duplicate declaration was causing 'Identifier already declared' error
- This error prevented script.js from loading and broke theme toggle
- Added detailed console logs to track theme toggle initialization
- Logs will help identify why button doesn't work on non-fg_scan pages
- Temporary debug code to be removed after fix
- Fixed syntax error that prevented script.js from loading
- This was breaking the theme toggle button and all JavaScript functionality
- Removed extra }); on line 219
- Add guard clauses for reportTable, reportButtons, exportCsvButton, exportPdfButton
- Prevents JavaScript errors when report elements don't exist on page
- Ensures theme toggle and other functionality work on all pages
- Wraps report-specific code in null checks to avoid breaking other features
- Added isAutoSubmitting flag to prevent duplicate validation during auto-submit
- Clear all custom validity states before form submission
- Skip duplicate validation in submit handler when auto-submitting
- Added theme toggle functionality directly to fg_scan page (since script.js is excluded)
- Enhanced logging for debugging form submission flow
This fixes the issue where the form would hang and not send data to the database when defect code was auto-submitted.
- Added missing /api/maintenance/truncate-table endpoint to fix 404 error
- Fixed dark mode visibility issue for usernames in Current Users table
- Added explicit color styling for username strong tags in both light and dark modes
- Created storage-utils.js with safeStorage wrapper to prevent tracking prevention errors
- Updated script.js to use safeStorage for theme persistence
- Added conditional QZ Tray connection based on 'Enable Scan to Boxes' toggle
- Fixed 404 error by removing non-existent /api/backup/path endpoint call
- Enhanced fg_scan.html to disable QZ Tray and socket connections when toggle is off
- Prevents console errors when browser tracking prevention blocks localStorage access
Changes:
1. Fixed create_user_handler to properly initialize modules JSON for new users
2. Fixed edit_user_handler to manage module assignments instead of non-existent email field
3. Updated settings_handler to select modules column instead of email from users table
4. Added validate_and_repair_user_modules function in setup_complete_database.py to ensure all users have correct module assignments
5. Added create_app_license function to create development license file during database setup
6. Added ensure_app_license function to docker-entrypoint.sh for license creation on container startup
7. Added user modules validation on Flask app startup to repair any malformed modules
8. License file is automatically created with 1-year validity on deployment
This ensures:
- New users created via UI get proper module assignments
- Existing users are validated/repaired on app startup
- Non-superadmin users can login after license check passes
- All deployments have a valid development license by default
- Improved backup path handling for Docker environments
- Changed default backup type to data-only for scheduled backups
- Updated settings.html with enhanced backup management UI
- Replaced 'Drop Table' with 'Truncate Table' functionality
- Clear data while preserving structure and triggers
- Changed from danger zone styling (red) to caution styling (orange)
- Added clear confirmation dialog with table name verification
- Added upload backup file functionality
- Improved backup schedule management with edit/toggle/delete
- Updated styling and dark mode support
- Removed old backup metadata files
- Add fg_scan.md to documentation routes mapping
- Add FG Scan link to help viewer navigation menu
- Add floating help button to fg_scan.html page
- Documentation now accessible from both:
* Floating help button (📖) on fg_scan page
* Help navigation menu in documentation viewer
- Renamed Store Articles card to Set Boxes Locations on warehouse main page
- Created new mobile-optimized page with two tabs for box location management:
- Tab 1: Assign box to location (scan box, change status to closed, assign location)
- Tab 2: Move box from location (scan location, list boxes, move to new location)
- Added box status management (open/closed) with status change button
- Enforced rule: only closed boxes can be assigned to locations
- Moved API logic to warehouse.py module:
- search_box_by_number()
- assign_box_to_location()
- search_location_with_boxes()
- move_box_to_new_location()
- change_box_status()
- Added API routes in routes.py as thin wrappers
- Aligned page theme colors with application Bootstrap theme
- Added dark mode support for the new page
- Added Warehouse Main button to page header
- Removed 'INNOFA ROMANIA SRL' branding from:
- Print module label preview and PDF generation
- Print lost labels page
- pdf_generator.py PDF creation function
- Replace ZPL/image-based printing with ReportLab PDF generation
- Box labels: 8cm x 5cm landscape with 'BOX Nr:' header and CODE128 barcode
- Location labels: 8cm x 5cm landscape with 'Location nr:' header and CODE128 barcode
- Add /generate_box_label_pdf endpoint using same approach as print_module
- Update FG scan quick box creation to use PDF printing with default printer
- Switch from CDN QZ Tray to local patched version for pairing-key auth
- Improve error handling and logging throughout printing workflow
- Fix import issues (add mm unit to warehouse.py)
- Optimize barcode size and spacing for better readability
- Implement role normalization system to handle role name variants (superadmin, super_admin, administrator)
- Add session persistence configuration (PERMANENT_SESSION_LIFETIME = 7 days)
- Add modules JSON column to users database table schema
- Update setup script with backward compatibility check for modules column
- Fix user_management_simple route to properly fetch and display modules
- Resolve modal aria-hidden accessibility warning by managing focus on close button
- All changes deployed and tested successfully
- Created boxes_crates table with 8-digit auto-generated box numbers
- Added manage_boxes route and full CRUD operations
- Implemented box status tracking (open/closed)
- Added location assignment functionality
- Integrated QZ Tray printing with barcode labels
- Created manage_boxes.html with table, preview, and print features
- Added 'Manage Boxes/Crates' card to warehouse main page
- Boxes can be created without location and assigned later
- Includes delete functionality for admin/management roles
- Added box statistics display
- Enhanced maintenance card with dark mode support
- Added system storage information display (logs, database, backups)
- Implemented per-table backup and restore functionality
- Added database table management with drop capability
- Restructured backup management UI with split layout:
- Quick action buttons for full/data-only backups
- Collapsible per-table backup/restore section
- Split schedule creation (1/3) and active schedules list (2/3)
- Fixed database config loading to use mariadb module
- Fixed SQL syntax for reserved 'rows' keyword
- Removed System Information card
- All database operations use correct config keys from external_server.conf
- Added daily_mirror module to permissions system
- Fixed user module management - updates now work correctly
- Implemented dashboard module filtering based on user permissions
- Fixed warehouse create_locations page (config parser and delete)
- Implemented POST-Redirect-GET pattern to prevent duplicate entries
- Added application license system with validation middleware
- Cleaned up debug logging code
- Improved user module selection with fetch API instead of form submit
- Added compact table styling to print_lost_labels page (smaller fonts, reduced padding)
- Fixed production data import missing fields (production_order_line, line_number)
- Added better error handling and logging for Excel file imports
- Skip empty rows in production data import
- Log all columns and columns with data for debugging
- Created comprehensive dashboard with Chart.js visualizations
- Added API endpoint /api/dashboard_data for aggregated data
- Implemented weekly tracking for orders, production, and deliveries
- Added interactive pivot table for customer × week analysis
- Fixed collation issues in database joins
- Includes 4 summary cards with key metrics
- Charts display orders, production finished, and deliveries by week
- Click-to-expand data tables for detailed view
- Time range filter (4-52 weeks)
- Data sources: scanfg_orders (finished), dm_orders, dm_deliveries
- Auto-detect mysqldump vs mariadb-dump command
- Conditional SSL flag based on Docker environment detection
- Works in both Docker containers and standard systemd deployments
- No breaking changes to existing functionality