|
@@ -231,13 +231,17 @@ async def printer_order(order: OrderWeb, current_user: User = Depends(get_curren
|
|
|
|
|
|
|
|
# Print order
|
|
# Print order
|
|
|
try:
|
|
try:
|
|
|
- kitchen_items = [ Item(name=item.name, price=product.price, quantity=item.quantity) for product, item in zip(items, products) if CAT_ITEMS.get(item.type, Locations.BAR) == Locations.KITCHEN]#type: ignore
|
|
|
|
|
- bar_items = [ Item(name=item.name, price=product.price, quantity=item.quantity) for product, item in zip(items, products) if CAT_ITEMS.get(item.type, Locations.BAR) == Locations.BAR]#type: ignore
|
|
|
|
|
- coctelery_items = [ Item(name=item.name, price=product.price, quantity=item.quantity) for product, item in zip(items, products) if CAT_ITEMS.get(item.type, Locations.COCTELERY) == Locations.COCTELERY]#type: ignore
|
|
|
|
|
|
|
+ pizza_items = [ Item(name=item.name, price=product.price, quantity=item.quantity) for product, item in zip(items, products) if CAT_ITEMS.get(item.type) == Locations.PIZZAS]#type: ignore
|
|
|
|
|
+ burger_items = [ Item(name=item.name, price=product.price, quantity=item.quantity) for product, item in zip(items, products) if CAT_ITEMS.get(item.type) == Locations.BURGUER]#type: ignore
|
|
|
|
|
+ bar_items = [ Item(name=item.name, price=product.price, quantity=item.quantity) for product, item in zip(items, products) if CAT_ITEMS.get(item.type) == Locations.BAR]#type: ignore
|
|
|
|
|
+ coctelery_items = [ Item(name=item.name, price=product.price, quantity=item.quantity) for product, item in zip(items, products) if CAT_ITEMS.get(item.type) == Locations.COCTELERY]#type: ignore
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- if kitchen_items:
|
|
|
|
|
- ps.print_order(Order(table=table, items=kitchen_items, customerName=user.name, totalAmount=order.totalAmount, orderDate=order.orderDate), location=Locations.KITCHEN)
|
|
|
|
|
- logger.info(f"Order kitchen printed successfully for table {table}")
|
|
|
|
|
|
|
+ if pizza_items:
|
|
|
|
|
+ ps.print_order(Order(table=table, items=pizza_items, customerName=user.name, totalAmount=order.totalAmount, orderDate=order.orderDate), location=Locations.PIZZAS)
|
|
|
|
|
+ logger.info(f"Order pizza printed successfully for table {table}")
|
|
|
|
|
+ if burger_items:
|
|
|
|
|
+ ps.print_order(Order(table=table, items=burger_items, customerName=user.name, totalAmount=order.totalAmount, orderDate=order.orderDate), location=Locations.BURGUER)
|
|
|
if bar_items:
|
|
if bar_items:
|
|
|
ps.print_order(Order(table=table, items=bar_items, customerName=user.name, totalAmount=order.totalAmount, orderDate=order.orderDate), location=Locations.BAR)
|
|
ps.print_order(Order(table=table, items=bar_items, customerName=user.name, totalAmount=order.totalAmount, orderDate=order.orderDate), location=Locations.BAR)
|
|
|
logger.info(f"Order bar printed successfully for table {table}")
|
|
logger.info(f"Order bar printed successfully for table {table}")
|