Explorar el Código

promocioens solo hasta las 8 de la noche

Erwin Jacimino hace 6 meses
padre
commit
fc4db8c6ff
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      routes/orders.py

+ 2 - 2
routes/orders.py

@@ -112,8 +112,8 @@ async def printer_order(order: OrderWeb, current_user: User = Depends(get_curren
         
         for item, product in zip(items, products):
             try:
-                # Si es dia de promo
-                if time.localtime().tm_wday + 1 == product.promo_day and product.promo_id:
+                # Si es dia de promo y es menos de las 8 pm
+                if time.localtime().tm_wday + 1 == product.promo_day and product.promo_id and time.localtime().tm_hour < 20:
                     logger.info(f"Applying promotion for product {product.id} on table {table}")
                     fudo_product = add_product_to_fudo(product.promo_id, item.quantity, table)