|
|
@@ -69,7 +69,7 @@ async def printer_order(order: OrderWeb, current_user: User = Depends(get_curren
|
|
|
logger.error(error_msg)
|
|
|
return JSONResponse(status_code=500, content={"message": "Error interno del servidor"})
|
|
|
|
|
|
- types = set([CAT_ITEMS[product.type] for product in products])
|
|
|
+ types = set([CAT_ITEMS[product.type or ""] for product in products])
|
|
|
|
|
|
# Printer status validation
|
|
|
if not DEVELOPMENT:
|
|
|
@@ -84,7 +84,7 @@ async def printer_order(order: OrderWeb, current_user: User = Depends(get_curren
|
|
|
target=get_email_sender().send_email,
|
|
|
args=(
|
|
|
PRINTER_DISCONNECTED_MAIL["subject"],
|
|
|
- PRINTER_DISCONNECTED_MAIL["body"].format(location=", ".join([loc.value for loc in printer_status])),
|
|
|
+ PRINTER_DISCONNECTED_MAIL["body"].format(location=", ".join([loc.value for loc in printer_status])), #type: ignore
|
|
|
["erwinjacimino2003@gmail.com", "mompyn@gmail.com"]
|
|
|
),
|
|
|
daemon=True
|
|
|
@@ -231,9 +231,9 @@ async def printer_order(order: OrderWeb, current_user: User = Depends(get_curren
|
|
|
|
|
|
# Print order
|
|
|
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]
|
|
|
- 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]
|
|
|
- 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]
|
|
|
+ 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
|
|
|
|
|
|
if kitchen_items:
|
|
|
ps.print_order(Order(table=table, items=kitchen_items, customerName=user.name, totalAmount=order.totalAmount, orderDate=order.orderDate), location=Locations.KITCHEN)
|
|
|
@@ -244,8 +244,7 @@ async def printer_order(order: OrderWeb, current_user: User = Depends(get_curren
|
|
|
if coctelery_items:
|
|
|
ps.print_order(Order(table=table, items=coctelery_items, customerName=user.name, totalAmount=order.totalAmount, orderDate=order.orderDate), location=Locations.COCTELERY)
|
|
|
logger.info(f"Order coctelery printed successfully for table {table}")
|
|
|
-
|
|
|
- # ps.print_order(order_for_print, location=CAT_ITEMS.get())
|
|
|
+
|
|
|
|
|
|
logger.info(f"Order printed successfully for table {table}")
|
|
|
|