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.

This commit is contained in:
2025-08-09 17:19:30 +00:00
parent e1cbf7ffb8
commit 8ff7363fc8
2 changed files with 2 additions and 2 deletions

View File

@ -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=[],
)

View File

@ -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)