Fix: Loaded voucher was not showing H H name in Happy Hour products

This commit is contained in:
Amritanshu Agrawal 2020-12-16 12:28:39 +05:30
parent 02e208cd4e
commit 28952402aa
1 changed files with 3 additions and 3 deletions

View File

@ -97,7 +97,7 @@ def from_table(
return voucher_blank(table, guest)
def voucher_product(product_id: uuid.UUID, date_: date, db: Session):
def voucher_product(product_id: uuid.UUID, date_: date, is_happy_hour: bool, db: Session):
product: ProductVersion = (
db.query(ProductVersion)
.filter(
@ -118,7 +118,7 @@ def voucher_product(product_id: uuid.UUID, date_: date, db: Session):
return {
"id": product_id,
"name": product.full_name,
"name": ("H H " if is_happy_hour else "") + product.full_name,
"menuCategory": {
"id": product.menu_category_id,
"name": product.menu_category.name,
@ -160,7 +160,7 @@ def voucher_info(item: Voucher, db: Session):
{
"id": i.id,
"sortOrder": i.sort_order,
"product": voucher_product(i.product_id, item.date.date(), db),
"product": voucher_product(i.product_id, item.date.date(), i.is_happy_hour, db),
"quantity": i.quantity,
"price": i.price,
"isHappyHour": i.is_happy_hour,