|
|
@@ -242,6 +242,7 @@ async def printer_order(order: OrderWeb, current_user: User = Depends(get_curren
|
|
|
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)
|
|
|
+ logger.info(f"Order burger printed successfully for table {table}")
|
|
|
if bar_items:
|
|
|
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}")
|
|
|
@@ -256,16 +257,11 @@ async def printer_order(order: OrderWeb, current_user: User = Depends(get_curren
|
|
|
except Exception as e:
|
|
|
error_msg = f"Error printing order for table {table}: {e}"
|
|
|
logger.error(error_msg)
|
|
|
+ return JSONResponse(status_code=500, content={"message": "Error interno del servidor"})
|
|
|
# Don't fail the order for print issues, just log it
|
|
|
|
|
|
- # Log order
|
|
|
- try:
|
|
|
- logger.info(f"Logging order for table {table} with sale ID {sale}, products= {[(product.name, item.quantity) for product, item in zip(products, items)]}")
|
|
|
+ logger.info(f"Logging order for table {table} with sale ID {sale}, products= {[(product.name, item.quantity) for product, item in zip(products, items)]}")
|
|
|
|
|
|
- except Exception as e:
|
|
|
- logger.error(f"Error in legacy order logging: {e}")
|
|
|
- # Don't fail the order for logging issues
|
|
|
-
|
|
|
logger.info(f"Order processing completed successfully for table {table}, sale ID: {sale}")
|
|
|
return JSONResponse({"message": SuccessResponse.ORDER_SUCCESS, "new_progress": new_progress})
|
|
|
|