Fix: Open bill regex and the data sent by front-end was not compatible.
This commit is contained in:
parent
83aa47b33a
commit
d9a6c5d20f
@ -40,10 +40,10 @@ def from_bill(
|
||||
):
|
||||
with SessionFuture() as db:
|
||||
query = select(Voucher)
|
||||
if re.compile(r"^\d{2,}-\d{4}$").match(id_):
|
||||
query = query.where(
|
||||
Voucher.bill_id == int(id_.replace("-", "")), Voucher.voucher_type == VoucherType.REGULAR_BILL
|
||||
)
|
||||
if re.compile(r"^\d{1,3}-\d{1,4}$").match(id_):
|
||||
s, n = id_.split("-")
|
||||
i = int(s * 10000) + int(n)
|
||||
query = query.where(Voucher.bill_id == i, Voucher.voucher_type == VoucherType.REGULAR_BILL)
|
||||
elif re.compile(r"^K-\d+$").match(id_):
|
||||
query = query.where(
|
||||
Voucher.kot_id == int(id_.replace("K-", "")),
|
||||
|
@ -21,11 +21,9 @@ export class SettingsService {
|
||||
|
||||
setPrefillCustomerDiscount(value: boolean): Observable<boolean> {
|
||||
const url = '/api/settings/prefill-customer-discount';
|
||||
return this.http
|
||||
.post<{ value: boolean }>(url, { value: value })
|
||||
.pipe(
|
||||
map((x) => x.value),
|
||||
catchError(this.log.handleError(serviceName, 'setPrefillCustomerDiscount')),
|
||||
) as Observable<boolean>;
|
||||
return this.http.post<{ value: boolean }>(url, { value: value }).pipe(
|
||||
map((x) => x.value),
|
||||
catchError(this.log.handleError(serviceName, 'setPrefillCustomerDiscount')),
|
||||
) as Observable<boolean>;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user