feat: printer duplicate copies setting (Feature 1)

- Add `duplicates` column (0-9) to printers table via migration
- Print loop repeats job 1+duplicates times per printer zone
- PrinterForm in Settings > Print now has ΑΝΤΙΓΡΑΦΑ (0-9) field
- PrinterRow shows amber badge when duplicates > 0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 10:55:43 +03:00
parent 72b12ddd9c
commit f3d03bf85f
5 changed files with 21 additions and 4 deletions

View File

@@ -1256,10 +1256,12 @@ def _do_route_and_print(order_id: int, item_ids: List[int], db: Session) -> List
success = False
error_msg = None
copies = 1 + max(0, printer.duplicates or 0)
try:
p = _get_printer(printer.ip_address, printer.port)
_print_kitchen_ticket(p, order, zone_items, db, printer.line_width)
p.close()
for _ in range(copies):
p = _get_printer(printer.ip_address, printer.port)
_print_kitchen_ticket(p, order, zone_items, db, printer.line_width)
p.close()
success = True
for item in zone_items:
item.printed = True