Added option to view Voided bills

This commit is contained in:
2021-07-02 09:05:37 +05:30
parent 17702a433b
commit 5ece52ad55
3 changed files with 9 additions and 0 deletions

View File

@ -59,6 +59,11 @@ def from_bill(
Voucher.bill_id == int(id_.replace("ST-", "")),
Voucher.voucher_type == VoucherType.STAFF,
)
elif re.compile(r"^V-\d+$").match(id_):
query = query.where(
Voucher.kot_id == int(id_.replace("V-", "")),
Voucher.voucher_type == VoucherType.VOID,
)
else:
raise HTTPException(
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,