- 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
6.0 KiB
6.0 KiB
Boxes Management - Quick Start Guide
Accessing the Boxes Page
- From Warehouse Menu: Warehouse → Manage Boxes/Crates
- Direct URL:
/warehouse/boxes - Link from index: Click "Go to Boxes" button on warehouse dashboard
Creating a New Box
Method 1: Auto-Generated Number (Recommended)
- Leave "Box Number" field empty
- Enter description (optional)
- Click "Create Box"
- System generates BOX-XXXXXX format
Method 2: Custom Box Number
- Enter custom box number in "Box Number" field
- Enter description (optional)
- Click "Create Box"
- Validates uniqueness automatically
Managing Boxes
Viewing Boxes
- All boxes displayed in center table
- Click edit button (pencil icon) to modify
- Status badge shows open (green) or closed (red)
- Location shows assigned warehouse location (if any)
Editing a Box
- Click edit button in table row
- Right panel loads box details
- Cannot change box number (read-only)
- Can change:
- Status (open/closed)
- Location (assign to warehouse location)
- Description (notes/comments)
- Click "Save Changes" to update
- Click "Delete Box" to remove
- Click "Cancel" to close
Changing Status
- Select box by clicking edit button
- Choose status from dropdown (Open or Closed)
- Click "Save Changes"
- Status updates immediately
Assigning Location
- Select box by clicking edit button
- Choose location from "Location" dropdown
- Shows all available warehouse locations
- Select "No Location" to clear
- Click "Save Changes"
Deleting Boxes
Delete Single Box
- Click edit button on box
- Click "Delete Box" button
- Confirm in modal dialog
- Box removed permanently
Delete Multiple Boxes
- Check boxes in left column of table
- "Delete Selected" button shows count
- Click "Delete Selected"
- Confirm in modal dialog
- Selected boxes removed
Select All Feature
- Click checkbox in table header to select/uncheck all
- Useful for quick operations
Printing Box Labels
Setup (First Time)
- Make sure QZ Tray is installed (optional)
- Boxes page shows QZ Tray status:
- ✅ Connected: Uses thermal printer
- ❌ Not Available: Will use browser print
Printing Process
- Click edit button on desired box
- Bottom right panel shows "Print Label"
- Box number displays in field
- Click "Generate Preview" to see barcode
- Barcode appears in preview section
- Select printer from dropdown (if available)
- Click "Print Label" to send to printer
Printer Selection
- "Default Printer": Uses system default or first thermal printer
- Named printers: Shows all available printers if QZ Tray connected
- No selection needed for browser print
Testing Printer Connection
- Go to any box and scroll to Print Label section
- Click "Test QZ Tray" button
- Shows connection status and available printers
- If not connected, browser print will be used automatically
Statistics Display
Left panel shows real-time counts:
- Total Boxes: All boxes in system
- Open: Boxes with "open" status
- Closed: Boxes with "closed" status
Updates automatically after add/edit operations.
Flash Messages
Success Messages (green):
- Box created successfully
- Box updated successfully
- Box deleted successfully
Error Messages (red):
- Duplicate box number
- Box not found
- Database error
Keyboard Shortcuts
| Action | Shortcut |
|---|---|
| Select all | Check header checkbox |
| Cancel edit | Esc key (or Cancel button) |
| Generate preview | Enter in print section |
Tips & Tricks
Faster Operations
- Use auto-generated box numbers to save time
- Assign locations during creation if possible
- Use "Select All" for bulk operations
Better Organization
- Use description field for box contents
- Assign locations to track warehouse placement
- Use status to track workflow (open=in use, closed=archived)
Printing
- If printer not found, check QZ Tray installation
- Browser print works without QZ Tray
- Test printer button helps diagnose issues
- Barcode is CODE128 format (standard)
Common Issues & Solutions
Issue: "Box number already exists"
- Solution: Enter unique box number or leave blank for auto-generation
Issue: Printer dropdown is empty
- Solution: QZ Tray not installed or connected. Browser print will be used.
Issue: Can't select/delete boxes
- Solution: Check table checkboxes, then click "Delete Selected"
Issue: Print not working
- Troubleshoot:
- Click "Test QZ Tray" button
- If not connected, browser print will open
- Check printer is powered on
- Try browser print as backup
Issue: Description not saving
- Solution: Click "Save Changes" button after editing
Data Structure Reference
Box Fields
| Field | Type | Notes |
|---|---|---|
| Box Number | Text | Unique identifier (auto-generated if blank) |
| Status | Dropdown | open or closed |
| Location | Dropdown | Warehouse location (optional) |
| Description | Text | Notes/comments about box |
| Created | Timestamp | Auto-filled (read-only) |
| Updated | Timestamp | Auto-updated on changes |
Barcode Format
- Type: CODE128
- Content: Box number
- Scannable with standard barcode scanners
- Used for inventory tracking
Performance Notes
- Page loads with all boxes displayed
- For 1000+ boxes, consider pagination (feature request)
- Barcode generation is fast (client-side)
- Printer operations are non-blocking (async)
Security
- Session authentication required
- Only authenticated users can access
- All data changes logged with timestamps
- Database uses parameterized queries
Helpful Related Pages
- Warehouse Locations - Create/manage storage locations
- Set Boxes Locations - Assign articles to boxes
- Warehouse Index - Overview and navigation
Getting Help
- Check the Statistics card for overview
- Use Test QZ Tray for printer issues
- Review Flash Messages for operation status
- Check browser console (F12) for error details
Last Updated: 2025-01-25
Version: 1.0
Status: Production Ready