Added option to view Voided bills
This commit is contained in:
parent
17702a433b
commit
5ece52ad55
|
@ -59,6 +59,11 @@ def from_bill(
|
||||||
Voucher.bill_id == int(id_.replace("ST-", "")),
|
Voucher.bill_id == int(id_.replace("ST-", "")),
|
||||||
Voucher.voucher_type == VoucherType.STAFF,
|
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:
|
else:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<mat-option value="1">Regular Bill</mat-option>
|
<mat-option value="1">Regular Bill</mat-option>
|
||||||
<mat-option value="4">Staff</mat-option>
|
<mat-option value="4">Staff</mat-option>
|
||||||
<mat-option value="2">No Charge</mat-option>
|
<mat-option value="2">No Charge</mat-option>
|
||||||
|
<mat-option value="8">Void</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field fxFlex>
|
<mat-form-field fxFlex>
|
||||||
|
|
|
@ -45,6 +45,9 @@ export class BillNumberComponent implements OnInit {
|
||||||
case '2': // No Charge
|
case '2': // No Charge
|
||||||
billId = 'NC-' + billNumber;
|
billId = 'NC-' + billNumber;
|
||||||
break;
|
break;
|
||||||
|
case '8': // Void
|
||||||
|
billId = 'V-' + billNumber;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error('Unknown Bill Type');
|
throw new Error('Unknown Bill Type');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue