Save Bill Works

This commit is contained in:
Amritanshu
2019-07-13 21:32:18 +05:30
parent bcad4cdae3
commit 7d06a2f961
43 changed files with 660 additions and 349 deletions

View File

@ -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;
}

View File

@ -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>

View File

@ -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();
}
}