Fix: Prevent creation of customer with blank name when adding a guest book item.

Fix: Also prevent creation of customer with blank phone number when adding a guest book.
Feature: Show the old bill of a customer in guest book
Fix: In reprint, allow changing of customer
Chore: Updated dependencies
This commit is contained in:
2023-04-09 15:42:32 +05:30
parent 302ed4a18f
commit 8bc7d66123
9 changed files with 81 additions and 31 deletions

View File

@ -22,6 +22,9 @@ export class BillResolver implements Resolve<Bill> {
if (tableId !== null) {
return this.ser.getFromTable(tableId as string, voucherId, guestId);
}
if (voucherId !== null) {
return this.ser.getFromId(voucherId);
}
throw new Error('Unable to get bill');
}
}

View File

@ -52,6 +52,12 @@ export class VoucherService {
.pipe(catchError(this.log.handleError(serviceName, `getFromBill billId=${billId}`))) as Observable<Bill>;
}
getFromId(voucherId: string): Observable<Bill> {
return this.http
.get<Bill>(`${url}/from-id/${voucherId}`)
.pipe(catchError(this.log.handleError(serviceName, `getFromId voucherId=${voucherId}`))) as Observable<Bill>;
}
save(voucher: Bill, voucherType: VoucherType, guestBookId: string | null, updateTable: boolean): Observable<boolean> {
const options = {
params: new HttpParams().set('p', voucherType.toString()).set('u', updateTable.toString()),