Chore:
Moved to sqlalchemy 2.0 Added type checking as much as possible Updated angular to 15 Moved from Angular flex layout to tailwind css Started developing on vscode with devcontainers
This commit is contained in:
@ -1,13 +1,7 @@
|
||||
<mat-dialog-content>
|
||||
<form [formGroup]="form">
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex="15">
|
||||
<div class="flex flex-row justify-around content-start items-start sm:max-lg:flex-col">
|
||||
<mat-form-field class="flex-auto basis-[15%] mr-5">
|
||||
<mat-select formControlName="billType">
|
||||
<mat-option value="0">KOT</mat-option>
|
||||
<mat-option value="1">Regular Bill</mat-option>
|
||||
@ -16,13 +10,12 @@
|
||||
<mat-option value="8">Void</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-form-field class="flex-auto">
|
||||
<mat-label>Bill Number</mat-label>
|
||||
<input
|
||||
type="text"
|
||||
matInput
|
||||
#billNumber
|
||||
placeholder="Bill Number"
|
||||
formControlName="billNumber"
|
||||
autocomplete="off"
|
||||
(focus)="billNumber.select()"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
selector: 'app-bill-number',
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<div fxLayout="row wrap" fxLayoutGap="grid 20px">
|
||||
<div class="flex flex-row flex-wrap -mr-5 -mb-5">
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
(click)="select('REGULAR_BILL')"
|
||||
[class.selected]="selected === 'REGULAR_BILL'"
|
||||
@ -9,8 +8,7 @@
|
||||
<h3 class="item-name">Regular</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
(click)="select('STAFF')"
|
||||
[class.selected]="selected === 'STAFF'"
|
||||
@ -18,8 +16,7 @@
|
||||
<h3 class="item-name">Staff</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
(click)="select('NO_CHARGE')"
|
||||
[class.selected]="selected === 'NO_CHARGE'"
|
||||
|
||||
@ -12,9 +12,5 @@ export class BillsDataSource extends DataSource<BillViewItem> {
|
||||
return this.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the table is being destroyed. Use this function, to clean up
|
||||
* any open connections or free any held resources that were set up during connect.
|
||||
*/
|
||||
disconnect() {}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ table {
|
||||
}
|
||||
|
||||
.mat-column-select {
|
||||
flex: 0 0 50px;
|
||||
flex: 0 0 60px;
|
||||
}
|
||||
|
||||
.grey900 {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<mat-card>
|
||||
<mat-card-title-group>
|
||||
<mat-card-header>
|
||||
<mat-card-title>Bill</mat-card-title>
|
||||
</mat-card-title-group>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<table
|
||||
mat-table
|
||||
@ -44,8 +44,8 @@
|
||||
<ng-container matColumnDef="table-details">
|
||||
<mat-header-cell *matHeaderCellDef class="deep-purple-50 bold right-align"
|
||||
><button>Table: {{ bs.bill.table.name }}</button> /
|
||||
<button (click)="choosePax()">{{ bs.bill.pax }} Pax</button> /
|
||||
<button (click)="chooseCustomer()">
|
||||
<button mat-button (click)="choosePax()">{{ bs.bill.pax }} Pax</button> /
|
||||
<button mat-button (click)="chooseCustomer()">
|
||||
{{ bs.bill.customer?.name || 'Customer' }}
|
||||
</button></mat-header-cell
|
||||
>
|
||||
@ -141,7 +141,7 @@
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="gross-amount">
|
||||
<mat-footer-cell *matFooterCellDef class="grey300 bold right-align">{{
|
||||
bs.grossAmount | async | currency: 'INR'
|
||||
bs.grossAmount | async | currency : 'INR'
|
||||
}}</mat-footer-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="hh-title">
|
||||
@ -151,7 +151,7 @@
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="hh-amount">
|
||||
<mat-footer-cell *matFooterCellDef class="grey300 bold right-align">{{
|
||||
bs.hhAmount | async | currency: 'INR'
|
||||
bs.hhAmount | async | currency : 'INR'
|
||||
}}</mat-footer-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="discount-title">
|
||||
@ -159,7 +159,7 @@
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="discount-amount">
|
||||
<mat-footer-cell *matFooterCellDef class="grey500 bold right-align">{{
|
||||
bs.discountAmount | async | currency: 'INR'
|
||||
bs.discountAmount | async | currency : 'INR'
|
||||
}}</mat-footer-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="tax-title">
|
||||
@ -167,7 +167,7 @@
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="tax-amount">
|
||||
<mat-footer-cell *matFooterCellDef class="grey700 bold right-align">{{
|
||||
bs.taxAmount | async | currency: 'INR'
|
||||
bs.taxAmount | async | currency : 'INR'
|
||||
}}</mat-footer-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="amount-title">
|
||||
@ -175,7 +175,7 @@
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="amount-amount">
|
||||
<mat-footer-cell *matFooterCellDef class="grey900 bold right-align">{{
|
||||
bs.amount | async | currency: 'INR'
|
||||
bs.amount | async | currency : 'INR'
|
||||
}}</mat-footer-cell>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
.example-card {
|
||||
max-width: 400px;
|
||||
}
|
||||
/*.discounts > div:nth-child(even) .mat-form-field {*/
|
||||
/* margin-left: 8px;*/
|
||||
/*}*/
|
||||
|
||||
/*.discounts > div:nth-child(odd) .mat-form-field {*/
|
||||
/* margin-right: 8px;*/
|
||||
/*}*/
|
||||
|
||||
.discounts > div:nth-child(3n + 1) .mat-form-field {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.discounts > div:nth-child(3n + 2) .mat-form-field {
|
||||
margin-left: 4px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.discounts > div:nth-child(3n) .mat-form-field {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
@ -1,18 +1,11 @@
|
||||
<h1 mat-dialog-title>Customer</h1>
|
||||
<mat-dialog-content>
|
||||
<form [formGroup]="form" fxLayout="column">
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<form [formGroup]="form" class="flex flex-col">
|
||||
<div class="flex flex-row justify-around content-start items-start">
|
||||
<mat-form-field class="flex-auto">
|
||||
<mat-label>Phone</mat-label>
|
||||
<input
|
||||
matInput
|
||||
placeholder="Phone"
|
||||
type="text"
|
||||
formControlName="phone"
|
||||
[matAutocomplete]="auto"
|
||||
@ -31,53 +24,31 @@
|
||||
>
|
||||
</mat-autocomplete>
|
||||
</div>
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<div class="flex flex-row justify-around content-start items-start">
|
||||
<mat-form-field class="flex-auto">
|
||||
<mat-label>Name</mat-label>
|
||||
<input matInput placeholder="Name" formControlName="name" />
|
||||
<input matInput formControlName="name" />
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<div class="flex flex-row justify-around content-start items-start">
|
||||
<mat-form-field class="flex-auto">
|
||||
<mat-label>Address</mat-label>
|
||||
<textarea matInput placeholder="Address" formControlName="address"> </textarea>
|
||||
<textarea matInput formControlName="address"> </textarea>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<div class="flex flex-row justify-around content-start items-start">
|
||||
<mat-checkbox formControlName="printInBill">Print in Bill?</mat-checkbox>
|
||||
</div>
|
||||
<p></p>
|
||||
<div formArrayName="discounts" fxLayout="row wrap" class="discounts">
|
||||
<div formArrayName="discounts" class="discounts">
|
||||
<div
|
||||
*ngFor="let r of item.discounts; index as i"
|
||||
[formGroupName]="i"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
fxFlex="33%"
|
||||
class="flex flex-row justify-around content-start items-start"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-form-field class="flex-auto">
|
||||
<mat-label>Discount on {{ r.name }}</mat-label>
|
||||
<input matInput placeholder="Discount" formControlName="discount" />
|
||||
<input matInput formControlName="discount" />
|
||||
<span matSuffix>%</span>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<h2 mat-dialog-title>Discount</h2>
|
||||
<mat-dialog-content>
|
||||
<form [formGroup]="form" fxLayout="column">
|
||||
<form [formGroup]="form" class="flex flex-col">
|
||||
<mat-table #table [dataSource]="dataSource" formArrayName="discounts">
|
||||
<!-- Name Column -->
|
||||
<ng-container matColumnDef="name">
|
||||
@ -10,13 +10,20 @@
|
||||
|
||||
<!-- Discount Column -->
|
||||
<ng-container matColumnDef="discount">
|
||||
<mat-header-cell *matHeaderCellDef class="center" fxFlex>Discount</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index" class="center" [formGroupName]="i" fxFlex>
|
||||
<mat-form-field fxFlex="100%">
|
||||
<mat-header-cell *matHeaderCellDef class="center" class="flex-auto"
|
||||
>Discount</mat-header-cell
|
||||
>
|
||||
<mat-cell
|
||||
*matCellDef="let row; let i = index"
|
||||
class="center"
|
||||
[formGroupName]="i"
|
||||
class="flex-auto"
|
||||
>
|
||||
<mat-form-field class="flex-auto">
|
||||
<input matInput type="number" formControlName="discount" autocomplete="off" />
|
||||
<span matSuffix>%</span>
|
||||
<mat-hint>Cust: {{ row.customerDiscount | percent: '1.2-2' }}</mat-hint>
|
||||
<mat-hint align="end">Max: {{ row.discountLimit | percent: '1.2-2' }}</mat-hint>
|
||||
<mat-hint>Cust: {{ row.customerDiscount | percent : '1.2-2' }}</mat-hint>
|
||||
<mat-hint align="end">Max: {{ row.discountLimit | percent : '1.2-2' }}</mat-hint>
|
||||
</mat-form-field>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -58,8 +58,9 @@ export class DiscountComponent {
|
||||
const array = this.form.get('discounts') as UntypedFormArray;
|
||||
for (let i = this.list.length - 1; i >= 0; i--) {
|
||||
const item = this.list[i];
|
||||
const control = (array.controls[i] as UntypedFormGroup).controls
|
||||
.discount as UntypedFormControl;
|
||||
const control = (array.controls[i] as UntypedFormGroup).controls[
|
||||
'discount'
|
||||
] as UntypedFormControl;
|
||||
if (
|
||||
control.value === null ||
|
||||
control.value === '' ||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<div fxLayout="row wrap" fxLayoutGap="grid 20px">
|
||||
<div class="flex flex-row flex-wrap -mr-5 -mb-5">
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
[routerLink]="['menu-categories']"
|
||||
queryParamsHandling="preserve"
|
||||
@ -9,8 +8,7 @@
|
||||
<h3 class="item-name">Add Product</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
(click)="discount()"
|
||||
[class.disabled]="!discountAllowed()"
|
||||
@ -18,8 +16,7 @@
|
||||
<h3 class="item-name">Discount</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
(click)="printKot()"
|
||||
[class.disabled]="!printKotAllowed()"
|
||||
@ -27,20 +24,22 @@
|
||||
<h3 class="item-name">Print KOT</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
(click)="printBill()"
|
||||
[class.disabled]="!printBillAllowed()"
|
||||
>
|
||||
<h3 class="item-name">Print Bill</h3>
|
||||
</mat-card>
|
||||
<mat-card fxLayout="column" class="square-button warn" matRipple [routerLink]="['../../tables']">
|
||||
<mat-card
|
||||
class="flex flex-col square-button mr-5, mb-5 warn"
|
||||
matRipple
|
||||
[routerLink]="['/', 'sales', 'tables']"
|
||||
>
|
||||
<h3 class="item-name">Back to Tables</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
(click)="receivePayment()"
|
||||
[class.disabled]="!receivePaymentAllowed()"
|
||||
@ -48,8 +47,7 @@
|
||||
<h3 class="item-name">Receive Payment</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
(click)="moveTable()"
|
||||
[class.disabled]="!moveTableAllowed()"
|
||||
@ -57,8 +55,7 @@
|
||||
<h3 class="item-name">Move Table</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
(click)="voidBill()"
|
||||
[class.disabled]="!voidBillAllowed()"
|
||||
@ -66,8 +63,7 @@
|
||||
<h3 class="item-name">Void Bill</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
(click)="splitBill()"
|
||||
[class.disabled]="!splitBillAllowed()"
|
||||
|
||||
@ -370,7 +370,7 @@ export class SalesHomeComponent {
|
||||
obs
|
||||
.pipe(
|
||||
tap((x) => (inventories = x)),
|
||||
switchMap((x) => this.showChooseTableDialog(false)),
|
||||
switchMap(() => this.showChooseTableDialog(false)),
|
||||
tap((x) => {
|
||||
if (!x) {
|
||||
throw new Error('Please choose a table');
|
||||
@ -417,7 +417,7 @@ export class SalesHomeComponent {
|
||||
}
|
||||
inventories = sel.move;
|
||||
}),
|
||||
map((x) => inventories),
|
||||
map(() => inventories),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -1,23 +1,23 @@
|
||||
<mat-card>
|
||||
<mat-card-content fxLayout="row wrap" fxLayoutGap="grid 20px">
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button warn"
|
||||
matRipple
|
||||
[routerLink]="['../']"
|
||||
queryParamsHandling="preserve"
|
||||
>
|
||||
<h3 class="item-name">Back</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
matRipple
|
||||
*ngFor="let item of list"
|
||||
[routerLink]="['../products', item.id]"
|
||||
queryParamsHandling="preserve"
|
||||
>
|
||||
<h3 class="item-name">{{ item.name }}</h3>
|
||||
</mat-card>
|
||||
<mat-card-content>
|
||||
<div class="flex flex-row flex-wrap -mr-5 -mb-5">
|
||||
<mat-card
|
||||
class="flex flex-col square-button mr-5, mb-5 warn"
|
||||
matRipple
|
||||
[routerLink]="['../']"
|
||||
queryParamsHandling="preserve"
|
||||
>
|
||||
<h3 class="item-name">Back</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
*ngFor="let item of list"
|
||||
[routerLink]="['../products', item.id]"
|
||||
queryParamsHandling="preserve"
|
||||
>
|
||||
<h3 class="item-name">{{ item.name }}</h3>
|
||||
</mat-card>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
@ -3,15 +3,16 @@
|
||||
<mat-tab *ngFor="let item of list">
|
||||
<ng-template matTabLabel>
|
||||
<span>{{ item.name }}</span>
|
||||
<mat-chip-list matBadge="0" matBadgeOverlap="false">
|
||||
<mat-chip *ngIf="!item.maximum">{{ item.minimum }} - ∞</mat-chip>
|
||||
<mat-chip *ngIf="!!item.maximum">{{ item.minimum }} - {{ item.maximum }}</mat-chip>
|
||||
</mat-chip-list>
|
||||
<mat-chip-listbox matBadge="0" matBadgeOverlap="false">
|
||||
<mat-chip-option *ngIf="!item.maximum">{{ item.minimum }} - ∞</mat-chip-option>
|
||||
<mat-chip-option *ngIf="!!item.maximum"
|
||||
>{{ item.minimum }} - {{ item.maximum }}</mat-chip-option
|
||||
>
|
||||
</mat-chip-listbox>
|
||||
</ng-template>
|
||||
<div fxLayout="row wrap" fxLayoutGap="grid 20px">
|
||||
<div class="flex flex-row flex-wrap -mr-5 -mb-5">
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
*ngFor="let m of item.modifiers"
|
||||
(click)="select(m)"
|
||||
|
||||
@ -1,19 +1,12 @@
|
||||
<mat-dialog-content>
|
||||
<form [formGroup]="form">
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<div class="flex flex-row justify-around content-start items-start">
|
||||
<mat-form-field class="flex-auto">
|
||||
<mat-label>Pax</mat-label>
|
||||
<input
|
||||
type="text"
|
||||
matInput
|
||||
#quantity
|
||||
placeholder="Pax"
|
||||
formControlName="pax"
|
||||
autocomplete="off"
|
||||
(focus)="quantity.select()"
|
||||
|
||||
@ -1,25 +1,25 @@
|
||||
<mat-card>
|
||||
<mat-card-content fxLayout="row wrap" fxLayoutGap="grid 20px">
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button red700"
|
||||
matRipple
|
||||
[routerLink]="['../../menu-categories']"
|
||||
queryParamsHandling="preserve"
|
||||
>
|
||||
<h3 class="item-name">Back</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
matRipple
|
||||
*ngFor="let item of list"
|
||||
(click)="addProduct(item)"
|
||||
[class.yellow300]="item.hasHappyHour"
|
||||
[class.grey800]="item.isNotAvailable"
|
||||
>
|
||||
<h3 class="item-name">{{ item.name }}</h3>
|
||||
<mat-card-subtitle class="center">{{ item.price | currency: 'INR' }}</mat-card-subtitle>
|
||||
</mat-card>
|
||||
<mat-card-content>
|
||||
<div class="flex flex-row flex-wrap -mr-5 -mb-5">
|
||||
<mat-card
|
||||
class="flex flex-col square-button mr-5, mb-5 red700"
|
||||
matRipple
|
||||
[routerLink]="['../../menu-categories']"
|
||||
queryParamsHandling="preserve"
|
||||
>
|
||||
<h3 class="item-name">Back</h3>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
*ngFor="let item of list"
|
||||
(click)="addProduct(item)"
|
||||
[class.yellow300]="item.hasHappyHour"
|
||||
[class.grey800]="item.isNotAvailable"
|
||||
>
|
||||
<h3 class="item-name">{{ item.name }}</h3>
|
||||
<mat-card-subtitle class="center">{{ item.price | currency : 'INR' }}</mat-card-subtitle>
|
||||
</mat-card>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
@ -1,19 +1,12 @@
|
||||
<mat-dialog-content>
|
||||
<form [formGroup]="form">
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
>
|
||||
<mat-form-field fxFlex>
|
||||
<div class="flex flex-row justify-around content-start items-start">
|
||||
<mat-form-field class="flex-auto">
|
||||
<mat-label>Quantity</mat-label>
|
||||
<input
|
||||
type="text"
|
||||
matInput
|
||||
#quantity
|
||||
placeholder="Quantity"
|
||||
formControlName="quantity"
|
||||
autocomplete="off"
|
||||
(focus)="quantity.select()"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
import { MathService } from '../../shared/math.service';
|
||||
@ -10,28 +10,29 @@ import { MathService } from '../../shared/math.service';
|
||||
styleUrls: ['./quantity.component.css'],
|
||||
})
|
||||
export class QuantityComponent implements OnInit {
|
||||
form: UntypedFormGroup;
|
||||
form: FormGroup<{
|
||||
quantity: FormControl<string>;
|
||||
}>;
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<QuantityComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: number,
|
||||
private fb: UntypedFormBuilder,
|
||||
private math: MathService,
|
||||
) {
|
||||
// Create form
|
||||
this.form = this.fb.group({
|
||||
quantity: '',
|
||||
this.form = new FormGroup({
|
||||
quantity: new FormControl<string>('', { nonNullable: true }),
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.form.setValue({
|
||||
quantity: this.data,
|
||||
quantity: `${this.data}`,
|
||||
});
|
||||
}
|
||||
|
||||
accept(): void {
|
||||
const quantity = this.math.parseAmount(this.form.value.quantity);
|
||||
const quantity = this.math.parseAmount(this.form.value.quantity ?? '');
|
||||
this.dialogRef.close(quantity);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,13 +6,12 @@
|
||||
<ng-container matColumnDef="reason">
|
||||
<mat-cell *matCellDef="let row" (click)="select(row)">{{ row }}</mat-cell>
|
||||
<mat-footer-cell *matFooterCellDef>
|
||||
<mat-form-field fxFlex>
|
||||
<mat-form-field class="flex-auto">
|
||||
<mat-label>Reason</mat-label>
|
||||
<input
|
||||
type="text"
|
||||
matInput
|
||||
#son
|
||||
placeholder="Reason"
|
||||
formControlName="son"
|
||||
autocomplete="off"
|
||||
(focus)="select(son.value) && son.select()"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<h2 mat-dialog-title>Receive Payment</h2>
|
||||
<mat-dialog-content>
|
||||
<form [formGroup]="form" fxLayout="column">
|
||||
<form [formGroup]="form" class="flex flex-col">
|
||||
<mat-table #table [dataSource]="dataSource" formArrayName="amounts" *ngIf="this.displayTable">
|
||||
<!-- Name Column -->
|
||||
<ng-container matColumnDef="name">
|
||||
@ -13,16 +13,21 @@
|
||||
|
||||
<!-- Discount Column -->
|
||||
<ng-container matColumnDef="amount">
|
||||
<mat-header-cell *matHeaderCellDef class="center bold" fxFlex>{{
|
||||
amount | currency: 'INR'
|
||||
<mat-header-cell *matHeaderCellDef class="center bold" class="flex-auto">{{
|
||||
amount | currency : 'INR'
|
||||
}}</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row; let i = index" class="center" [formGroupName]="i" fxFlex>
|
||||
<mat-cell
|
||||
*matCellDef="let row; let i = index"
|
||||
class="center"
|
||||
[formGroupName]="i"
|
||||
class="flex-auto"
|
||||
>
|
||||
<mat-form-field>
|
||||
<input matInput type="number" formControlName="amount" autocomplete="off" />
|
||||
</mat-form-field>
|
||||
</mat-cell>
|
||||
<mat-footer-cell *matFooterCellDef class="bold">{{
|
||||
balance | currency: 'INR'
|
||||
balance | currency : 'INR'
|
||||
}}</mat-footer-cell>
|
||||
</ng-container>
|
||||
|
||||
@ -30,13 +35,12 @@
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||
<mat-footer-row *matFooterRowDef="displayedColumns"></mat-footer-row>
|
||||
</mat-table>
|
||||
<mat-form-field fxFlex *ngIf="this.displayReason">
|
||||
<mat-form-field class="flex-auto" *ngIf="this.displayReason">
|
||||
<mat-label>Reason</mat-label>
|
||||
<input
|
||||
type="text"
|
||||
matInput
|
||||
#son
|
||||
placeholder="Reason"
|
||||
formControlName="son"
|
||||
autocomplete="off"
|
||||
(focus)="select(son.value) && son.select()"
|
||||
|
||||
@ -1,30 +1,34 @@
|
||||
<mat-card>
|
||||
<mat-card-title-group>
|
||||
<mat-card-header>
|
||||
<mat-card-title>Running Tables</mat-card-title>
|
||||
</mat-card-title-group>
|
||||
<mat-card-content fxLayout="row wrap" fxLayoutGap="grid 20px">
|
||||
<mat-divider></mat-divider>
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
matRipple
|
||||
*ngFor="let table of list"
|
||||
(click)="navigateToBill(table)"
|
||||
[class.running]="table.status === 'running'"
|
||||
[class.printed]="table.status === 'printed'"
|
||||
>
|
||||
<h3 class="item-name">{{ table.name }}</h3>
|
||||
<mat-card-subtitle class="center" [class.bold]="table.bold">{{
|
||||
table.guest
|
||||
}}</mat-card-subtitle>
|
||||
<span class="center"
|
||||
>{{ table.pax || '-' }} / {{ table.seats }} / {{ table.section?.name }}</span
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<div class="flex flex-row flex-wrap -mr-5 -mb-5">
|
||||
<mat-card
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
*ngFor="let table of list"
|
||||
(click)="navigateToBill(table)"
|
||||
[class.running]="table.status === 'running'"
|
||||
[class.printed]="table.status === 'printed'"
|
||||
>
|
||||
<span class="center" *ngIf="table.date">{{ table.date }}</span>
|
||||
<span class="center" *ngIf="table.amount">{{ table.amount | currency: 'INR' }}</span>
|
||||
</mat-card>
|
||||
<mat-card fxLayout="column" class="square-button open-bill" matRipple (click)="openBill()">
|
||||
<h3 class="item-name">Open Bill</h3>
|
||||
</mat-card>
|
||||
<h3 class="item-name">{{ table.name }}</h3>
|
||||
<mat-card-subtitle class="center" [class.bold]="table.bold">{{
|
||||
table.guest
|
||||
}}</mat-card-subtitle>
|
||||
<span class="center"
|
||||
>{{ table.pax || '-' }} / {{ table.seats }} / {{ table.section?.name }}</span
|
||||
>
|
||||
<span class="center" *ngIf="table.date">{{ table.date }}</span>
|
||||
<span class="center" *ngIf="table.amount">{{ table.amount | currency : 'INR' }}</span>
|
||||
</mat-card>
|
||||
<mat-card
|
||||
class="flex flex-col square-button mr-5, mb-5 open-bill"
|
||||
matRipple
|
||||
(click)="openBill()"
|
||||
>
|
||||
<h3 class="item-name">Open Bill</h3>
|
||||
</mat-card>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { MatBadgeModule } from '@angular/material/badge';
|
||||
@ -9,7 +8,8 @@ import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { MatChipsModule } from '@angular/material/chips';
|
||||
import { MatOptionModule, MatRippleModule } from '@angular/material/core';
|
||||
import { MatRippleModule } from '@angular/material/core';
|
||||
import { MatOptionModule } from '@angular/material/core';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
@ -63,7 +63,6 @@ import { TablesDialogComponent } from './tables-dialog/tables-dialog.component';
|
||||
],
|
||||
imports: [
|
||||
CommonModule,
|
||||
FlexLayoutModule,
|
||||
ReactiveFormsModule,
|
||||
MatBadgeModule,
|
||||
MatButtonModule,
|
||||
|
||||
@ -1,18 +1,13 @@
|
||||
<h2 mat-dialog-title>Select Sale Categories</h2>
|
||||
<mat-dialog-content>
|
||||
<form [formGroup]="form" fxLayout="column">
|
||||
<form [formGroup]="form" class="flex flex-col">
|
||||
<div formArrayName="saleCategories">
|
||||
<div
|
||||
fxLayout="row"
|
||||
*ngFor="let sc of list; index as i"
|
||||
[formGroupName]="i"
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="space-around start"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
class="flex flex-row justify-around content-start items-start"
|
||||
>
|
||||
<mat-checkbox formControlName="saleCategory" fxFlex>{{ sc.name }}</mat-checkbox>
|
||||
<mat-checkbox formControlName="saleCategory" class="flex-auto">{{ sc.name }}</mat-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
<h2 mat-dialog-title>Tables</h2>
|
||||
<mat-dialog-content fxLayout="row wrap" fxLayoutGap="grid 20px">
|
||||
<mat-dialog-content class="flex flex-row flex-wrap -mr-5 -mb-5">
|
||||
<mat-card
|
||||
fxLayout="column"
|
||||
class="square-button"
|
||||
class="flex flex-col square-button mr-5, mb-5"
|
||||
matRipple
|
||||
*ngFor="let table of list"
|
||||
(click)="select(table)"
|
||||
@ -14,7 +13,7 @@
|
||||
<mat-card-subtitle class="center">{{ table.guest }}</mat-card-subtitle>
|
||||
<span class="center">{{ table.pax || 0 }} / {{ table.seats }} Seats</span>
|
||||
<span class="center" *ngIf="table.date">{{ table.date }}</span>
|
||||
<span class="center" *ngIf="table.amount">{{ table.amount | currency: 'INR' }}</span>
|
||||
<span class="center" *ngIf="table.amount">{{ table.amount | currency : 'INR' }}</span>
|
||||
</mat-card>
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions align="end">
|
||||
|
||||
Reference in New Issue
Block a user