Ported:
Split bill done - TODO: If the products have different price due to paid modifiers
This commit is contained in:
@ -13,6 +13,7 @@ const httpOptions = {
|
||||
const url = '/api/voucher';
|
||||
const urlMoveTable = '/api/move-table';
|
||||
const urlMoveKot = '/api/move-kot';
|
||||
const urlSplitBill = '/api/split-bill';
|
||||
const serviceName = 'VoucherService';
|
||||
|
||||
@Injectable({providedIn: 'root'})
|
||||
@ -140,11 +141,10 @@ export class VoucherService {
|
||||
}
|
||||
|
||||
splitBill(id: string, inventoriesToMove: string[], table: Table) {
|
||||
const options = {params: new HttpParams().set('split-bill', '').set('u', 'true')};
|
||||
return <Observable<boolean>>this.http.post<boolean>(`${url}/${id}`, {
|
||||
voucher: {id: id},
|
||||
const options = {params: new HttpParams().set('u', 'true')};
|
||||
return <Observable<boolean>>this.http.post<boolean>(`${urlSplitBill}/${id}`, {
|
||||
inventories: inventoriesToMove,
|
||||
table: {id: table.id}
|
||||
tableId: table.id
|
||||
}, options).pipe(
|
||||
catchError(this.log.handleError(serviceName, 'splitBill'))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user