Save Bill Works
This commit is contained in:
@ -2,4 +2,19 @@
|
||||
min-width: 150px;
|
||||
max-width: 150px;
|
||||
min-height: 150px;
|
||||
max-height: 150px;
|
||||
cursor: pointer;
|
||||
margin: 20px;
|
||||
}
|
||||
.item-name {
|
||||
text-align: center;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.warn {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
@ -1,5 +1,18 @@
|
||||
<button mat-raised-button class="square-button" [routerLink]="['menu-categories']">Add Product</button>
|
||||
<button mat-raised-button class="square-button" [routerLink]="['menu-categories']">Print KOT</button>
|
||||
<button mat-raised-button class="square-button" [routerLink]="['menu-categories']">Print Bill</button>
|
||||
<button mat-raised-button class="square-button" [routerLink]="['menu-categories']">Back to Tables</button>
|
||||
<button mat-raised-button class="square-button" [routerLink]="['menu-categories']">Receive Payment</button>
|
||||
<div fxLayout="row wrap" fxLayoutGap="grid 20px">
|
||||
<mat-card fxLayout="column" class="square-button" matRipple [routerLink]="['menu-categories']"
|
||||
queryParamsHandling="preserve">
|
||||
<h3 class="item-name">Add Product</h3>
|
||||
</mat-card>
|
||||
<mat-card fxLayout="column" class="square-button" matRipple (click)="printKot()">
|
||||
<h3 class="item-name">Print KOT</h3>
|
||||
</mat-card>
|
||||
<mat-card fxLayout="column" class="square-button" matRipple (click)="printBill()">
|
||||
<h3 class="item-name">Print Bill</h3>
|
||||
</mat-card>
|
||||
<mat-card fxLayout="column" class="square-button warn" matRipple [routerLink]="['../../tables']">
|
||||
<h3 class="item-name">Back to Tables</h3>
|
||||
</mat-card>
|
||||
<mat-card fxLayout="column" class="square-button" matRipple [routerLink]="['../../tables']">
|
||||
<h3 class="item-name">Receive Payment</h3>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {Subject} from 'rxjs';
|
||||
import {AuthService} from '../../auth/auth.service';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
import { AuthService } from '../../auth/auth.service';
|
||||
import { BillService } from '../bill.service';
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
|
||||
@Component({
|
||||
selector: 'app-sales-home',
|
||||
@ -10,7 +12,7 @@ import {AuthService} from '../../auth/auth.service';
|
||||
export class SalesHomeComponent implements OnInit {
|
||||
public nameObject = new Subject<string>();
|
||||
|
||||
constructor(private auth: AuthService) {
|
||||
constructor(private route: ActivatedRoute, private auth: AuthService, private bs: BillService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@ -22,4 +24,16 @@ export class SalesHomeComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
printKot() {
|
||||
let guestBookId = null;
|
||||
if (this.route.snapshot.queryParamMap.has("guest")) {
|
||||
guestBookId = this.route.snapshot.queryParamMap.get("guest");
|
||||
}
|
||||
this.bs.printKot(guestBookId);
|
||||
}
|
||||
|
||||
printBill() {
|
||||
this.bs.printBill();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user