From 8ff7363fc87321a2912fb45245bc149decdcd46e Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Sat, 9 Aug 2025 17:19:30 +0000 Subject: [PATCH] Fixed: VoucherType as not number. So, if a bill was being printed directly without kot first being printed, it would not ask for bill type as the comparison was comparing string with int. --- barker/barker/routers/voucher/show.py | 2 +- barker/barker/schemas/voucher_out.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/barker/barker/routers/voucher/show.py b/barker/barker/routers/voucher/show.py index 23938448..601eefe2 100644 --- a/barker/barker/routers/voucher/show.py +++ b/barker/barker/routers/voucher/show.py @@ -301,7 +301,7 @@ def voucher_blank(table: FoodTable, guest: GuestBook | None) -> VoucherBlank: return VoucherBlank( pax=table.seats if guest is None else guest.pax, table=TableLink(id_=table.id, name=table.name), - voucher_type=str(VoucherType.KOT), + voucher_type=VoucherType.KOT, customer=CustomerLink(id_=guest.customer_id, name=guest.customer.name) if guest is not None else None, kots=[], ) diff --git a/barker/barker/schemas/voucher_out.py b/barker/barker/schemas/voucher_out.py index b1cf3686..38e80cf0 100644 --- a/barker/barker/schemas/voucher_out.py +++ b/barker/barker/schemas/voucher_out.py @@ -109,7 +109,7 @@ class VoucherBlank(BaseModel): pax: int table: TableLink customer: CustomerLink | None = None - voucher_type: str + voucher_type: int kots: list[Kot] model_config = ConfigDict(str_strip_whitespace=True, alias_generator=to_camel, populate_by_name=True)