Ported:
Table Merge/Move and Kot Merge/Move
This commit is contained in:
@ -133,7 +133,7 @@ export class BillsComponent implements OnInit {
|
||||
}
|
||||
|
||||
moveKot(kot: Kot) {
|
||||
const canMergeTables = (this.auth.user.perms.indexOf('merge-tables') === -1);
|
||||
const canMergeTables = (this.auth.user.perms.indexOf('merge-tables') !== -1);
|
||||
this.dialog.open(TablesDialogComponent, {
|
||||
// width: '750px',
|
||||
data: {
|
||||
|
||||
@ -100,45 +100,41 @@ export class VoucherService {
|
||||
}
|
||||
|
||||
moveTable(id: string, table: Table): Observable<boolean> {
|
||||
const options = {params: new HttpParams().set('move', '')};
|
||||
return <Observable<boolean>>this.http.post<boolean>(urlMoveTable, {
|
||||
voucher: {id: id},
|
||||
table: {id: table.id}
|
||||
}, options).pipe(
|
||||
return <Observable<boolean>>this.http.post<boolean>(`${urlMoveTable}/move`, {
|
||||
voucherId: id,
|
||||
tableId: table.id
|
||||
}).pipe(
|
||||
catchError(this.log.handleError(serviceName, 'moveTable'))
|
||||
);
|
||||
}
|
||||
|
||||
mergeTable(id: string, table: Table): Observable<boolean> {
|
||||
const options = {params: new HttpParams().set('merge', '')};
|
||||
return <Observable<boolean>>this.http.post<boolean>(urlMoveTable, {
|
||||
voucher: {id: id},
|
||||
table: {id: table.id},
|
||||
newVoucher: {id: table.voucherId}
|
||||
}, options).pipe(
|
||||
return <Observable<boolean>>this.http.post<boolean>(`${urlMoveTable}/merge`, {
|
||||
voucherId: id,
|
||||
tableId: table.id,
|
||||
newVoucherId: table.voucherId
|
||||
}).pipe(
|
||||
catchError(this.log.handleError(serviceName, 'mergeTable'))
|
||||
);
|
||||
}
|
||||
|
||||
moveKotToNewTable(id: string, kotId: string, table: Table): Observable<boolean> {
|
||||
const options = {params: new HttpParams().set('move', '')};
|
||||
return <Observable<boolean>>this.http.post<boolean>(urlMoveKot, {
|
||||
voucher: {id: id},
|
||||
kot: {id: kotId},
|
||||
table: {id: table.id}
|
||||
}, options).pipe(
|
||||
return <Observable<boolean>>this.http.post<boolean>(`${urlMoveKot}/move`, {
|
||||
voucherId: id,
|
||||
kotId: kotId,
|
||||
tableId: table.id
|
||||
}).pipe(
|
||||
catchError(this.log.handleError(serviceName, 'moveKotToNewTable'))
|
||||
);
|
||||
}
|
||||
|
||||
mergeKotWithOldBill(id: string, kotId: string, table: Table): Observable<boolean> {
|
||||
const options = {params: new HttpParams().set('merge', '')};
|
||||
return <Observable<boolean>>this.http.post<boolean>(urlMoveKot, {
|
||||
voucher: {id: id},
|
||||
kot: {id: kotId},
|
||||
table: {id: table.id},
|
||||
newVoucher: {id: table.voucherId}
|
||||
}, options).pipe(
|
||||
return <Observable<boolean>>this.http.post<boolean>(`${urlMoveKot}/merge`, {
|
||||
voucherId: id,
|
||||
kotId: kotId,
|
||||
tableId: table.id,
|
||||
newVoucherId: table.voucherId
|
||||
}).pipe(
|
||||
catchError(this.log.handleError(serviceName, 'mergeKotWithOldBill'))
|
||||
);
|
||||
}
|
||||
|
||||
@ -265,7 +265,7 @@ export class SalesHomeComponent implements OnInit {
|
||||
if (!this.moveTableAllowed()) {
|
||||
return;
|
||||
}
|
||||
const canMergeTables = (this.auth.user.perms.indexOf('merge-tables') === -1);
|
||||
const canMergeTables = (this.auth.user.perms.indexOf('merge-tables') !== -1);
|
||||
this.dialog.open(TablesDialogComponent, {
|
||||
// width: '750px',
|
||||
data: {
|
||||
|
||||
Reference in New Issue
Block a user