Production Tools — inventory and box-label plan¶
Status: implemented in Production Tools (assistant commit 259a2d0)
Owner: Production / Engineering
Date: 2026-09-20
Goal¶
Keep the current Production Tools page and make its two printing purposes explicit:
- Reprint the normal inventory label with the ERP quantity.
- Print simple box labels with a chosen quantity on each label.
Box labels are only physical labels. The tool does not track boxes, split stock, number boxes, change ERP inventory, or generate a PDF.
Printer status¶
Keep the existing printer check at the top of the page:
- Printer ready — printing actions are enabled.
- Printer not responding — power-cycle it — printing actions are disabled.
The server continues to require a real Zebra status response before showing the printer as ready. Printing sends directly to the Zebra.
Stock-item result¶
Every stock-item search result shows the part number, description, current ERP quantity, location, and these two actions.
Reprint inventory label¶
- Field: Number of identical labels.
- Explanation: “Each label will show the ERP inventory quantity: 127 pcs.”
- Button example: Print 2 inventory labels.
- Uses the existing inventory-label layout and ERP quantity.
- Does not change ERP inventory.
Print box labels¶
- Field: Quantity on each label.
- Field: Number of labels.
- Live summary example: “Print 10 labels. Each label will say BOX QTY 10 pcs.”
- Button example: Print 10 box labels — 10 pcs each.
- Every printed label contains:
- Large text: BOX QTY 10 pcs.
- Part number and short description.
- Lot and location when available.
- The existing stock-item QR code.
- No “Box 1 of 10” numbering.
- No box records or stock splits.
- No ERP quantity change.
- No PDF creation or fallback.
Clarity rules¶
- Never show an unlabeled number control.
- Never use the word quantity alone. Use ERP inventory quantity, Quantity on each label, or Number of labels.
- Keep Change inventory count separate from both printing actions with this warning: “This changes the ERP inventory total. It does not change label text only.”
- Show the final action in the button text before the operator presses it.
- After success, report exactly what was sent: “Sent 10 box labels — 10 pcs each.”
Validation and duplicate protection¶
- Quantity on each label must be greater than zero.
- Number of labels must be a whole number from 1 through 100.
- Parts counted in pieces require a whole-number quantity. Units such as grams or millilitres may use decimals.
- Disable the button after the first press while printing is in progress.
- Give each press an idempotency key so a double tap cannot submit the same print job twice.
- If the printer stops responding, report that the job was not delivered and enable printing only after the printer-ready check passes again.
- Do not create or offer a PDF when direct printing fails.
Delivery plan¶
Phase 1 — remove the current ambiguity¶
- Label the existing control Number of identical labels.
- Rename the existing Print action Reprint inventory label.
- Add the explanation showing the ERP quantity that will appear on every label.
- Move Count under Change inventory count and add its warning.
Phase 2 — add box labels¶
- Add Quantity on each label and Number of labels fields.
- Add the live summary and descriptive print button.
- Add the direct-to-Zebra box-label layout.
- Add double-tap protection without adding visible workflow or history screens.
Verification¶
- Check the page at phone and desktop widths.
- Confirm that inventory-label copies always show the ERP quantity.
- Confirm that 10 box labels at 10 pcs produce ten identical BOX QTY 10 pcs labels.
- Confirm that ERP quantity is unchanged before and after box-label printing.
- Check one label, ten labels, maximum labels, invalid values, a double tap, and a disconnected printer.
- Confirm that failure creates no PDF and no ERP record.
Acceptance example¶
Given stock item #123 has an ERP inventory quantity of 127 pcs, the operator chooses Print box labels, enters 10 for Quantity on each label and 10 for Number of labels, and sees:
Print 10 labels. Each label will say BOX QTY 10 pcs. ERP inventory remains 127 pcs.
One press sends ten identical labels directly to the Zebra. Each says BOX QTY 10 pcs. The ERP still reads 127 pcs. No boxes, stock items, numbering, or PDFs are created.
Implementation result¶
Deployed 2026-09-20 after sandbox review at phone width. The box-label endpoint reads the
selected stock item, builds direct ZPL, and sends one Zebra format using ^PQ for 1–100
identical labels. It does not call an ERP write endpoint. Double taps reuse an idempotency key,
inventory-count controls carry the planned warning, and direct-print failure offers no PDF.