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:
@ -54,7 +54,12 @@
|
||||
<ng-container matColumnDef="action">
|
||||
<mat-header-cell *matHeaderCellDef class="center">Action</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="center">
|
||||
<button mat-icon-button [routerLink]="['/sales']" [queryParams]="{ guest: row.id }" *ngIf="!row.tableId">
|
||||
<button
|
||||
mat-icon-button
|
||||
[routerLink]="['/sales']"
|
||||
[queryParams]="{ guest: row.id }"
|
||||
*ngIf="!row.tableId && !row.voucherId"
|
||||
>
|
||||
<mat-icon>chair</mat-icon>
|
||||
</button>
|
||||
<button
|
||||
@ -66,6 +71,15 @@
|
||||
>
|
||||
{{ row.tableName }}
|
||||
</button>
|
||||
<button
|
||||
mat-stroked-button
|
||||
color="primary"
|
||||
[routerLink]="['/sales', 'bill']"
|
||||
[queryParams]="{ voucher: row.voucherId }"
|
||||
*ngIf="!row.tableId && row.voucherId"
|
||||
>
|
||||
{{ row.tableName }}
|
||||
</button>
|
||||
<button mat-icon-button [routerLink]="['/guest-book/', row.id]">
|
||||
<mat-icon>edit</mat-icon>
|
||||
</button>
|
||||
|
||||
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@ -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()),
|
||||
|
||||
Reference in New Issue
Block a user