Chore: In overlord / sale / bill.service now the BillViewItem is just a view item
The data is kept as the original bill object and this view generated on every change. It has no sanctity. To deal with the challenges of Selection of items in the bill.component.html created a bill selection item. This is converted to string while checking else the selection model fails. Feature: It now checks if Happy Hour items have equivalent regular items in each kot. Feature: Discount won't apply to happy hour items. Checks for both are both in front end and back end.
This commit is contained in:
1 parent
28952402aa
commit
6c83c74424
9 files changed
+304
-195
No files matched your search
@@ -4,42 +4,32 @@ import { Tax } from './tax';
|
||||
|
||||
export class BillViewItem {
|
||||
id: string | undefined;
|
||||
kotId: string | undefined;
|
||||
isKot: boolean;
|
||||
info: string;
|
||||
|
||||
kotId: string;
|
||||
product: Product;
|
||||
productId: string | undefined;
|
||||
productId: string;
|
||||
isHappyHour: boolean;
|
||||
isPrinted: boolean;
|
||||
price: number;
|
||||
quantity: number;
|
||||
discount: number;
|
||||
taxRate: number;
|
||||
tax: Tax;
|
||||
modifiers: Modifier[];
|
||||
|
||||
public get isOldKot(): boolean {
|
||||
return this.isKot && this.id !== undefined;
|
||||
return this.isKot && this.kotId !== undefined;
|
||||
}
|
||||
|
||||
public get isNewKot(): boolean {
|
||||
return this.isKot && this.id === undefined;
|
||||
return this.isKot && this.kotId === undefined;
|
||||
}
|
||||
|
||||
public constructor(init?: Partial<BillViewItem>) {
|
||||
this.isKot = true;
|
||||
this.info = '';
|
||||
this.kotId = '';
|
||||
this.product = new Product();
|
||||
this.productId = this.product.id;
|
||||
this.productId = '';
|
||||
this.isHappyHour = false;
|
||||
this.isPrinted = false;
|
||||
this.price = 0;
|
||||
this.quantity = 0;
|
||||
this.discount = 0;
|
||||
this.taxRate = 0;
|
||||
this.tax = new Tax();
|
||||
this.modifiers = [];
|
||||
Object.assign(this, init);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user