Added option to view Voided bills

This commit is contained in:
Amritanshu Agrawal 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,

View File

@ -13,6 +13,7 @@
<mat-option value="1">Regular Bill</mat-option>
<mat-option value="4">Staff</mat-option>
<mat-option value="2">No Charge</mat-option>
<mat-option value="8">Void</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex>

View File

@ -45,6 +45,9 @@ export class BillNumberComponent implements OnInit {
case '2': // No Charge
billId = 'NC-' + billNumber;
break;
case '8': // Void
billId = 'V-' + billNumber;
break;
default:
throw new Error('Unknown Bill Type');
}