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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user