In case of a table with no guest, it will ask for pax
This commit is contained in:
@ -13,7 +13,7 @@ import { TablesDialogComponent } from '../tables-dialog/tables-dialog.component'
|
||||
import { TableService } from '../../tables/table.service';
|
||||
import { ToasterService } from '../../core/toaster.service';
|
||||
import { AuthService } from '../../auth/auth.service';
|
||||
import { SelectionModel } from '@angular/cdk/collections';
|
||||
import { PaxComponent } from "../pax/pax.component";
|
||||
|
||||
@Component({
|
||||
selector: 'app-bills',
|
||||
@ -22,7 +22,6 @@ import { SelectionModel } from '@angular/cdk/collections';
|
||||
})
|
||||
export class BillsComponent implements OnInit {
|
||||
dataSource: BillsDataSource;
|
||||
item: Bill;
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns: string[] = ['select', 'info', 'quantity'];
|
||||
|
||||
@ -40,12 +39,28 @@ export class BillsComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { item: Bill }) => {
|
||||
this.item = data.item;
|
||||
this.bs.loadData(data.item);
|
||||
});
|
||||
this.getPax();
|
||||
this.dataSource = new BillsDataSource(this.bs.dataObs);
|
||||
}
|
||||
|
||||
getPax(): void {
|
||||
if (this.bs.bill.id || this.bs.bill.customer.id) {
|
||||
return
|
||||
}
|
||||
const dialogRef = this.dialog.open(PaxComponent, {
|
||||
// width: '750px',
|
||||
data: this.bs.bill.pax
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe((result: boolean | number) => {
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
this.bs.bill.pax = result as number;
|
||||
});
|
||||
}
|
||||
isAllSelected(kot: Kot) {
|
||||
return this.bs.data.filter(
|
||||
x => x.kotId === kot.id
|
||||
|
||||
Reference in New Issue
Block a user