From 88a157274789e7e56da2f84c0b4ee919db82f814 Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Fri, 11 Jul 2025 11:30:35 +0000 Subject: [PATCH] Chore: Removed Mat Card from everywhere. Chore: Removed the Toaster Service. Chore: Updated to Material Theme 3 --- bookie/angular.json | 2 +- bookie/src/app/auth/auth-guard.service.ts | 4 +- .../src/app/auth/login/login.component.html | 52 ++- bookie/src/app/auth/login/login.component.ts | 18 +- .../beer-sale-report.component.html | 121 ++++--- .../beer-sale-report.component.ts | 3 +- .../bill-settlement-report.component.html | 125 ++++--- .../bill-settlement-report.component.ts | 3 +- .../cashier-report.component.html | 139 ++++---- .../cashier-report.component.ts | 11 +- bookie/src/app/core/auth.interceptor.ts | 4 +- bookie/src/app/core/toaster.service.ts | 15 - .../customer-detail.component.html | 84 +++-- .../customer-detail.component.ts | 15 +- .../customer-list.component.html | 134 ++++---- .../customer-list/customer-list.component.ts | 3 +- .../device-detail.component.html | 73 ++-- .../device-detail/device-detail.component.ts | 16 +- .../device-list/device-list.component.html | 86 +++-- .../device-list/device-list.component.ts | 3 +- .../discount-report.component.html | 113 +++--- .../discount-report.component.ts | 11 +- .../guest-book-detail.component.html | 143 ++++---- .../guest-book-detail.component.ts | 16 +- .../guest-book-list.component.html | 173 +++++----- .../guest-book-list.component.sass | 15 - .../guest-book-list.component.ts | 7 +- .../header-footer.component.html | 51 ++- .../header-footer/header-footer.component.ts | 11 +- bookie/src/app/home/home.component.html | 16 +- bookie/src/app/home/home.component.ts | 2 +- .../menu-category-detail.component.html | 43 ++- .../menu-category-detail.component.ts | 15 +- .../menu-category-list.component.html | 76 ++--- .../menu-category-list.component.ts | 11 +- .../menu-engineering-report.component.html | 205 ++++++----- .../menu-engineering-report.component.ts | 11 +- .../modifier-category-detail.component.html | 133 ++++---- .../modifier-category-detail.component.ts | 15 +- .../modifier-category-list.component.html | 118 +++---- .../modifier-category-list.component.ts | 3 +- .../modifier-detail.component.html | 85 +++-- .../modifier-detail.component.ts | 16 +- .../modifier-list.component.html | 142 ++++---- .../modifier-list/modifier-list.component.ts | 3 +- .../printer-detail.component.html | 57 ++-- .../printer-detail.component.ts | 15 +- .../printer-list/printer-list.component.html | 62 ++-- .../printer-list/printer-list.component.ts | 3 +- .../product-sale-report.component.html | 175 +++++----- .../product-sale-report.component.ts | 11 +- .../product-updates-report.component.html | 95 +++--- .../product-updates-report.component.ts | 3 +- .../product-detail.component.html | 116 +++---- .../product-detail.component.ts | 15 +- .../product-list/product-list.component.html | 194 +++++------ .../product-list/product-list.component.ts | 11 +- .../regime-detail.component.html | 61 ++-- .../regime-detail/regime-detail.component.ts | 15 +- .../regime-list/regime-list.component.html | 72 ++-- .../regime-list/regime-list.component.ts | 3 +- .../role-detail/role-detail.component.html | 47 ++- .../role-detail/role-detail.component.ts | 24 +- .../roles/role-list/role-list.component.html | 64 ++-- .../roles/role-list/role-list.component.ts | 3 +- .../sale-category-detail.component.html | 126 ++++--- .../sale-category-detail.component.ts | 17 +- .../sale-category-list.component.html | 62 ++-- .../sale-category-list.component.ts | 7 +- .../sale-report/sale-report.component.html | 135 ++++---- .../app/sale-report/sale-report.component.ts | 11 +- .../sales/bill-type/bill-type.component.ts | 2 +- bookie/src/app/sales/bill.service.ts | 6 +- .../src/app/sales/bills/bills.component.html | 323 +++++++++--------- bookie/src/app/sales/bills/bills.component.ts | 11 +- .../app/sales/home/sales-home.component.html | 156 +++++---- .../app/sales/home/sales-home.component.ts | 30 +- .../menu-categories.component.html | 39 +-- .../menu-categories.component.ts | 2 +- .../sales/products/products.component.html | 50 ++- .../app/sales/products/products.component.ts | 2 +- .../running-tables.component.html | 57 ++-- .../running-tables.component.ts | 8 +- .../tables-dialog/tables-dialog.component.ts | 2 +- .../section-printer.component.html | 117 +++---- .../section-printer.component.ts | 15 +- .../section-detail.component.html | 37 +- .../section-detail.component.ts | 15 +- .../section-list/section-list.component.html | 42 +-- .../section-list/section-list.component.ts | 3 +- bookie/src/app/settings/settings.component.ts | 11 +- .../settle-option-detail.component.html | 83 +++-- .../settle-option-detail.component.ts | 15 +- .../settle-option-list.component.html | 82 +++-- .../settle-option-list.component.ts | 7 +- .../table-detail/table-detail.component.html | 79 ++--- .../table-detail/table-detail.component.ts | 15 +- .../table-list/table-list.component.html | 87 +++-- ...omponent.css => table-list.component.sass} | 0 .../tables/table-list/table-list.component.ts | 14 +- .../app/tax-report/tax-report.component.html | 125 ++++--- .../app/tax-report/tax-report.component.ts | 3 +- .../tax-detail/tax-detail.component.html | 77 ++--- .../taxes/tax-detail/tax-detail.component.ts | 23 +- .../taxes/tax-list/tax-list.component.html | 72 ++-- .../app/taxes/tax-list/tax-list.component.ts | 3 +- .../temporal-product-detail.component.html | 153 ++++----- .../temporal-product-detail.component.ts | 16 +- .../temporal-product-list.component.html | 194 ++++++----- .../temporal-product-list.component.ts | 3 +- .../update-product-prices.component.html | 118 ++++--- .../update-product-prices.component.ts | 11 +- .../user-detail/user-detail.component.html | 67 ++-- .../user-detail/user-detail.component.ts | 15 +- .../users/user-list/user-list.component.html | 88 +++-- .../users/user-list/user-list.component.ts | 3 +- bookie/src/styles.sass | 101 ++++-- 117 files changed, 2895 insertions(+), 3236 deletions(-) delete mode 100644 bookie/src/app/core/toaster.service.ts rename bookie/src/app/tables/table-list/{table-list.component.css => table-list.component.sass} (100%) diff --git a/bookie/angular.json b/bookie/angular.json index 59d1bd2..16706c3 100644 --- a/bookie/angular.json +++ b/bookie/angular.json @@ -27,7 +27,7 @@ "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "sass", "assets": ["src/favicon.ico", "src/assets"], - "styles": ["@angular/material/prebuilt-themes/azure-blue.css", "src/styles.sass"], + "styles": ["src/styles.sass"], "scripts": [], "browser": "src/main.ts" }, diff --git a/bookie/src/app/auth/auth-guard.service.ts b/bookie/src/app/auth/auth-guard.service.ts index 9231e11..a3569db 100644 --- a/bookie/src/app/auth/auth-guard.service.ts +++ b/bookie/src/app/auth/auth-guard.service.ts @@ -1,7 +1,7 @@ import { inject } from '@angular/core'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { CanActivateFn, Router } from '@angular/router'; -import { ToasterService } from '../core/toaster.service'; import { AuthService } from './auth.service'; export const authGuard: CanActivateFn = (route, state) => { @@ -16,7 +16,7 @@ export const authGuard: CanActivateFn = (route, state) => { return false; } if (permission !== undefined && user.perms.indexOf(permission) === -1) { - inject(ToasterService).show('Danger', 'You do not have the permission to access this area.'); + inject(MatSnackBar).open('You do not have the permission to access this area.', 'Danger'); return false; } // logged in so return true diff --git a/bookie/src/app/auth/login/login.component.html b/bookie/src/app/auth/login/login.component.html index 50c00c5..7aa39ae 100644 --- a/bookie/src/app/auth/login/login.component.html +++ b/bookie/src/app/auth/login/login.component.html @@ -1,29 +1,23 @@ - - - Login - - -
-
- - Username - - -
-
- - Password - - {{ hide ? 'visibility' : 'visibility_off' }} - -
- - @if (unregisteredDevice) { -

Sorry, device {{ deviceName }} is not enabled.

- } -
-
- - - -
+

Login

+
+
+ + Username + + +
+
+ + Password + + {{ hide ? 'visibility' : 'visibility_off' }} + +
+ + @if (unregisteredDevice) { +

Sorry, device {{ deviceName }} is not enabled.

+ } +
+
+ +
diff --git a/bookie/src/app/auth/login/login.component.ts b/bookie/src/app/auth/login/login.component.ts index 593fc2b..16d85a5 100644 --- a/bookie/src/app/auth/login/login.component.ts +++ b/bookie/src/app/auth/login/login.component.ts @@ -1,14 +1,13 @@ import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatDividerModule } from '@angular/material/divider'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; -import { ToasterService } from '../../core/toaster.service'; import { CookieService } from '../../shared/cookie.service'; import { AuthService } from '../auth.service'; @@ -16,21 +15,13 @@ import { AuthService } from '../auth.service'; selector: 'app-login', templateUrl: './login.component.html', styleUrls: ['./login.component.css'], - imports: [ - MatButtonModule, - MatCardModule, - MatDividerModule, - MatFormFieldModule, - MatIconModule, - MatInputModule, - ReactiveFormsModule, - ], + imports: [MatButtonModule, MatDividerModule, MatFormFieldModule, MatIconModule, MatInputModule, ReactiveFormsModule], }) export class LoginComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private auth = inject(AuthService); private router = inject(Router); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private cs = inject(CookieService); private cd = inject(ChangeDetectorRef); @@ -82,10 +73,9 @@ export class LoginComponent implements OnInit, AfterViewInit { if (error.status === 401 && error.error.detail === 'Device is not registered') { this.unregisteredDevice = true; this.deviceName = this.cs.getCookie('device'); - console.log(this.deviceName, this.unregisteredDevice); this.cd.detectChanges(); } - this.toaster.show('Error', error.error.detail); + this.snackBar.open(error.error.detail, 'Error'); }, }); } diff --git a/bookie/src/app/beer-sale-report/beer-sale-report.component.html b/bookie/src/app/beer-sale-report/beer-sale-report.component.html index c2abb7f..2bbf9cb 100644 --- a/bookie/src/app/beer-sale-report/beer-sale-report.component.html +++ b/bookie/src/app/beer-sale-report/beer-sale-report.component.html @@ -1,65 +1,60 @@ - - - - Beer Sale Report - - - - -
-
- - Start Date - - - - - - Finish Date - - - - - -
-
- Regular - Happy Hour - Staff Consumption - No Charge -
-
- - - - Time - {{ row.date }} - +

+ Beer Sale Report + +

- - @for (col of info.headers; track col) { - - {{ col }} - {{ row[col] }} - - } +
+
+ + Start Date + + + + + + Finish Date + + + + + +
+
+ Regular + Happy Hour + Staff Consumption + No Charge +
+
+ + + + Time + {{ row.date }} + - - - -
-
+ + @for (col of info.headers; track col) { + + {{ col }} + {{ row[col] }} + + } + + + + diff --git a/bookie/src/app/beer-sale-report/beer-sale-report.component.ts b/bookie/src/app/beer-sale-report/beer-sale-report.component.ts index ba7b019..1ea0235 100644 --- a/bookie/src/app/beer-sale-report/beer-sale-report.component.ts +++ b/bookie/src/app/beer-sale-report/beer-sale-report.component.ts @@ -1,7 +1,6 @@ import { Component, OnInit, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatFormFieldModule } from '@angular/material/form-field'; @@ -22,7 +21,7 @@ import { BeerSaleReportDataSource } from './beer-sale-report-datasource'; styleUrls: ['./beer-sale-report.component.css'], imports: [ MatButtonModule, - MatCardModule, + MatCheckboxModule, MatDatepickerModule, MatFormFieldModule, diff --git a/bookie/src/app/bill-settlement-report/bill-settlement-report.component.html b/bookie/src/app/bill-settlement-report/bill-settlement-report.component.html index 4917ec0..fead5c9 100644 --- a/bookie/src/app/bill-settlement-report/bill-settlement-report.component.html +++ b/bookie/src/app/bill-settlement-report/bill-settlement-report.component.html @@ -1,69 +1,64 @@ - - - - Bill Settlement Report - - - - -
-
- - Start Date - - - - - - Finish Date - - - - - -
-
- - - - Time - {{ row.date | localTime }} - +

+ Bill Settlement Report + +

- - - Bill ID - {{ row.billId }} - +
+
+ + Start Date + + + + + + Finish Date + + + + + +
+
+ + + + Time + {{ row.date | localTime }} + - - - Amount - {{ row.amount | number: '1.2-2' }} - + + + Bill ID + {{ row.billId }} + - - - Settlement - {{ row.settlement }} - + + + Amount + {{ row.amount | number: '1.2-2' }} + - - - -
-
+ + + Settlement + {{ row.settlement }} + + + + + diff --git a/bookie/src/app/bill-settlement-report/bill-settlement-report.component.ts b/bookie/src/app/bill-settlement-report/bill-settlement-report.component.ts index ebbada4..b000a7f 100644 --- a/bookie/src/app/bill-settlement-report/bill-settlement-report.component.ts +++ b/bookie/src/app/bill-settlement-report/bill-settlement-report.component.ts @@ -2,7 +2,6 @@ import { DecimalPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; @@ -24,7 +23,7 @@ import { BillSettlementReportDataSource } from './bill-settlement-report-datasou DecimalPipe, LocalTimePipe, MatButtonModule, - MatCardModule, + MatDatepickerModule, MatFormFieldModule, MatIconModule, diff --git a/bookie/src/app/cashier-report/cashier-report.component.html b/bookie/src/app/cashier-report/cashier-report.component.html index 3183157..84d7288 100644 --- a/bookie/src/app/cashier-report/cashier-report.component.html +++ b/bookie/src/app/cashier-report/cashier-report.component.html @@ -1,73 +1,68 @@ - - - - Cashier Report - - - - - - -
-
- - Start Date - - - - - - Finish Date - - - - -
-
- - Cashier - - -- Cashier -- - @for (ac of activeCashiers; track ac) { - - {{ ac.name }} - - } - - - -
-
- - - - Name - {{ row.name }} - +

+ Cashier Report + + + +

- - - Amount - {{ row.amount | currency: 'INR' }} - - - -
-
-
+
+
+ + Start Date + + + + + + Finish Date + + + + +
+
+ + Cashier + + -- Cashier -- + @for (ac of activeCashiers; track ac) { + + {{ ac.name }} + + } + + + +
+
+ + + + Name + {{ row.name }} + + + + + Amount + {{ row.amount | currency: 'INR' }} + + + + diff --git a/bookie/src/app/cashier-report/cashier-report.component.ts b/bookie/src/app/cashier-report/cashier-report.component.ts index c48eefc..d48e7a3 100644 --- a/bookie/src/app/cashier-report/cashier-report.component.ts +++ b/bookie/src/app/cashier-report/cashier-report.component.ts @@ -2,18 +2,17 @@ import { CurrencyPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatOptionModule } from '@angular/material/core'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router } from '@angular/router'; import moment from 'moment'; -import { ToasterService } from '../core/toaster.service'; import { User } from '../core/user'; import { ToCsvService } from '../shared/to-csv.service'; import { CashierReport } from './cashier-report'; @@ -27,7 +26,7 @@ import { CashierReportService } from './cashier-report.service'; imports: [ CurrencyPipe, MatButtonModule, - MatCardModule, + MatDatepickerModule, MatFormFieldModule, MatIconModule, @@ -42,7 +41,7 @@ export class CashierReportComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); private toCsv = inject(ToCsvService); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(CashierReportService); activeCashiers: User[] = []; @@ -97,10 +96,10 @@ export class CashierReportComponent implements OnInit { print() { this.ser.print(this.info.cashier.id as string, this.info.startDate, this.info.finishDate).subscribe({ next: () => { - this.toaster.show('', 'Successfully Printed'); + this.snackBar.open('Successfully Printed', ''); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/core/auth.interceptor.ts b/bookie/src/app/core/auth.interceptor.ts index 1b7d2bd..c3cba7a 100644 --- a/bookie/src/app/core/auth.interceptor.ts +++ b/bookie/src/app/core/auth.interceptor.ts @@ -1,13 +1,13 @@ import { HttpInterceptorFn } from '@angular/common/http'; import { inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { Router } from '@angular/router'; import { throwError } from 'rxjs'; import { catchError } from 'rxjs/operators'; import { AuthService } from '../auth/auth.service'; import { ConfirmDialogComponent } from '../shared/confirm-dialog/confirm-dialog.component'; -import { ToasterService } from './toaster.service'; export const authInterceptor: HttpInterceptorFn = (req, next) => { return next(req).pipe( @@ -30,7 +30,7 @@ export const authInterceptor: HttpInterceptorFn = (req, next) => { } // auto logout if 401 response returned from api inject(AuthService).logout(); - inject(ToasterService).show('Danger', 'User has been logged out'); + inject(MatSnackBar).open('User has been logged out', 'Danger'); const dialogRef = inject(MatDialog).open(ConfirmDialogComponent, { width: '250px', data: { diff --git a/bookie/src/app/core/toaster.service.ts b/bookie/src/app/core/toaster.service.ts deleted file mode 100644 index a93d12c..0000000 --- a/bookie/src/app/core/toaster.service.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Injectable, inject } from '@angular/core'; -import { MatSnackBar } from '@angular/material/snack-bar'; - -@Injectable({ - providedIn: 'root', -}) -export class ToasterService { - private snackBar = inject(MatSnackBar); - - show(type: string, msg: string) { - this.snackBar.open(msg, type, { - duration: 3000, - }); - } -} diff --git a/bookie/src/app/customers/customer-detail/customer-detail.component.html b/bookie/src/app/customers/customer-detail/customer-detail.component.html index 1384cb2..923de99 100644 --- a/bookie/src/app/customers/customer-detail/customer-detail.component.html +++ b/bookie/src/app/customers/customer-detail/customer-detail.component.html @@ -1,45 +1,39 @@ - - - Customer - - -
-
- - Name - - -
-
- - Phone - - -
-
- - Address - - -
-
- Print in Bill? -
- -
- @for (r of item.discounts; track r; let i = $index) { - - Discount on {{ r.name }} - - % - Max {{ r.limit | percent: '1.2-2' }} - - } -
-
-
- - - - -
+

Customer

+
+
+ + Name + + +
+
+ + Phone + + +
+
+ + Address + + +
+
+ Print in Bill? +
+ +
+ @for (r of item.discounts; track r; let i = $index) { + + Discount on {{ r.name }} + + % + Max {{ r.limit | percent: '1.2-2' }} + + } +
+
+
+ + +
diff --git a/bookie/src/app/customers/customer-detail/customer-detail.component.ts b/bookie/src/app/customers/customer-detail/customer-detail.component.ts index d75b8b1..b658da9 100644 --- a/bookie/src/app/customers/customer-detail/customer-detail.component.ts +++ b/bookie/src/app/customers/customer-detail/customer-detail.component.ts @@ -2,17 +2,16 @@ import { PercentPipe } from '@angular/common'; import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormArray, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatDialog } from '@angular/material/dialog'; import { MatDividerModule } from '@angular/material/divider'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { round } from 'mathjs'; import { Customer } from '../../core/customer'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { CustomerService } from '../customer.service'; @@ -22,7 +21,7 @@ import { CustomerService } from '../customer.service'; styleUrls: ['./customer-detail.component.sass'], imports: [ MatButtonModule, - MatCardModule, + MatCheckboxModule, MatDividerModule, MatFormFieldModule, @@ -34,7 +33,7 @@ import { CustomerService } from '../customer.service'; export class CustomerDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private dialog = inject(MatDialog); private ser = inject(CustomerService); @@ -100,11 +99,11 @@ export class CustomerDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/customers'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -112,11 +111,11 @@ export class CustomerDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/customers'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/customers/customer-list/customer-list.component.html b/bookie/src/app/customers/customer-list/customer-list.component.html index 66e7b16..75573cb 100644 --- a/bookie/src/app/customers/customer-list/customer-list.component.html +++ b/bookie/src/app/customers/customer-list/customer-list.component.html @@ -1,71 +1,65 @@ - - - - Customers - - add_box - Add - - - - -
-
- - Filter - - -
-
- - - - Name - {{ row.name }} - - - - - Phone - {{ row.phone }} - - - - - Address - {{ row.address }} - - - - - Print in Bill - {{ row.printInBill }} - - - - - Discounts - -
    - @for (discount of row.discounts; track discount) { -
  • {{ discount.name }} - {{ discount.discount | percent: '1.2-2' }}
  • - } -
-
-
- - - -
- + Customers + + add_box + Add + + +
+
+ + Filter + + +
+
+ + + + Name + {{ row.name }} -
-
-
+ + + + + Phone + {{ row.phone }} + + + + + Address + {{ row.address }} + + + + + Print in Bill + {{ row.printInBill }} + + + + + Discounts + +
    + @for (discount of row.discounts; track discount) { +
  • {{ discount.name }} - {{ discount.discount | percent: '1.2-2' }}
  • + } +
+
+
+ + + + + + diff --git a/bookie/src/app/customers/customer-list/customer-list.component.ts b/bookie/src/app/customers/customer-list/customer-list.component.ts index 2dda4e7..28c1354 100644 --- a/bookie/src/app/customers/customer-list/customer-list.component.ts +++ b/bookie/src/app/customers/customer-list/customer-list.component.ts @@ -2,7 +2,6 @@ import { PercentPipe } from '@angular/common'; import { ChangeDetectorRef, Component, ElementRef, OnInit, ViewChild, inject, AfterViewInit } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator'; @@ -21,7 +20,7 @@ import { CustomerListDatasource } from './customer-list-datasource'; styleUrls: ['./customer-list.component.css'], imports: [ MatButtonModule, - MatCardModule, + MatIconModule, MatTableModule, PercentPipe, diff --git a/bookie/src/app/devices/device-detail/device-detail.component.html b/bookie/src/app/devices/device-detail/device-detail.component.html index bc5cacd..cde5da3 100644 --- a/bookie/src/app/devices/device-detail/device-detail.component.html +++ b/bookie/src/app/devices/device-detail/device-detail.component.html @@ -1,39 +1,34 @@ - - - Device - - -
-
- - Name - - -
-
- - Section - - @for (s of sections; track s) { - - {{ s.name }} - - } - - -
-
- Enabled? -
-
-
- - - @if (!!item.id) { - - } - - - Created on {{ item.creationDate | localTime }} - -
+

Device

+
+
+ + Name + + +
+
+ + Section + + @for (s of sections; track s) { + + {{ s.name }} + + } + + +
+
+ Enabled? +
+
+
+ + @if (!!item.id) { + + } +
+ Created on {{ item.creationDate | localTime }} +
diff --git a/bookie/src/app/devices/device-detail/device-detail.component.ts b/bookie/src/app/devices/device-detail/device-detail.component.ts index 766a28d..bf4aaba 100644 --- a/bookie/src/app/devices/device-detail/device-detail.component.ts +++ b/bookie/src/app/devices/device-detail/device-detail.component.ts @@ -1,18 +1,17 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatOptionModule } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { Device } from '../../core/device'; import { Section } from '../../core/section'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { LocalTimePipe } from '../../shared/local-time.pipe'; import { DeviceService } from '../device.service'; @@ -24,10 +23,11 @@ import { DeviceService } from '../device.service'; imports: [ LocalTimePipe, MatButtonModule, - MatCardModule, + MatCheckboxModule, MatFormFieldModule, MatInputModule, + MatOptionModule, MatSelectModule, ReactiveFormsModule, @@ -37,7 +37,7 @@ export class DeviceDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(DeviceService); @ViewChild('nameElement', { static: true }) nameElement?: ElementRef; @@ -87,11 +87,11 @@ export class DeviceDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/devices'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -99,11 +99,11 @@ export class DeviceDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/devices'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/devices/device-list/device-list.component.html b/bookie/src/app/devices/device-list/device-list.component.html index 88b9bc3..2455214 100644 --- a/bookie/src/app/devices/device-list/device-list.component.html +++ b/bookie/src/app/devices/device-list/device-list.component.html @@ -1,51 +1,45 @@ - - - - Devices - - add_box - Add - - - - - - - - Name - {{ row.name }} - +

+ Devices + + add_box + Add + +

+ + + + Name + {{ row.name }} + - - - Section - {{ row.section.name }} - + + + Section + {{ row.section.name }} + - - - Enabled - {{ row.enabled }} - + + + Enabled + {{ row.enabled }} + - - - Created - {{ row.creationDate | localTime }} - + + + Created + {{ row.creationDate | localTime }} + - - - Last Login - {{ row.lastUser }} @ {{ row.lastDate ? (row.lastDate | localTime) : 'Never' }} - + + + Last Login + {{ row.lastUser }} @ {{ row.lastDate ? (row.lastDate | localTime) : 'Never' }} + - - - -
-
+ + + diff --git a/bookie/src/app/devices/device-list/device-list.component.ts b/bookie/src/app/devices/device-list/device-list.component.ts index 3881a41..5dd73f8 100644 --- a/bookie/src/app/devices/device-list/device-list.component.ts +++ b/bookie/src/app/devices/device-list/device-list.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, RouterLink } from '@angular/router'; @@ -13,7 +12,7 @@ import { DeviceListDataSource } from './device-list-datasource'; selector: 'app-device-list', templateUrl: './device-list.component.html', styleUrls: ['./device-list.component.css'], - imports: [LocalTimePipe, MatButtonModule, MatCardModule, MatIconModule, MatTableModule, RouterLink], + imports: [LocalTimePipe, MatButtonModule, MatIconModule, MatTableModule, RouterLink], }) export class DeviceListComponent implements OnInit { private route = inject(ActivatedRoute); diff --git a/bookie/src/app/discount-report/discount-report.component.html b/bookie/src/app/discount-report/discount-report.component.html index 55ec460..a7b757a 100644 --- a/bookie/src/app/discount-report/discount-report.component.html +++ b/bookie/src/app/discount-report/discount-report.component.html @@ -1,60 +1,55 @@ - - - - Discount Report - - - - - - -
-
- - Start Date - - - - - - Finish Date - - - - - -
-
- - - - Name - {{ row.name }} - +

+ Discount Report + + + +

- - - Amount - {{ row.amount | currency: 'INR' }} - - - -
-
-
+
+
+ + Start Date + + + + + + Finish Date + + + + + +
+
+ + + + Name + {{ row.name }} + + + + + Amount + {{ row.amount | currency: 'INR' }} + + + + diff --git a/bookie/src/app/discount-report/discount-report.component.ts b/bookie/src/app/discount-report/discount-report.component.ts index 6879d26..2828ab3 100644 --- a/bookie/src/app/discount-report/discount-report.component.ts +++ b/bookie/src/app/discount-report/discount-report.component.ts @@ -2,16 +2,15 @@ import { CurrencyPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router } from '@angular/router'; import moment from 'moment'; -import { ToasterService } from '../core/toaster.service'; import { ToCsvService } from '../shared/to-csv.service'; import { DiscountReport } from './discount-report'; import { DiscountReportDataSource } from './discount-report-datasource'; @@ -24,7 +23,7 @@ import { DiscountReportService } from './discount-report.service'; imports: [ CurrencyPipe, MatButtonModule, - MatCardModule, + MatDatepickerModule, MatFormFieldModule, MatIconModule, @@ -37,7 +36,7 @@ export class DiscountReportComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); private toCsv = inject(ToCsvService); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(DiscountReportService); info: DiscountReport = new DiscountReport(); @@ -92,10 +91,10 @@ export class DiscountReportComponent implements OnInit { print() { this.ser.print(this.info.startDate, this.info.finishDate).subscribe({ next: () => { - this.toaster.show('', 'Successfully Printed'); + this.snackBar.open('Successfully Printed', ''); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.html b/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.html index 868bde3..c936cf1 100644 --- a/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.html +++ b/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.html @@ -1,74 +1,69 @@ - - - Guest Details - - -
-
- - Name - - @if (form.controls['name'].hasError('required')) { - Name is required - } - -
-
- - Phone - - - - @for (customer of customers | async; track customer) { - {{ customer.name }} - {{ customer.phone }} - } - -
-
- - Pax - - -
-
- - Address - - -
-
- - Notes - - -
-
- - Date - - - - - - Hours - - - - Minutes - - -
-
-
- - - @if (!!item.id) { - - } - -
+

Guest Details

+
+
+ + Name + + @if (form.controls['name'].hasError('required')) { + Name is required + } + +
+
+ + Phone + + + + @for (customer of customers | async; track customer) { + {{ customer.name }} - {{ customer.phone }} + } + +
+
+ + Pax + + +
+
+ + Address + + +
+
+ + Notes + + +
+
+ + Date + + + + + + Hours + + + + Minutes + + +
+
+ +
+ + @if (!!item.id) { + + } +
diff --git a/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.ts b/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.ts index f17bece..4c882ed 100644 --- a/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.ts +++ b/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.ts @@ -3,19 +3,18 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from import { FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { MatAutocompleteSelectedEvent, MatAutocompleteModule } from '@angular/material/autocomplete'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatOptionModule } from '@angular/material/core'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import moment from 'moment'; import { Observable, of as observableOf } from 'rxjs'; import { debounceTime, distinctUntilChanged, map, startWith, switchMap } from 'rxjs/operators'; import { Customer } from '../../core/customer'; -import { ToasterService } from '../../core/toaster.service'; import { CustomerService } from '../../customers/customer.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { GuestBook } from '../guest-book'; @@ -29,9 +28,10 @@ import { GuestBookService } from '../guest-book.service'; AsyncPipe, MatAutocompleteModule, MatButtonModule, - MatCardModule, + MatDatepickerModule, MatFormFieldModule, + MatInputModule, MatOptionModule, ReactiveFormsModule, @@ -41,7 +41,7 @@ export class GuestBookDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(GuestBookService); private customerService = inject(CustomerService); @@ -124,11 +124,11 @@ export class GuestBookDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/guest-book'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -162,11 +162,11 @@ export class GuestBookDetailComponent implements OnInit, AfterViewInit { delete(id: string) { this.ser.delete(id).subscribe({ complete: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/guest-book'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.html b/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.html index 7d069c3..20952f7 100644 --- a/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.html +++ b/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.html @@ -1,83 +1,78 @@ - - - - Guest List - - add_box - Table Booking - - - add_box - Walk-in - - - - -
-
- - Date - - - - -
-
- - - - S. No / Total - {{ row.serial }} / {{ row.count }} - +

+ Guest List + + add_box + Table Booking + + + add_box + Walk-in + +

- - - Name - {{ row.name }} +
+ + Date + + + + +
+ + + + + S. No / Total + {{ row.serial }} / {{ row.count }} + + + + + Name + {{ row.name }} + + + + + Phone + {{ row.phone }} + + + + + Pax + {{ row.pax }} + + + + + Time + {{ row.bookingDate | localTime }} // {{ row.arrivalDate | localTime }} + + + + + Action + + @if (row.status === 'old' || (!row.tableId && !row.voucherId)) { + + } + @if (row.tableId) { + - } - @if (row.tableId) { - - } - - - + +
- - -
-
-
+ + + diff --git a/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.sass b/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.sass index 8af4334..997dcfd 100644 --- a/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.sass +++ b/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.sass @@ -1,8 +1,3 @@ -@use '@angular/material' as mat - -$my-primary: mat.m2-define-palette(mat.$m2-indigo-palette, 500) -$my-accent: mat.m2-define-palette(mat.$m2-amber-palette, A200, A100, A400) - table width: 100% @@ -10,16 +5,6 @@ table display: flex justify-content: center -.accent - /* Read the 200 hue from the primary color palete.*/ - color: mat.m2-get-color-from-palette($my-accent, '200-contrast') - background: mat.m2-get-color-from-palette($my-accent, 200) - -.strong-accent - /* Read the 700 hue from the primary color palete.*/ - color: mat.m2-get-color-from-palette($my-accent, '700-contrast') - background: mat.m2-get-color-from-palette($my-accent, 700) - .grey300 background-color: #ede7f6 color: #000000 diff --git a/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.ts b/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.ts index 1a3a746..cd68605 100644 --- a/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.ts +++ b/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.ts @@ -1,18 +1,17 @@ import { Component, OnInit, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import moment from 'moment'; import { BehaviorSubject } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ToasterService } from '../../core/toaster.service'; import { LocalTimePipe } from '../../shared/local-time.pipe'; import { GuestBook } from '../guest-book'; import { GuestBookList } from '../guest-book-list'; @@ -27,7 +26,7 @@ import { GuestBookListDataSource } from './guest-book-list-datasource'; LocalTimePipe, MatButtonModule, MatButtonModule, - MatCardModule, + MatDatepickerModule, MatFormFieldModule, MatIconModule, @@ -40,7 +39,7 @@ import { GuestBookListDataSource } from './guest-book-list-datasource'; export class GuestBookListComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(GuestBookService); data: BehaviorSubject = new BehaviorSubject([]); diff --git a/bookie/src/app/header-footer/header-footer.component.html b/bookie/src/app/header-footer/header-footer.component.html index faca983..c8cad35 100644 --- a/bookie/src/app/header-footer/header-footer.component.html +++ b/bookie/src/app/header-footer/header-footer.component.html @@ -1,30 +1,23 @@ - - - Header / Footer - - -
-
- - Header / Footer - - @for (s of list; track s) { - - {{ s.name }} - - } - - -
- - Text - - + +
+ + Header / Footer + + @for (s of list; track s) { + + {{ s.name }} + + } + + +
+ + Text + + - -
-
- - - -
+ + +
+ +
diff --git a/bookie/src/app/header-footer/header-footer.component.ts b/bookie/src/app/header-footer/header-footer.component.ts index c80f2a8..aed906c 100644 --- a/bookie/src/app/header-footer/header-footer.component.ts +++ b/bookie/src/app/header-footer/header-footer.component.ts @@ -1,17 +1,16 @@ import { Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatOptionModule } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; import { MatDividerModule } from '@angular/material/divider'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectChange, MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { map } from 'rxjs/operators'; -import { ToasterService } from '../core/toaster.service'; import { HeaderFooter } from './header-footer'; import { HeaderFooterService } from './header-footer.service'; @@ -21,7 +20,7 @@ import { HeaderFooterService } from './header-footer.service'; styleUrls: ['./header-footer.component.css'], imports: [ MatButtonModule, - MatCardModule, + MatDividerModule, MatFormFieldModule, MatInputModule, @@ -33,7 +32,7 @@ import { HeaderFooterService } from './header-footer.service'; export class HeaderFooterComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private dialog = inject(MatDialog); private ser = inject(HeaderFooterService); @@ -79,11 +78,11 @@ export class HeaderFooterComponent implements OnInit { save() { this.ser.save(this.getItem()).subscribe({ next: (result: HeaderFooter[]) => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.showItem(result); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/home/home.component.html b/bookie/src/app/home/home.component.html index df0124c..1bf674d 100644 --- a/bookie/src/app/home/home.component.html +++ b/bookie/src/app/home/home.component.html @@ -1,5 +1,7 @@
-

Sales

+ @if (auth.allowed('customers') || auth.allowed('sales')) { +

Sales

+ } @if (auth.allowed('customers')) {

Guest Book

@@ -15,7 +17,17 @@

Customers

} -

Reports

+ @if ( + auth.allowed('cashier-report') || + auth.allowed('sale-report') || + auth.allowed('tax-report') || + auth.allowed('product-sale-report') || + auth.allowed('bill-settlement-report') || + auth.allowed('beer-sale-report') || + auth.allowed('discount-report') + ) { +

Reports

+ } @if (auth.allowed('cashier-report')) {

Cashier Report

diff --git a/bookie/src/app/home/home.component.ts b/bookie/src/app/home/home.component.ts index 61d3106..31ba726 100644 --- a/bookie/src/app/home/home.component.ts +++ b/bookie/src/app/home/home.component.ts @@ -9,7 +9,7 @@ import { AuthService } from '../auth/auth.service'; selector: 'app-home', templateUrl: './home.component.html', styleUrls: ['./home.component.sass'], - imports: [MatCardModule, RouterLink], + imports: [RouterLink, MatCardModule], }) export class HomeComponent { auth = inject(AuthService); diff --git a/bookie/src/app/menu-category/menu-category-detail/menu-category-detail.component.html b/bookie/src/app/menu-category/menu-category-detail/menu-category-detail.component.html index 00b080f..835d2ed 100644 --- a/bookie/src/app/menu-category/menu-category-detail/menu-category-detail.component.html +++ b/bookie/src/app/menu-category/menu-category-detail/menu-category-detail.component.html @@ -1,24 +1,19 @@ - - - Menu Category - - -
-
- - Name - - -
-
- Is Active? -
-
-
- - - @if (!!item.id) { - - } - -
+

Menu Category

+
+
+ + Name + + +
+
+ Is Active? +
+
+ +
+ + @if (!!item.id) { + + } +
diff --git a/bookie/src/app/menu-category/menu-category-detail/menu-category-detail.component.ts b/bookie/src/app/menu-category/menu-category-detail/menu-category-detail.component.ts index 2ef85af..06d000d 100644 --- a/bookie/src/app/menu-category/menu-category-detail/menu-category-detail.component.ts +++ b/bookie/src/app/menu-category/menu-category-detail/menu-category-detail.component.ts @@ -1,15 +1,14 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { MenuCategory } from '../../core/menu-category'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { MenuCategoryService } from '../menu-category.service'; @@ -17,13 +16,13 @@ import { MenuCategoryService } from '../menu-category.service'; selector: 'app-menu-category-detail', templateUrl: './menu-category-detail.component.html', styleUrls: ['./menu-category-detail.component.css'], - imports: [MatButtonModule, MatCardModule, MatCheckboxModule, MatFormFieldModule, MatInputModule, ReactiveFormsModule], + imports: [MatButtonModule, MatCheckboxModule, MatFormFieldModule, MatInputModule, ReactiveFormsModule], }) export class MenuCategoryDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(MenuCategoryService); @ViewChild('nameElement', { static: true }) nameElement?: ElementRef; @@ -68,11 +67,11 @@ export class MenuCategoryDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/menu-categories'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -80,11 +79,11 @@ export class MenuCategoryDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/menu-categories'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/menu-category/menu-category-list/menu-category-list.component.html b/bookie/src/app/menu-category/menu-category-list/menu-category-list.component.html index b78d42d..a6206dc 100644 --- a/bookie/src/app/menu-category/menu-category-list/menu-category-list.component.html +++ b/bookie/src/app/menu-category/menu-category-list/menu-category-list.component.html @@ -1,45 +1,39 @@ - - - - Menu Categories - - - add_box - Add - - - - - + Menu Categories + + + add_box + Add + + + + + + Name + {{ row.name }} - - - Name - {{ row.name }} - + - - - Active? - {{ row.isActive }} - + + + Active? + {{ row.isActive }} + - - - Fixture? - {{ row.isFixture }} - + + + Fixture? + {{ row.isFixture }} + - - - - - + + + diff --git a/bookie/src/app/menu-category/menu-category-list/menu-category-list.component.ts b/bookie/src/app/menu-category/menu-category-list/menu-category-list.component.ts index 5f7bd8b..d65c4bd 100644 --- a/bookie/src/app/menu-category/menu-category-list/menu-category-list.component.ts +++ b/bookie/src/app/menu-category/menu-category-list/menu-category-list.component.ts @@ -1,14 +1,13 @@ import { CdkDragDrop, moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop'; import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { BehaviorSubject } from 'rxjs'; import { MenuCategory } from '../../core/menu-category'; -import { ToasterService } from '../../core/toaster.service'; import { MenuCategoryService } from '../menu-category.service'; import { MenuCategoryListDatasource } from './menu-category-list-datasource'; @@ -16,12 +15,12 @@ import { MenuCategoryListDatasource } from './menu-category-list-datasource'; selector: 'app-menu-category-list', templateUrl: './menu-category-list.component.html', styleUrls: ['./menu-category-list.component.css'], - imports: [DragDropModule, MatButtonModule, MatCardModule, MatIconModule, MatTableModule, RouterLink], + imports: [DragDropModule, MatButtonModule, MatIconModule, MatTableModule, RouterLink], }) export class MenuCategoryListComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(MenuCategoryService); // @ViewChild('table', { static: true }) table?: MatTable; @@ -48,10 +47,10 @@ export class MenuCategoryListComponent implements OnInit { updateSortOrder() { this.ser.updateSortOrder(this.list).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/menu-engineering-report/menu-engineering-report.component.html b/bookie/src/app/menu-engineering-report/menu-engineering-report.component.html index d8d4d90..97801ad 100644 --- a/bookie/src/app/menu-engineering-report/menu-engineering-report.component.html +++ b/bookie/src/app/menu-engineering-report/menu-engineering-report.component.html @@ -1,108 +1,103 @@ - - - - Menu Engineering Report - - - - - - -
-
- - Start Date - - - - - - Finish Date - - - - - -
-
- - Filter - - n: Name, sc: Sale Category, mc: Menu Category, q:(=/<=/>=/</>)Quantity, - s:(=/<=/>=/</>)Sales - -
-
- - - - Name - {{ row.name }} - +

+ Menu Engineering Report + + + +

- - - Price - {{ row.average | number: '1.2-2' }} / {{ row.price | number: '1.2-2' }} - +
+
+ + Start Date + + + + + + Finish Date + + + + + +
+
+ + Filter + + n: Name, sc: Sale Category, mc: Menu Category, q:(=/<=/>=/</>)Quantity, + s:(=/<=/>=/</>)Sales + +
+
+ + + + Name + {{ row.name }} + - - - Sale Category - {{ row.saleCategory }} - - - - - Menu Category - {{ row.menuCategory }} - - - - - Quantity - {{ row.quantity | number: '1.2-2' }} ({{ row.quantityPercent | percent: '1.2-2' }}) - - - - - Sales - {{ row.sales | number: '1.2-2' }} ({{ row.salesPercent | percent: '1.2-2' }}) - - - - - + + Price + {{ row.average | number: '1.2-2' }} / {{ row.price | number: '1.2-2' }} - -
-
+ + + + + Sale Category + {{ row.saleCategory }} + + + + + Menu Category + {{ row.menuCategory }} + + + + + Quantity + {{ row.quantity | number: '1.2-2' }} ({{ row.quantityPercent | percent: '1.2-2' }}) + + + + + Sales + {{ row.sales | number: '1.2-2' }} ({{ row.salesPercent | percent: '1.2-2' }}) + + + + + + diff --git a/bookie/src/app/menu-engineering-report/menu-engineering-report.component.ts b/bookie/src/app/menu-engineering-report/menu-engineering-report.component.ts index e2f2d05..a22a139 100644 --- a/bookie/src/app/menu-engineering-report/menu-engineering-report.component.ts +++ b/bookie/src/app/menu-engineering-report/menu-engineering-report.component.ts @@ -2,12 +2,12 @@ import { DecimalPipe, PercentPipe } from '@angular/common'; import { Component, OnInit, ViewChild, ElementRef, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatSort, MatSortModule } from '@angular/material/sort'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router } from '@angular/router'; @@ -15,7 +15,6 @@ import moment from 'moment'; import { Observable } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; -import { ToasterService } from '../core/toaster.service'; import { ToCsvService } from '../shared/to-csv.service'; import { MenuEngineeringReport } from './menu-engineering-report'; import { MenuEngineeringReportDataSource } from './menu-engineering-report-datasource'; @@ -28,7 +27,7 @@ import { MenuEngineeringReportService } from './menu-engineering-report.service' imports: [ DecimalPipe, MatButtonModule, - MatCardModule, + MatDatepickerModule, MatFormFieldModule, MatIconModule, @@ -44,7 +43,7 @@ export class MenuEngineeringReportComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); private toCsv = inject(ToCsvService); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(MenuEngineeringReportService); @ViewChild('filterElement', { static: true }) filterElement?: ElementRef; @@ -109,10 +108,10 @@ export class MenuEngineeringReportComponent implements OnInit { print() { this.ser.print(this.info.startDate, this.info.finishDate).subscribe({ next: () => { - this.toaster.show('', 'Successfully Printed'); + this.snackBar.open('Successfully Printed', ''); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/modifier-categories/modifier-category-detail/modifier-category-detail.component.html b/bookie/src/app/modifier-categories/modifier-category-detail/modifier-category-detail.component.html index 0601760..ce95150 100644 --- a/bookie/src/app/modifier-categories/modifier-category-detail/modifier-category-detail.component.html +++ b/bookie/src/app/modifier-categories/modifier-category-detail/modifier-category-detail.component.html @@ -1,69 +1,64 @@ - - - Modifier Category - - -
-
- - Name - - -
-
- - Minimum - - - - Maximum - - -
-
- Is Active? -
- - - - -
  • - - - {{ node.name }} -
  • -
    - - -
  • -
    - - {{ node.name }} -
    -
      - -
    -
  • -
    -
    -
    -
    - - - - -
    +

    Modifier Category

    +
    +
    + + Name + + +
    +
    + + Minimum + + + + Maximum + + +
    +
    + Is Active? +
    + + + + +
  • + + + {{ node.name }} +
  • +
    + + +
  • +
    + + {{ node.name }} +
    +
      + +
    +
  • +
    +
    +
    + +
    + + +
    diff --git a/bookie/src/app/modifier-categories/modifier-category-detail/modifier-category-detail.component.ts b/bookie/src/app/modifier-categories/modifier-category-detail/modifier-category-detail.component.ts index ad1edf1..6b4a5a5 100644 --- a/bookie/src/app/modifier-categories/modifier-category-detail/modifier-category-detail.component.ts +++ b/bookie/src/app/modifier-categories/modifier-category-detail/modifier-category-detail.component.ts @@ -1,13 +1,13 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatDialog } from '@angular/material/dialog'; import { MatDividerModule } from '@angular/material/divider'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTreeModule, MatTreeNestedDataSource } from '@angular/material/tree'; import { ActivatedRoute, Router } from '@angular/router'; import { map } from 'rxjs/operators'; @@ -15,7 +15,6 @@ import { map } from 'rxjs/operators'; import { MenuCategory } from '../../core/menu-category'; import { ModifierCategory } from '../../core/modifier-category'; import { Product } from '../../core/product'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { ModifierCategoryService } from '../modifier-category.service'; import { NodeItem } from '../node-item'; @@ -36,7 +35,7 @@ interface ModifierCategoryNode { styleUrls: ['./modifier-category-detail.component.css'], imports: [ MatButtonModule, - MatCardModule, + MatCheckboxModule, MatDividerModule, MatFormFieldModule, @@ -49,7 +48,7 @@ interface ModifierCategoryNode { export class ModifierCategoryDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private dialog = inject(MatDialog); private ser = inject(ModifierCategoryService); @@ -137,11 +136,11 @@ export class ModifierCategoryDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/modifier-categories'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -149,11 +148,11 @@ export class ModifierCategoryDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/modifier-categories'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/modifier-categories/modifier-category-list/modifier-category-list.component.html b/bookie/src/app/modifier-categories/modifier-category-list/modifier-category-list.component.html index dc04949..ee84fd6 100644 --- a/bookie/src/app/modifier-categories/modifier-category-list/modifier-category-list.component.html +++ b/bookie/src/app/modifier-categories/modifier-category-list/modifier-category-list.component.html @@ -1,69 +1,63 @@ - - - - Modifier Categories - - add_box - Add - - - - - - - - Name - {{ row.name }} - +

    + Modifier Categories + + add_box + Add + +

    + + + + Name + {{ row.name }} + - - - Minimum - {{ row.minimum }} - + + + Minimum + {{ row.minimum }} + - - - Maximum - {{ row.maximum }} - + + + Maximum + {{ row.maximum }} + - - - Is Active - - - {{ row.isActive ? 'visibility' : 'visibility_off' }} - - {{ row.isActive ? 'Active' : 'Not Active' }} - - + + + Is Active + + + {{ row.isActive ? 'visibility' : 'visibility_off' }} + + {{ row.isActive ? 'Active' : 'Not Active' }} + + - - - Products - -
      - @for (mc of row.menuCategories; track mc) { -
    • - {{ mc.name }} - @if (!mc.enabled) { -
        - @for (p of mc.products; track p) { -
      • {{ p.name }}
      • - } -
      + + + Products + +
        + @for (mc of row.menuCategories; track mc) { +
      • + {{ mc.name }} + @if (!mc.enabled) { +
          + @for (p of mc.products; track p) { +
        • {{ p.name }}
        • } - +
        } -
      -
      -
      +
    • + } +
    +
    +
    - - -
    -
    -
    + + + diff --git a/bookie/src/app/modifier-categories/modifier-category-list/modifier-category-list.component.ts b/bookie/src/app/modifier-categories/modifier-category-list/modifier-category-list.component.ts index bfe770a..238a366 100644 --- a/bookie/src/app/modifier-categories/modifier-category-list/modifier-category-list.component.ts +++ b/bookie/src/app/modifier-categories/modifier-category-list/modifier-category-list.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, RouterLink } from '@angular/router'; @@ -12,7 +11,7 @@ import { ModifierCategoryListDatasource } from './modifier-category-list-datasou selector: 'app-modifier-category-list', templateUrl: './modifier-category-list.component.html', styleUrls: ['./modifier-category-list.component.css'], - imports: [MatButtonModule, MatCardModule, MatIconModule, MatTableModule, RouterLink], + imports: [MatButtonModule, MatIconModule, MatTableModule, RouterLink], }) export class ModifierCategoryListComponent implements OnInit { private route = inject(ActivatedRoute); diff --git a/bookie/src/app/modifiers/modifier-detail/modifier-detail.component.html b/bookie/src/app/modifiers/modifier-detail/modifier-detail.component.html index 98346a9..6c99243 100644 --- a/bookie/src/app/modifiers/modifier-detail/modifier-detail.component.html +++ b/bookie/src/app/modifiers/modifier-detail/modifier-detail.component.html @@ -1,45 +1,40 @@ - - - Modifier - - -
    -
    - - Name - - -
    -
    - Show In Bill? -
    -
    - - Price - - -
    -
    - - Category - - @for (mc of modifierCategories; track mc) { - - {{ mc.name }} - - } - - -
    -
    - Is Active? -
    -
    -
    - - - @if (!!item.id) { - - } - -
    +

    Modifier

    +
    +
    + + Name + + +
    +
    + Show In Bill? +
    +
    + + Price + + +
    +
    + + Category + + @for (mc of modifierCategories; track mc) { + + {{ mc.name }} + + } + + +
    +
    + Is Active? +
    +
    + +
    + + @if (!!item.id) { + + } +
    diff --git a/bookie/src/app/modifiers/modifier-detail/modifier-detail.component.ts b/bookie/src/app/modifiers/modifier-detail/modifier-detail.component.ts index d734520..ba4edaf 100644 --- a/bookie/src/app/modifiers/modifier-detail/modifier-detail.component.ts +++ b/bookie/src/app/modifiers/modifier-detail/modifier-detail.component.ts @@ -1,18 +1,17 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatOptionModule } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { Modifier } from '../../core/modifier'; import { ModifierCategory } from '../../core/modifier-category'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { ModifierService } from '../modifier.service'; @@ -22,12 +21,13 @@ import { ModifierService } from '../modifier.service'; styleUrls: ['./modifier-detail.component.css'], imports: [ MatButtonModule, - MatCardModule, + MatCheckboxModule, MatFormFieldModule, MatInputModule, MatOptionModule, MatSelectModule, + ReactiveFormsModule, ], }) @@ -35,7 +35,7 @@ export class ModifierDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(ModifierService); @ViewChild('name', { static: true }) nameElement?: ElementRef; @@ -91,11 +91,11 @@ export class ModifierDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/modifiers'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -103,11 +103,11 @@ export class ModifierDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/modifiers'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/modifiers/modifier-list/modifier-list.component.html b/bookie/src/app/modifiers/modifier-list/modifier-list.component.html index 2aaf9a0..d1de775 100644 --- a/bookie/src/app/modifiers/modifier-list/modifier-list.component.html +++ b/bookie/src/app/modifiers/modifier-list/modifier-list.component.html @@ -1,78 +1,72 @@ - - - - Modifiers - - add_box - Add - - - - -
    -
    - - Modifier Category - - -- All Categories -- - @for (mc of modifierCategories; track mc) { - - {{ mc.name }} - - } - - -
    -
    - - - - Name - {{ row.name }} - +

    + Modifiers + + add_box + Add + +

    +
    +
    + + Modifier Category + + -- All Categories -- + @for (mc of modifierCategories; track mc) { + + {{ mc.name }} + + } + + +
    +
    + + + + Name + {{ row.name }} + - - - Show In Bill - -
    -
    - - {{ row.showInBill ? 'visibility' : 'visibility_off' }} - - {{ row.showInBill ? 'Show' : 'Hide' }} -
    -
    -
    -
    - - - - Price - {{ row.price | currency: 'INR' }} - - - - - Category - {{ row.modifierCategory.name }} - - - - - Is Active - + + + Show In Bill + +
    +
    - {{ row.isActive ? 'visibility' : 'visibility_off' }} + {{ row.showInBill ? 'visibility' : 'visibility_off' }} - {{ row.isActive ? 'Active' : 'Not Active' }} - - + {{ row.showInBill ? 'Show' : 'Hide' }} +
    +
    +
    +
    - - -
    -
    -
    + + + Price + {{ row.price | currency: 'INR' }} + + + + + Category + {{ row.modifierCategory.name }} + + + + + Is Active + + + {{ row.isActive ? 'visibility' : 'visibility_off' }} + + {{ row.isActive ? 'Active' : 'Not Active' }} + + + + + + diff --git a/bookie/src/app/modifiers/modifier-list/modifier-list.component.ts b/bookie/src/app/modifiers/modifier-list/modifier-list.component.ts index fbd8432..e1f2726 100644 --- a/bookie/src/app/modifiers/modifier-list/modifier-list.component.ts +++ b/bookie/src/app/modifiers/modifier-list/modifier-list.component.ts @@ -2,7 +2,6 @@ import { CurrencyPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatOptionModule } from '@angular/material/core'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; @@ -22,7 +21,7 @@ import { ModifierListDataSource } from './modifier-list-datasource'; imports: [ CurrencyPipe, MatButtonModule, - MatCardModule, + MatFormFieldModule, MatIconModule, MatOptionModule, diff --git a/bookie/src/app/printers/printer-detail/printer-detail.component.html b/bookie/src/app/printers/printer-detail/printer-detail.component.html index fafbaf5..aa02d0b 100644 --- a/bookie/src/app/printers/printer-detail/printer-detail.component.html +++ b/bookie/src/app/printers/printer-detail/printer-detail.component.html @@ -1,31 +1,26 @@ - - - Printer - - -
    -
    - - Name - - -
    -
    - - Address - - - - Cut Code - - -
    -
    -
    - - - @if (!!item.id) { - - } - -
    +

    Printer

    +
    +
    + + Name + + +
    +
    + + Address + + + + Cut Code + + +
    +
    + +
    + + @if (!!item.id) { + + } +
    diff --git a/bookie/src/app/printers/printer-detail/printer-detail.component.ts b/bookie/src/app/printers/printer-detail/printer-detail.component.ts index 4e85ec1..966b91a 100644 --- a/bookie/src/app/printers/printer-detail/printer-detail.component.ts +++ b/bookie/src/app/printers/printer-detail/printer-detail.component.ts @@ -1,14 +1,13 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { Printer } from '../../core/printer'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { PrinterService } from '../printer.service'; @@ -16,13 +15,13 @@ import { PrinterService } from '../printer.service'; selector: 'app-printer-detail', templateUrl: './printer-detail.component.html', styleUrls: ['./printer-detail.component.css'], - imports: [MatButtonModule, MatCardModule, MatFormFieldModule, MatInputModule, ReactiveFormsModule], + imports: [MatButtonModule, MatFormFieldModule, MatInputModule, ReactiveFormsModule], }) export class PrinterDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(PrinterService); @ViewChild('nameElement', { static: true }) nameElement?: ElementRef; @@ -70,11 +69,11 @@ export class PrinterDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/printers'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -82,11 +81,11 @@ export class PrinterDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/printers'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/printers/printer-list/printer-list.component.html b/bookie/src/app/printers/printer-list/printer-list.component.html index 239553e..af559b1 100644 --- a/bookie/src/app/printers/printer-list/printer-list.component.html +++ b/bookie/src/app/printers/printer-list/printer-list.component.html @@ -1,37 +1,31 @@ - - - - Printers - - add_box - Add - - - - - - - - Name - {{ row.name }} - +

    + Printers + + add_box + Add + +

    + + + + Name + {{ row.name }} + - - - Address - {{ row.address }} - + + + Address + {{ row.address }} + - - - Cut Code - {{ row.cutCode }} - + + + Cut Code + {{ row.cutCode }} + - - - -
    -
    + + + diff --git a/bookie/src/app/printers/printer-list/printer-list.component.ts b/bookie/src/app/printers/printer-list/printer-list.component.ts index 84667c2..7daaab7 100644 --- a/bookie/src/app/printers/printer-list/printer-list.component.ts +++ b/bookie/src/app/printers/printer-list/printer-list.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, RouterLink } from '@angular/router'; @@ -12,7 +11,7 @@ import { PrinterListDataSource } from './printer-list-datasource'; selector: 'app-printer-list', templateUrl: './printer-list.component.html', styleUrls: ['./printer-list.component.css'], - imports: [MatButtonModule, MatCardModule, MatIconModule, MatTableModule, RouterLink], + imports: [MatButtonModule, MatIconModule, MatTableModule, RouterLink], }) export class PrinterListComponent implements OnInit { private route = inject(ActivatedRoute); diff --git a/bookie/src/app/product-sale-report/product-sale-report.component.html b/bookie/src/app/product-sale-report/product-sale-report.component.html index 8a7f8e7..16a4e18 100644 --- a/bookie/src/app/product-sale-report/product-sale-report.component.html +++ b/bookie/src/app/product-sale-report/product-sale-report.component.html @@ -1,96 +1,91 @@ - - - - Product Sale Report - - - - - - -
    -
    - - Start Date - - - - - - Finish Date - - - - - - Section - - -- All -- - @for (p of sections; track p.id) { - - {{ p.name }} - - } - - - -
    -
    - - - - Name - {{ row.name }} - +

    + Product Sale Report + + + +

    - - - Unbilled - {{ row.kot | number: '1.2-2' }} - +
    +
    + + Start Date + + + + + + Finish Date + + + + + + Section + + -- All -- + @for (p of sections; track p.id) { + + {{ p.name }} + + } + + + +
    +
    + + + + Name + {{ row.name }} + - - - Sale - {{ row.regularBill | number: '1.2-2' }} - + + + Unbilled + {{ row.kot | number: '1.2-2' }} + - - - No Charge - {{ row.noCharge | number: '1.2-2' }} - + + + Sale + {{ row.regularBill | number: '1.2-2' }} + - - - Staff - {{ row.staff | number: '1.2-2' }} - + + + No Charge + {{ row.noCharge | number: '1.2-2' }} + - - - Cancelled - {{ row.cancel | number: '1.2-2' }} - + + + Staff + {{ row.staff | number: '1.2-2' }} + - - - -
    -
    + + + Cancelled + {{ row.cancel | number: '1.2-2' }} + + + + + diff --git a/bookie/src/app/product-sale-report/product-sale-report.component.ts b/bookie/src/app/product-sale-report/product-sale-report.component.ts index d23105d..5c411e7 100644 --- a/bookie/src/app/product-sale-report/product-sale-report.component.ts +++ b/bookie/src/app/product-sale-report/product-sale-report.component.ts @@ -2,18 +2,17 @@ import { DecimalPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router } from '@angular/router'; import moment from 'moment'; import { Section } from '../core/section'; -import { ToasterService } from '../core/toaster.service'; import { ToCsvService } from '../shared/to-csv.service'; import { ProductSaleReport } from './product-sale-report'; import { ProductSaleReportDataSource } from './product-sale-report-datasource'; @@ -26,7 +25,7 @@ import { ProductSaleReportService } from './product-sale-report.service'; imports: [ DecimalPipe, MatButtonModule, - MatCardModule, + MatDatepickerModule, MatFormFieldModule, MatIconModule, @@ -40,7 +39,7 @@ export class ProductSaleReportComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); private toCsv = inject(ToCsvService); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(ProductSaleReportService); sections: Section[] = []; @@ -108,10 +107,10 @@ export class ProductSaleReportComponent implements OnInit { print() { this.ser.print(this.info.startDate, this.info.finishDate, this.info.sectionId).subscribe({ next: () => { - this.toaster.show('', 'Successfully Printed'); + this.snackBar.open('Successfully Printed', ''); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/product-updates-report/product-updates-report.component.html b/bookie/src/app/product-updates-report/product-updates-report.component.html index e3423eb..2e9a410 100644 --- a/bookie/src/app/product-updates-report/product-updates-report.component.html +++ b/bookie/src/app/product-updates-report/product-updates-report.component.html @@ -1,51 +1,46 @@ - - - - Product Update Report - - - - -
    -
    - - Start Date - - - - - - Finish Date - - - - - -
    -
    - - - - Details - {{ row }} - +

    + Product Update Report + +

    - - -
    -
    -
    +
    +
    + + Start Date + + + + + + Finish Date + + + + + +
    +
    + + + + Details + {{ row }} + + + + + diff --git a/bookie/src/app/product-updates-report/product-updates-report.component.ts b/bookie/src/app/product-updates-report/product-updates-report.component.ts index 00ca401..8cc5304 100644 --- a/bookie/src/app/product-updates-report/product-updates-report.component.ts +++ b/bookie/src/app/product-updates-report/product-updates-report.component.ts @@ -1,7 +1,6 @@ import { Component, OnInit, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; @@ -20,7 +19,7 @@ import { ProductUpdatesReportDataSource } from './product-updates-report-datasou styleUrls: ['./product-updates-report.component.css'], imports: [ MatButtonModule, - MatCardModule, + MatDatepickerModule, MatFormFieldModule, MatIconModule, diff --git a/bookie/src/app/product/product-detail/product-detail.component.html b/bookie/src/app/product/product-detail/product-detail.component.html index a92c5fb..fc06f19 100644 --- a/bookie/src/app/product/product-detail/product-detail.component.html +++ b/bookie/src/app/product/product-detail/product-detail.component.html @@ -1,61 +1,55 @@ - - - Product - - -
    -
    - - Name - - - - Units - - -
    -
    - - Price - - - - Quantity - - -
    -
    - Has Happy Hour? - Is Not Available? -
    -
    - - Menu Category - - @for (mc of menuCategories; track mc) { - - {{ mc.name }} - - } - - - - Sale Category - - @for (sc of saleCategories; track sc) { - - {{ sc.name }} - - } - - -
    -
    -
    - - - @if (!!item.id) { - - } - -
    +

    Product

    +
    +
    + + Name + + + + Units + + +
    +
    + + Price + + + + Quantity + + +
    +
    + Has Happy Hour? + Is Not Available? +
    +
    + + Menu Category + + @for (mc of menuCategories; track mc) { + + {{ mc.name }} + + } + + + + Sale Category + + @for (sc of saleCategories; track sc) { + + {{ sc.name }} + + } + + +
    +
    +
    + + @if (!!item.id) { + + } +
    diff --git a/bookie/src/app/product/product-detail/product-detail.component.ts b/bookie/src/app/product/product-detail/product-detail.component.ts index e54522f..da69fae 100644 --- a/bookie/src/app/product/product-detail/product-detail.component.ts +++ b/bookie/src/app/product/product-detail/product-detail.component.ts @@ -1,19 +1,18 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatOptionModule } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { MenuCategory } from '../../core/menu-category'; import { Product } from '../../core/product'; import { SaleCategory } from '../../core/sale-category'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { ProductService } from '../product.service'; @@ -23,7 +22,7 @@ import { ProductService } from '../product.service'; styleUrls: ['./product-detail.component.css'], imports: [ MatButtonModule, - MatCardModule, + MatCheckboxModule, MatFormFieldModule, MatInputModule, @@ -36,7 +35,7 @@ export class ProductDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(ProductService); @ViewChild('name', { static: true }) nameElement?: ElementRef; @@ -107,11 +106,11 @@ export class ProductDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/products'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -119,11 +118,11 @@ export class ProductDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/products'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/product/product-list/product-list.component.html b/bookie/src/app/product/product-list/product-list.component.html index 7e3b82a..18119d3 100644 --- a/bookie/src/app/product/product-list/product-list.component.html +++ b/bookie/src/app/product/product-list/product-list.component.html @@ -1,107 +1,101 @@ - - - - Products - - - - - add_box - Add - - - - -
    -
    - - Filter - - - - Menu Category - - -- All Products -- - @for (mc of menuCategories; track mc) { - - {{ mc.name }} - - } - - -
    -
    - + Products + + + + + add_box + Add + + +
    +
    + + Filter + + + + Menu Category + + -- All Products -- + @for (mc of menuCategories; track mc) { + + {{ mc.name }} + + } + + +
    +
    + + + + Name + {{ row.name }} ({{ row.units }}) - - - Name - {{ row.name }} ({{ row.units }}) - + - - - Price - {{ row.price | currency: 'INR' }} - + + + Price + {{ row.price | currency: 'INR' }} + - - - Menu Category - {{ row.menuCategory.name }} - + + + Menu Category + {{ row.menuCategory.name }} + - - - Sale Category - {{ row.saleCategory.name }} - + + + Sale Category + {{ row.saleCategory.name }} + - - - Details - -
    -
    - - {{ row.hasHappyHour ? 'sentiment_satisfied_alt' : 'sentiment_dissatisfied' }} - - {{ row.hasHappyHour ? 'Happy Hour' : 'Regular' }} -
    -
    - - {{ row.isNotAvailable ? 'pause' : 'play_arrow' }} - - {{ row.isNotAvailable ? 'Not Available' : 'Available' }} -
    -
    -
    -
    + + + Details + +
    +
    + + {{ row.hasHappyHour ? 'sentiment_satisfied_alt' : 'sentiment_dissatisfied' }} + + {{ row.hasHappyHour ? 'Happy Hour' : 'Regular' }} +
    +
    + + {{ row.isNotAvailable ? 'pause' : 'play_arrow' }} + + {{ row.isNotAvailable ? 'Not Available' : 'Available' }} +
    +
    +
    +
    - - - Quantity - {{ row.quantity | number: '1.2-2' }} - + + + Quantity + {{ row.quantity | number: '1.2-2' }} + - - -
    -
    -
    + + + diff --git a/bookie/src/app/product/product-list/product-list.component.ts b/bookie/src/app/product/product-list/product-list.component.ts index aa0f91c..575b963 100644 --- a/bookie/src/app/product/product-list/product-list.component.ts +++ b/bookie/src/app/product/product-list/product-list.component.ts @@ -3,12 +3,12 @@ import { AsyncPipe, DecimalPipe, CurrencyPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatOptionModule } from '@angular/material/core'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, RouterLink } from '@angular/router'; import { BehaviorSubject, Observable } from 'rxjs'; @@ -16,7 +16,6 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; import { MenuCategory } from '../../core/menu-category'; import { Product } from '../../core/product'; -import { ToasterService } from '../../core/toaster.service'; import { ToCsvService } from '../../shared/to-csv.service'; import { ProductService } from '../product.service'; import { ProductListDataSource } from './product-list-datasource'; @@ -31,7 +30,7 @@ import { ProductListDataSource } from './product-list-datasource'; DecimalPipe, DragDropModule, MatButtonModule, - MatCardModule, + MatFormFieldModule, MatIconModule, MatInputModule, @@ -44,7 +43,7 @@ import { ProductListDataSource } from './product-list-datasource'; }) export class ProductListComponent implements OnInit { private route = inject(ActivatedRoute); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private toCsv = inject(ToCsvService); private ser = inject(ProductService); @@ -94,11 +93,11 @@ export class ProductListComponent implements OnInit { updateSortOrder() { this.ser.updateSortOrder(this.dataSource.filteredData).subscribe({ next: (result: Product[]) => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.loadData(result, this.menuCategories); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/regimes/regime-detail/regime-detail.component.html b/bookie/src/app/regimes/regime-detail/regime-detail.component.html index eef015a..164bf91 100644 --- a/bookie/src/app/regimes/regime-detail/regime-detail.component.html +++ b/bookie/src/app/regimes/regime-detail/regime-detail.component.html @@ -1,33 +1,28 @@ - - - Regime - - -
    -
    - - Name - - -
    -
    - - Header - - -
    -
    - - Prefix - - -
    -
    -
    - - - @if (!!item.id) { - - } - -
    +

    Regime

    +
    +
    + + Name + + +
    +
    + + Header + + +
    +
    + + Prefix + + +
    +
    + +
    + + @if (!!item.id) { + + } +
    diff --git a/bookie/src/app/regimes/regime-detail/regime-detail.component.ts b/bookie/src/app/regimes/regime-detail/regime-detail.component.ts index 4ce4829..370a701 100644 --- a/bookie/src/app/regimes/regime-detail/regime-detail.component.ts +++ b/bookie/src/app/regimes/regime-detail/regime-detail.component.ts @@ -1,14 +1,13 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { Regime } from '../../core/regime'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { RegimeService } from '../regime.service'; @@ -16,13 +15,13 @@ import { RegimeService } from '../regime.service'; selector: 'app-regime-detail', templateUrl: './regime-detail.component.html', styleUrls: ['./regime-detail.component.css'], - imports: [MatButtonModule, MatCardModule, MatFormFieldModule, MatInputModule, ReactiveFormsModule], + imports: [MatButtonModule, MatFormFieldModule, MatInputModule, ReactiveFormsModule], }) export class RegimeDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(RegimeService); @ViewChild('nameElement', { static: true }) nameElement?: ElementRef; @@ -70,11 +69,11 @@ export class RegimeDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/regimes'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -82,11 +81,11 @@ export class RegimeDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as number).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/regimes'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/regimes/regime-list/regime-list.component.html b/bookie/src/app/regimes/regime-list/regime-list.component.html index 72dfd7f..5f21ddb 100644 --- a/bookie/src/app/regimes/regime-list/regime-list.component.html +++ b/bookie/src/app/regimes/regime-list/regime-list.component.html @@ -1,43 +1,37 @@ - - - - Regimes - - add_box - Add - - - - - - - - Name - {{ row.name }} - +

    + Regimes + + add_box + Add + +

    + + + + Name + {{ row.name }} + - - - Header - {{ row.header }} - + + + Header + {{ row.header }} + - - - Prefix - {{ row.prefix }} - + + + Prefix + {{ row.prefix }} + - - - Is Fixture? - {{ row.isFixture }} - + + + Is Fixture? + {{ row.isFixture }} + - - - -
    -
    + + + diff --git a/bookie/src/app/regimes/regime-list/regime-list.component.ts b/bookie/src/app/regimes/regime-list/regime-list.component.ts index eed7c26..603c933 100644 --- a/bookie/src/app/regimes/regime-list/regime-list.component.ts +++ b/bookie/src/app/regimes/regime-list/regime-list.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, RouterLink } from '@angular/router'; @@ -12,7 +11,7 @@ import { RegimeListDataSource } from './regime-list-datasource'; selector: 'app-regime-list', templateUrl: './regime-list.component.html', styleUrls: ['./regime-list.component.css'], - imports: [MatButtonModule, MatCardModule, MatIconModule, MatTableModule, RouterLink], + imports: [MatButtonModule, MatIconModule, MatTableModule, RouterLink], }) export class RegimeListComponent implements OnInit { private route = inject(ActivatedRoute); diff --git a/bookie/src/app/roles/role-detail/role-detail.component.html b/bookie/src/app/roles/role-detail/role-detail.component.html index 196644c..5a752b9 100644 --- a/bookie/src/app/roles/role-detail/role-detail.component.html +++ b/bookie/src/app/roles/role-detail/role-detail.component.html @@ -1,27 +1,22 @@ - - - Role - - -
    -
    - - Name - - +

    Role

    + +
    + + Name + + +
    + +
    + @for (p of item.permissions; track p; let i = $index) { +
    + {{ p.name }}
    - -
    - @for (p of item.permissions; track p; let i = $index) { -
    - {{ p.name }} -
    - } -
    - - - - - - - + } +
    + + +
    + + +
    diff --git a/bookie/src/app/roles/role-detail/role-detail.component.ts b/bookie/src/app/roles/role-detail/role-detail.component.ts index d69dd6f..0463a3a 100644 --- a/bookie/src/app/roles/role-detail/role-detail.component.ts +++ b/bookie/src/app/roles/role-detail/role-detail.component.ts @@ -1,15 +1,13 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormArray, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatDialog } from '@angular/material/dialog'; -import { MatDividerModule } from '@angular/material/divider'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { Role } from '../role'; import { RoleService } from '../role.service'; @@ -18,20 +16,12 @@ import { RoleService } from '../role.service'; selector: 'app-role-detail', templateUrl: './role-detail.component.html', styleUrls: ['./role-detail.component.css'], - imports: [ - MatButtonModule, - MatCardModule, - MatCheckboxModule, - MatDividerModule, - MatFormFieldModule, - MatInputModule, - ReactiveFormsModule, - ], + imports: [MatButtonModule, MatCheckboxModule, MatFormFieldModule, MatInputModule, ReactiveFormsModule], }) export class RoleDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private dialog = inject(MatDialog); private ser = inject(RoleService); @@ -83,11 +73,11 @@ export class RoleDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/roles'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -95,11 +85,11 @@ export class RoleDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/roles'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/roles/role-list/role-list.component.html b/bookie/src/app/roles/role-list/role-list.component.html index 614ea33..08e4f9c 100644 --- a/bookie/src/app/roles/role-list/role-list.component.html +++ b/bookie/src/app/roles/role-list/role-list.component.html @@ -1,37 +1,31 @@ - - - - Roles - - add_box - Add - - - - - - - - Name - {{ row.name }} - +

    + Roles + + add_box + Add + +

    + + + + Name + {{ row.name }} + - - - Permissions - -
      - @for (permission of row.permissions; track permission) { -
    • {{ permission }}
    • - } -
    -
    -
    + + + Permissions + +
      + @for (permission of row.permissions; track permission) { +
    • {{ permission }}
    • + } +
    +
    +
    - - -
    -
    -
    + + + diff --git a/bookie/src/app/roles/role-list/role-list.component.ts b/bookie/src/app/roles/role-list/role-list.component.ts index b40a78c..8867819 100644 --- a/bookie/src/app/roles/role-list/role-list.component.ts +++ b/bookie/src/app/roles/role-list/role-list.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, RouterLink } from '@angular/router'; @@ -12,7 +11,7 @@ import { RoleListDataSource } from './role-list-datasource'; selector: 'app-role-list', templateUrl: './role-list.component.html', styleUrls: ['./role-list.component.css'], - imports: [MatButtonModule, MatCardModule, MatIconModule, MatTableModule, RouterLink], + imports: [MatButtonModule, MatIconModule, MatTableModule, RouterLink], }) export class RoleListComponent implements OnInit { private route = inject(ActivatedRoute); diff --git a/bookie/src/app/sale-category/sale-category-detail/sale-category-detail.component.html b/bookie/src/app/sale-category/sale-category-detail/sale-category-detail.component.html index 13498a9..9b0730c 100644 --- a/bookie/src/app/sale-category/sale-category-detail/sale-category-detail.component.html +++ b/bookie/src/app/sale-category/sale-category-detail/sale-category-detail.component.html @@ -1,71 +1,61 @@ - - - Sale Category - - -
    -
    - - Name - - -
    -
    - - Discount Limit - - % - -
    -
    - - Tax - - @for (t of taxes; track t) { - - {{ t.name }} - - } - - -
    -
    -
    - - - @if (!!item.id) { - - } - -
    - - - Products - - - - - - Name - {{ row.name }} - +

    Sale Category

    +
    +
    + + Name + + +
    +
    + + Discount Limit + + % + +
    +
    + + Tax + + @for (t of taxes; track t) { + + {{ t.name }} + + } + + +
    +
    + +
    + + @if (!!item.id) { + + } +
    - - - Price - {{ row.price | currency: 'INR' }} - +

    Products

    + + + + Name + {{ row.name }} + - - - Menu Category - {{ row.menuCategory.name }} - + + + Price + {{ row.price | currency: 'INR' }} + - - - -
    -
    + + + Menu Category + {{ row.menuCategory.name }} + + + + + diff --git a/bookie/src/app/sale-category/sale-category-detail/sale-category-detail.component.ts b/bookie/src/app/sale-category/sale-category-detail/sale-category-detail.component.ts index 0861997..f86fb1a 100644 --- a/bookie/src/app/sale-category/sale-category-detail/sale-category-detail.component.ts +++ b/bookie/src/app/sale-category/sale-category-detail/sale-category-detail.component.ts @@ -2,12 +2,13 @@ import { CurrencyPipe } from '@angular/common'; import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatOptionModule } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; +import { MatDividerModule } from '@angular/material/divider'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { round } from 'mathjs'; @@ -16,7 +17,6 @@ import { BehaviorSubject } from 'rxjs'; import { Product } from '../../core/product'; import { SaleCategory } from '../../core/sale-category'; import { Tax } from '../../core/tax'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { SaleCategoryService } from '../sale-category.service'; import { SaleCategoryDetailDatasource } from './sale-category-detail-datasource'; @@ -28,11 +28,12 @@ import { SaleCategoryDetailDatasource } from './sale-category-detail-datasource' imports: [ CurrencyPipe, MatButtonModule, - MatCardModule, + MatFormFieldModule, MatInputModule, MatOptionModule, MatSelectModule, + MatDividerModule, MatTableModule, ReactiveFormsModule, RouterLink, @@ -42,7 +43,7 @@ export class SaleCategoryDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(SaleCategoryService); @ViewChild('nameElement', { static: true }) nameElement?: ElementRef; @@ -96,11 +97,11 @@ export class SaleCategoryDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/sale-categories'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -108,11 +109,11 @@ export class SaleCategoryDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/sale-categories'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/sale-category/sale-category-list/sale-category-list.component.html b/bookie/src/app/sale-category/sale-category-list/sale-category-list.component.html index d44a6d3..3692ca7 100644 --- a/bookie/src/app/sale-category/sale-category-list/sale-category-list.component.html +++ b/bookie/src/app/sale-category/sale-category-list/sale-category-list.component.html @@ -1,37 +1,31 @@ - - - - Sale Categories - - add_box - Add - - - - - - - - Name - {{ row.name }} - +

    + Sale Categories + + add_box + Add + +

    + + + + Name + {{ row.name }} + - - - Discount Limit - {{ row.discountLimit | percent: '1.2-2' }} - + + + Discount Limit + {{ row.discountLimit | percent: '1.2-2' }} + - - - Tax - {{ row.tax.rate | percent: '1.2-2' }} {{ row.tax.name }} - + + + Tax + {{ row.tax.rate | percent: '1.2-2' }} {{ row.tax.name }} + - - - -
    -
    + + + diff --git a/bookie/src/app/sale-category/sale-category-list/sale-category-list.component.ts b/bookie/src/app/sale-category/sale-category-list/sale-category-list.component.ts index ba5e206..f5c94c8 100644 --- a/bookie/src/app/sale-category/sale-category-list/sale-category-list.component.ts +++ b/bookie/src/app/sale-category/sale-category-list/sale-category-list.component.ts @@ -1,14 +1,13 @@ import { PercentPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { BehaviorSubject } from 'rxjs'; import { SaleCategory } from '../../core/sale-category'; -import { ToasterService } from '../../core/toaster.service'; import { SaleCategoryService } from '../sale-category.service'; import { SaleCategoryListDatasource } from './sale-category-list-datasource'; @@ -16,12 +15,12 @@ import { SaleCategoryListDatasource } from './sale-category-list-datasource'; selector: 'app-sale-category-list', templateUrl: './sale-category-list.component.html', styleUrls: ['./sale-category-list.component.css'], - imports: [MatButtonModule, MatCardModule, MatIconModule, MatTableModule, PercentPipe, RouterLink], + imports: [MatButtonModule, MatIconModule, MatTableModule, PercentPipe, RouterLink], }) export class SaleCategoryListComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(SaleCategoryService); // @ViewChild('table', { static: true }) table?: MatTable; diff --git a/bookie/src/app/sale-report/sale-report.component.html b/bookie/src/app/sale-report/sale-report.component.html index ea76f09..3d79ecb 100644 --- a/bookie/src/app/sale-report/sale-report.component.html +++ b/bookie/src/app/sale-report/sale-report.component.html @@ -1,71 +1,66 @@ - - - - Sale Report - - - - - - -
    -
    - - Start Date - - - - - - Finish Date - - - - - - Section - - -- All -- - @for (p of sections; track p.id) { - - {{ p.name }} - - } - - - -
    -
    - - - - Name - {{ row.name }} - +

    + Sale Report + + + +

    - - - Amount - {{ row.amount | currency: 'INR' }} - - - -
    -
    -
    +
    +
    + + Start Date + + + + + + Finish Date + + + + + + Section + + -- All -- + @for (p of sections; track p.id) { + + {{ p.name }} + + } + + + +
    +
    + + + + Name + {{ row.name }} + + + + + Amount + {{ row.amount | currency: 'INR' }} + + + + diff --git a/bookie/src/app/sale-report/sale-report.component.ts b/bookie/src/app/sale-report/sale-report.component.ts index a46a480..6bc6163 100644 --- a/bookie/src/app/sale-report/sale-report.component.ts +++ b/bookie/src/app/sale-report/sale-report.component.ts @@ -2,19 +2,18 @@ import { CurrencyPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatOptionModule } from '@angular/material/core'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router } from '@angular/router'; import moment from 'moment'; import { Section } from '../core/section'; -import { ToasterService } from '../core/toaster.service'; import { ToCsvService } from '../shared/to-csv.service'; import { SaleReport } from './sale-report'; import { SaleReportDatasource } from './sale-report-datasource'; @@ -27,7 +26,7 @@ import { SaleReportService } from './sale-report.service'; imports: [ CurrencyPipe, MatButtonModule, - MatCardModule, + MatDatepickerModule, MatFormFieldModule, MatIconModule, @@ -42,7 +41,7 @@ export class SaleReportComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); private toCsv = inject(ToCsvService); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(SaleReportService); sections: Section[] = []; @@ -109,10 +108,10 @@ export class SaleReportComponent implements OnInit { print() { this.ser.print(this.info.startDate, this.info.finishDate, this.info.sectionId).subscribe({ next: () => { - this.toaster.show('', 'Successfully Printed'); + this.snackBar.open('Successfully Printed', ''); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/sales/bill-type/bill-type.component.ts b/bookie/src/app/sales/bill-type/bill-type.component.ts index 3f2315e..6159629 100644 --- a/bookie/src/app/sales/bill-type/bill-type.component.ts +++ b/bookie/src/app/sales/bill-type/bill-type.component.ts @@ -11,7 +11,7 @@ import { VoucherType } from '../bills/voucher-type'; selector: 'app-bill-type', templateUrl: './bill-type.component.html', styleUrls: ['./bill-type.component.sass'], - imports: [CdkScrollableModule, MatButtonModule, MatCardModule, MatDialogModule, MatRippleModule], + imports: [CdkScrollableModule, MatButtonModule, MatDialogModule, MatRippleModule, MatCardModule], }) export class BillTypeComponent { dialogRef = inject>(MatDialogRef); diff --git a/bookie/src/app/sales/bill.service.ts b/bookie/src/app/sales/bill.service.ts index 76d6e21..c408fa5 100644 --- a/bookie/src/app/sales/bill.service.ts +++ b/bookie/src/app/sales/bill.service.ts @@ -1,6 +1,7 @@ import { SelectionModel } from '@angular/cdk/collections'; import { Injectable, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { BehaviorSubject, throwError, Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; @@ -10,7 +11,6 @@ import { Product } from '../core/product'; import { ReceivePaymentItem } from '../core/receive-payment-item'; import { SaleCategory } from '../core/sale-category'; import { Table } from '../core/table'; -import { ToasterService } from '../core/toaster.service'; import { ModifierCategoryService } from '../modifier-categories/modifier-category.service'; import { MathService } from '../shared/math.service'; import { Bill } from './bills/bill'; @@ -25,7 +25,7 @@ import { ModifiersComponent } from './modifiers/modifiers.component'; }) export class BillService { private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private math = inject(MathService); private ser = inject(VoucherService); private modifierCategoryService = inject(ModifierCategoryService); @@ -118,7 +118,7 @@ export class BillService { if (quantity < 0) { const minimum = this.minimum(product.id as string, product.hasHappyHour) + quantity; if (minimum + quantity < 0) { - this.toaster.show('Error', 'Total quantity cannot be negative!'); + this.snackBar.open('Total quantity cannot be negative!', 'Error'); return; } } diff --git a/bookie/src/app/sales/bills/bills.component.html b/bookie/src/app/sales/bills/bills.component.html index 1e72892..d880c57 100644 --- a/bookie/src/app/sales/bills/bills.component.html +++ b/bookie/src/app/sales/bills/bills.component.html @@ -1,174 +1,165 @@ - - - Bill - - - - - Bill / KOT number - - - {{ bs.bill.billId }} / K-{{ bs.bill.kotId }}Bill + +
    + + Bill / KOT number + + + {{ bs.bill.billId }} / K-{{ bs.bill.kotId }} + + + Time / Start Time / Last Edit Time + + + + {{ bs.bill.date }} / {{ bs.bill.creationDate }} / {{ bs.bill.lastEditDate }} + + + Table / Pax / Customer + + + / + / + + + + + + + @if (row.isOldKot) { + - - - Time / Start Time / Last Edit Time - - - - {{ bs.bill.date }} / {{ bs.bill.creationDate }} / {{ bs.bill.lastEditDate }} + } + @if (!row.isKot) { + - - - Table / Pax / Customer - - - / - / - - + + } + + + + + + + {{ row.info }} + +
      + @for (m of row.modifiers; track m.id) { +
    • {{ m.name }}
    • + } +
    +
    +
    + + + Quantity + + @if (!row.isKot) { + + } + @if (!row.isKot) { + + } + @if (!row.isKot) { + + } + @if (!row.isKot) { + + } + @if (row.isKot) { + + } + + + + + + + + + Gross + + + {{ + bs.grossAmount | async | currency: 'INR' + }} + - - - - @if (row.isOldKot) { - - - } - @if (!row.isKot) { - - - } - - - - - - - {{ row.info }} - -
      - @for (m of row.modifiers; track m.id) { -
    • {{ m.name }}
    • - } -
    -
    -
    - - - Quantity - - @if (!row.isKot) { - - } - @if (!row.isKot) { - - } - @if (!row.isKot) { - - } - @if (!row.isKot) { - - } - @if (row.isKot) { - - } - - - - - - - - - Gross - - - {{ - bs.grossAmount | async | currency: 'INR' - }} - + + + Happy Hour Discount + + + {{ + bs.hhAmount | async | currency: 'INR' + }} + - - - Happy Hour Discount - - - {{ - bs.hhAmount | async | currency: 'INR' - }} - + + + Discount + + + {{ + bs.discountAmount | async | currency: 'INR' + }} + - - - Discount - - - {{ - bs.discountAmount | async | currency: 'INR' - }} - + + + Tax + + + {{ + bs.taxAmount | async | currency: 'INR' + }} + - - - Tax - - - {{ - bs.taxAmount | async | currency: 'INR' - }} - + + + Amount + + + {{ + bs.amount | async | currency: 'INR' + }} + +
    - - - Amount - - - {{ - bs.amount | async | currency: 'INR' - }} - - -
    -
    diff --git a/bookie/src/app/sales/bills/bills.component.ts b/bookie/src/app/sales/bills/bills.component.ts index 4ad9878..8839335 100644 --- a/bookie/src/app/sales/bills/bills.component.ts +++ b/bookie/src/app/sales/bills/bills.component.ts @@ -1,10 +1,10 @@ import { AsyncPipe, CurrencyPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatDialog } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { MatTooltipModule } from '@angular/material/tooltip'; import { ActivatedRoute, Router, RouterOutlet } from '@angular/router'; @@ -15,7 +15,6 @@ import { AuthService } from '../../auth/auth.service'; import { BillViewItem } from '../../core/bill-view-item'; import { Customer } from '../../core/customer'; import { Table } from '../../core/table'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { TableService } from '../../tables/table.service'; import { BillService } from '../bill.service'; @@ -38,7 +37,7 @@ import { VoucherType } from './voucher-type'; AsyncPipe, CurrencyPipe, MatButtonModule, - MatCardModule, + MatCheckboxModule, MatIconModule, MatTableModule, @@ -50,7 +49,7 @@ export class BillsComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private auth = inject(AuthService); bs = inject(BillService); private tSer = inject(TableService); @@ -273,11 +272,11 @@ export class BillsComponent implements OnInit { ) .subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigate(['/sales']); }, error: (x) => { - this.toaster.show('Error', x); + this.snackBar.open(x, 'Error'); }, }); } diff --git a/bookie/src/app/sales/home/sales-home.component.html b/bookie/src/app/sales/home/sales-home.component.html index 89525eb..f624b4e 100644 --- a/bookie/src/app/sales/home/sales-home.component.html +++ b/bookie/src/app/sales/home/sales-home.component.html @@ -1,80 +1,76 @@ - - -
    - -

    Add Product

    -
    - -

    Discount

    -
    - -

    Print KOT

    -
    - -

    Print Bill

    -
    - -

    Back to Tables

    -
    - -

    Receive Payment

    -
    - -

    Move Table

    -
    - -

    Cancel Bill

    -
    - -

    Split Bill

    -
    -
    -
    -
    +
    + +

    Add Product

    +
    + +

    Discount

    +
    + +

    Print KOT

    +
    + +

    Print Bill

    +
    + +

    Back to Tables

    +
    + +

    Receive Payment

    +
    + +

    Move Table

    +
    + +

    Cancel Bill

    +
    + +

    Split Bill

    +
    +
    diff --git a/bookie/src/app/sales/home/sales-home.component.ts b/bookie/src/app/sales/home/sales-home.component.ts index 88d3531..0e046ba 100644 --- a/bookie/src/app/sales/home/sales-home.component.ts +++ b/bookie/src/app/sales/home/sales-home.component.ts @@ -2,6 +2,7 @@ import { Component, inject } from '@angular/core'; import { MatCardModule } from '@angular/material/card'; import { MatRippleModule } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { Observable, of as observableOf } from 'rxjs'; import { map, switchMap, tap } from 'rxjs/operators'; @@ -9,7 +10,6 @@ import { map, switchMap, tap } from 'rxjs/operators'; import { AuthService } from '../../auth/auth.service'; import { ReceivePaymentItem } from '../../core/receive-payment-item'; import { Table } from '../../core/table'; -import { ToasterService } from '../../core/toaster.service'; import { SaleCategoryService } from '../../sale-category/sale-category.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { TableService } from '../../tables/table.service'; @@ -28,14 +28,14 @@ import { TablesDialogComponent } from '../tables-dialog/tables-dialog.component' selector: 'app-sales-home', templateUrl: './sales-home.component.html', styleUrls: ['./sales-home.component.sass'], - imports: [MatCardModule, MatRippleModule, RouterLink], + imports: [MatRippleModule, RouterLink, MatCardModule], }) export class SalesHomeComponent { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); private auth = inject(AuthService); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private saleCategoryService = inject(SaleCategoryService); private tableService = inject(TableService); private customerDiscountsService = inject(CustomerDiscountsService); @@ -64,11 +64,11 @@ export class SalesHomeComponent { } this.bs.printKot(guestBookId).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigate(['/sales']); }, error: (result) => { - this.toaster.show('Error', result); + this.snackBar.open(result, 'Error'); }, }); } @@ -167,11 +167,11 @@ export class SalesHomeComponent { ) .subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigate(['/sales']); }, error: (result) => { - this.toaster.show('Error', result); + this.snackBar.open(result, 'Error'); }, }); } @@ -216,11 +216,11 @@ export class SalesHomeComponent { ) .subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigate(['/sales']); }, error: (value) => { - this.toaster.show('Error', value); + this.snackBar.open(value, 'Error'); }, }); } @@ -259,11 +259,11 @@ export class SalesHomeComponent { ) .subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigate(['/sales']); }, error: (x) => { - this.toaster.show('Error', x); + this.snackBar.open(x, 'Error'); }, }); } @@ -315,11 +315,11 @@ export class SalesHomeComponent { ) .subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigate(['/sales']); }, error: (x) => { - this.toaster.show('Error', x); + this.snackBar.open(x, 'Error'); }, }); } @@ -382,11 +382,11 @@ export class SalesHomeComponent { ) .subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigate(['/sales']); }, error: (x) => { - this.toaster.show('Error', x); + this.snackBar.open(x, 'Error'); }, }); } diff --git a/bookie/src/app/sales/menu-categories/menu-categories.component.html b/bookie/src/app/sales/menu-categories/menu-categories.component.html index c815e73..2f5e075 100644 --- a/bookie/src/app/sales/menu-categories/menu-categories.component.html +++ b/bookie/src/app/sales/menu-categories/menu-categories.component.html @@ -1,24 +1,15 @@ - - -
    - -

    Back

    -
    - @for (item of list; track item) { - -

    {{ item.name }}

    -
    - } -
    -
    -
    +
    + +

    Back

    +
    + @for (item of list; track item) { + +

    {{ item.name }}

    +
    + } +
    diff --git a/bookie/src/app/sales/menu-categories/menu-categories.component.ts b/bookie/src/app/sales/menu-categories/menu-categories.component.ts index dbc17ed..310d654 100644 --- a/bookie/src/app/sales/menu-categories/menu-categories.component.ts +++ b/bookie/src/app/sales/menu-categories/menu-categories.component.ts @@ -9,7 +9,7 @@ import { MenuCategory } from '../../core/menu-category'; selector: 'app-menu-category', templateUrl: './menu-categories.component.html', styleUrls: ['./menu-categories.component.sass'], - imports: [MatCardModule, MatRippleModule, RouterLink], + imports: [MatRippleModule, RouterLink, MatCardModule], }) export class MenuCategoriesComponent implements OnInit { private route = inject(ActivatedRoute); diff --git a/bookie/src/app/sales/products/products.component.html b/bookie/src/app/sales/products/products.component.html index 8d838cf..9b20512 100644 --- a/bookie/src/app/sales/products/products.component.html +++ b/bookie/src/app/sales/products/products.component.html @@ -1,27 +1,23 @@ - - -
    - -

    Back

    -
    - @for (item of list; track item) { - -

    {{ item.name }}

    - {{ item.price | currency: 'INR' }} -
    - } -
    -
    -
    +
    + +

    Back

    +
    + @for (item of list; track item) { + +

    {{ item.name }}

    + {{ item.price | currency: 'INR' }} +
    + } +
    diff --git a/bookie/src/app/sales/products/products.component.ts b/bookie/src/app/sales/products/products.component.ts index c2511d8..c9a9e85 100644 --- a/bookie/src/app/sales/products/products.component.ts +++ b/bookie/src/app/sales/products/products.component.ts @@ -11,7 +11,7 @@ import { BillService } from '../bill.service'; selector: 'app-products', templateUrl: './products.component.html', styleUrls: ['./products.component.sass'], - imports: [CurrencyPipe, MatCardModule, MatRippleModule, RouterLink], + imports: [CurrencyPipe, MatRippleModule, RouterLink, MatCardModule], }) export class ProductsComponent implements OnInit { private route = inject(ActivatedRoute); diff --git a/bookie/src/app/sales/running-tables/running-tables.component.html b/bookie/src/app/sales/running-tables/running-tables.component.html index 923f63b..db5eac0 100644 --- a/bookie/src/app/sales/running-tables/running-tables.component.html +++ b/bookie/src/app/sales/running-tables/running-tables.component.html @@ -1,32 +1,27 @@ - - - Running Tables - - -
    - @for (table of list; track table) { - -

    {{ table.name }}

    - {{ table.guest }} - {{ table.pax ?? '-' }} / {{ table.seats }} / {{ table.section?.name }} - @if (table.date) { - {{ table.date }} - } - @if (table.amount) { - {{ table.amount | currency: 'INR' }} - } -
    +

    Running Tables

    + +
    + @for (table of list; track table) { + +

    {{ table.name }}

    + {{ table.guest }} + {{ table.pax ?? '-' }} / {{ table.seats }} / {{ table.section?.name }} + @if (table.date) { + {{ table.date }} } - -

    Open Bill

    -
    -
    - - + @if (table.amount) { + {{ table.amount | currency: 'INR' }} + } + + } + +

    Open Bill

    +
    +
    diff --git a/bookie/src/app/sales/running-tables/running-tables.component.ts b/bookie/src/app/sales/running-tables/running-tables.component.ts index 6f489c7..b192167 100644 --- a/bookie/src/app/sales/running-tables/running-tables.component.ts +++ b/bookie/src/app/sales/running-tables/running-tables.component.ts @@ -3,25 +3,25 @@ import { Component, OnInit, inject } from '@angular/core'; import { MatCardModule } from '@angular/material/card'; import { MatRippleModule } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { map } from 'rxjs/operators'; import { Regime } from 'src/app/core/regime'; import { Table } from '../../core/table'; -import { ToasterService } from '../../core/toaster.service'; import { BillNumberComponent } from '../bill-number/bill-number.component'; @Component({ selector: 'app-running-tables', templateUrl: './running-tables.component.html', styleUrls: ['./running-tables.component.sass'], - imports: [CurrencyPipe, MatCardModule, MatRippleModule], + imports: [CurrencyPipe, MatRippleModule, MatCardModule], }) export class RunningTablesComponent implements OnInit { private dialog = inject(MatDialog); private router = inject(Router); private route = inject(ActivatedRoute); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); regimes: Regime[] = []; list: Table[] = []; @@ -61,7 +61,7 @@ export class RunningTablesComponent implements OnInit { ) .subscribe({ next: (x) => this.router.navigate(['/sales', 'bill'], { queryParams: { bill: x } }), - error: (x) => this.toaster.show('Error', x), + error: (x) => this.snackBar.open(x, 'Error'), }); } } diff --git a/bookie/src/app/sales/tables-dialog/tables-dialog.component.ts b/bookie/src/app/sales/tables-dialog/tables-dialog.component.ts index 06545d8..50e56d1 100644 --- a/bookie/src/app/sales/tables-dialog/tables-dialog.component.ts +++ b/bookie/src/app/sales/tables-dialog/tables-dialog.component.ts @@ -13,7 +13,7 @@ import { Table } from '../../core/table'; selector: 'app-tables-dialog', templateUrl: './tables-dialog.component.html', styleUrls: ['./tables-dialog.component.sass'], - imports: [CdkScrollableModule, CurrencyPipe, MatButtonModule, MatCardModule, MatDialogModule, MatRippleModule], + imports: [CdkScrollableModule, CurrencyPipe, MatButtonModule, MatDialogModule, MatRippleModule, MatCardModule], }) export class TablesDialogComponent { dialogRef = inject>(MatDialogRef); diff --git a/bookie/src/app/section-printers/section-printer.component.html b/bookie/src/app/section-printers/section-printer.component.html index 2dabdb0..1d792a2 100644 --- a/bookie/src/app/section-printers/section-printer.component.html +++ b/bookie/src/app/section-printers/section-printer.component.html @@ -1,69 +1,62 @@ - - - Printers for Section - - -
    -
    + +
    + + Section + + @for (s of sections; track s) { + + {{ s.name }} + + } + + +
    + + + + + Sale Category + {{ row.saleCategory?.name ?? 'Default' }} + + + + + Printer + - Section - - @for (s of sections; track s) { - - {{ s.name }} + Printer + + -- Default -- + @for (p of printers; track p) { + + {{ p.name }} } -
    - - - - - Sale Category - {{ row.saleCategory?.name ?? 'Default' }} - + + - - - Printer - - - Printer - - -- Default -- - @for (p of printers; track p) { - - {{ p.name }} - - } - - - - + + + Copies + + @if (!!$any(form.get('saleCategories')).at(i).value.printer) { + + Copies + + + } + + - - - Copies - - @if (!!$any(form.get('saleCategories')).at(i).value.printer) { - - Copies - - - } - - - - - - -
    -
    - - - @if (sectionId) { - - } - -
    + + + + +
    + + @if (sectionId) { + + } +
    diff --git a/bookie/src/app/section-printers/section-printer.component.ts b/bookie/src/app/section-printers/section-printer.component.ts index cf4ae8e..a3aeaf1 100644 --- a/bookie/src/app/section-printers/section-printer.component.ts +++ b/bookie/src/app/section-printers/section-printer.component.ts @@ -1,13 +1,13 @@ import { Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormArray, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatOptionModule } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; import { MatDividerModule } from '@angular/material/divider'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectChange, MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router } from '@angular/router'; import { BehaviorSubject } from 'rxjs'; @@ -16,7 +16,6 @@ import { map } from 'rxjs/operators'; import { Printer } from '../core/printer'; import { Section } from '../core/section'; import { SectionPrinter } from '../core/section-printer'; -import { ToasterService } from '../core/toaster.service'; import { ConfirmDialogComponent } from '../shared/confirm-dialog/confirm-dialog.component'; import { SectionPrinterDataSource } from './section-printer-datasource'; import { SectionPrinterService } from './section-printer.service'; @@ -27,7 +26,7 @@ import { SectionPrinterService } from './section-printer.service'; styleUrls: ['./section-printer.component.css'], imports: [ MatButtonModule, - MatCardModule, + MatDividerModule, MatFormFieldModule, MatInputModule, @@ -40,7 +39,7 @@ import { SectionPrinterService } from './section-printer.service'; export class SectionPrinterComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private dialog = inject(MatDialog); private ser = inject(SectionPrinterService); @@ -114,11 +113,11 @@ export class SectionPrinterComponent implements OnInit { save() { this.ser.save(this.sectionId, this.getItem()).subscribe({ next: (result: SectionPrinter[]) => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.showItem(result); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -126,10 +125,10 @@ export class SectionPrinterComponent implements OnInit { delete() { this.ser.delete(this.sectionId).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/sections/section-detail/section-detail.component.html b/bookie/src/app/sections/section-detail/section-detail.component.html index 4a19a0d..64f0fea 100644 --- a/bookie/src/app/sections/section-detail/section-detail.component.html +++ b/bookie/src/app/sections/section-detail/section-detail.component.html @@ -1,21 +1,16 @@ - - - Section - - -
    -
    - - Name - - -
    -
    -
    - - - @if (!!item.id) { - - } - -
    +

    Section

    +
    +
    + + Name + + +
    +
    + +
    + + @if (!!item.id) { + + } +
    diff --git a/bookie/src/app/sections/section-detail/section-detail.component.ts b/bookie/src/app/sections/section-detail/section-detail.component.ts index b6d6530..45b8366 100644 --- a/bookie/src/app/sections/section-detail/section-detail.component.ts +++ b/bookie/src/app/sections/section-detail/section-detail.component.ts @@ -1,14 +1,13 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { Section } from '../../core/section'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { SectionService } from '../section.service'; @@ -16,13 +15,13 @@ import { SectionService } from '../section.service'; selector: 'app-section-detail', templateUrl: './section-detail.component.html', styleUrls: ['./section-detail.component.css'], - imports: [MatButtonModule, MatCardModule, MatFormFieldModule, MatInputModule, ReactiveFormsModule], + imports: [MatButtonModule, MatFormFieldModule, MatInputModule, ReactiveFormsModule], }) export class SectionDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(SectionService); @ViewChild('nameElement', { static: true }) nameElement?: ElementRef; @@ -64,11 +63,11 @@ export class SectionDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/sections'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -76,11 +75,11 @@ export class SectionDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/sections'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/sections/section-list/section-list.component.html b/bookie/src/app/sections/section-list/section-list.component.html index 2692d0a..6de3c5c 100644 --- a/bookie/src/app/sections/section-list/section-list.component.html +++ b/bookie/src/app/sections/section-list/section-list.component.html @@ -1,25 +1,19 @@ - - - - Sections - - add_box - Add - - - - - - - - Name - {{ row.name }} - +

    + Sections + + add_box + Add + +

    + + + + Name + {{ row.name }} + - - - -
    -
    + + + diff --git a/bookie/src/app/sections/section-list/section-list.component.ts b/bookie/src/app/sections/section-list/section-list.component.ts index e3b3eab..d70a497 100644 --- a/bookie/src/app/sections/section-list/section-list.component.ts +++ b/bookie/src/app/sections/section-list/section-list.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, RouterLink } from '@angular/router'; @@ -12,7 +11,7 @@ import { SectionListDataSource } from './section-list-datasource'; selector: 'app-section-list', templateUrl: './section-list.component.html', styleUrls: ['./section-list.component.css'], - imports: [MatButtonModule, MatCardModule, MatIconModule, MatTableModule, RouterLink], + imports: [MatButtonModule, MatIconModule, MatTableModule, RouterLink], }) export class SectionListComponent implements OnInit { private route = inject(ActivatedRoute); diff --git a/bookie/src/app/settings/settings.component.ts b/bookie/src/app/settings/settings.component.ts index e4d47af..1c19f10 100644 --- a/bookie/src/app/settings/settings.component.ts +++ b/bookie/src/app/settings/settings.component.ts @@ -7,13 +7,13 @@ import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTabsModule } from '@angular/material/tabs'; import { ActivatedRoute, Router } from '@angular/router'; import moment from 'moment'; import { environment } from '../app.environment'; import { AuthService } from '../auth/auth.service'; -import { ToasterService } from '../core/toaster.service'; import { SettingsService } from './settings.service'; @Component({ @@ -29,13 +29,14 @@ import { SettingsService } from './settings.service'; MatSlideToggleModule, MatTabsModule, ReactiveFormsModule, + MatCardModule, ], }) export class SettingsComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); auth = inject(AuthService); private ser = inject(SettingsService); @@ -87,15 +88,15 @@ export class SettingsComponent implements OnInit { const finishDate = moment(formModel.finishDate).format('DD-MMM-YYYY'); if (!this.beerFile || !this.saleFile) { - this.toaster.show('Danger', 'Please choose both files first!'); + this.snackBar.open('Please choose both files first!', 'Danger'); return; } this.ser.runMaintenance(startDate, finishDate, this.beerFile, this.saleFile).subscribe({ next: () => { - this.toaster.show('Success', 'Maintenance done'); + this.snackBar.open('Maintenance done', 'Success'); }, error: (error) => { - this.toaster.show('Danger', error); + this.snackBar.open(error, 'Danger'); }, }); } diff --git a/bookie/src/app/settle-option/settle-option-detail/settle-option-detail.component.html b/bookie/src/app/settle-option/settle-option-detail/settle-option-detail.component.html index 1b227c6..51a1d74 100644 --- a/bookie/src/app/settle-option/settle-option-detail/settle-option-detail.component.html +++ b/bookie/src/app/settle-option/settle-option-detail/settle-option-detail.component.html @@ -1,44 +1,39 @@ - - - Settle Option - - -
    -
    - - Name - - -
    -
    - - Voucher Type - - @for (vt of voucherTypes; track vt) { - - {{ vt.name }} - - } - - - - Reporting Level - - @for (rl of reportingLevel; track rl) { - - {{ rl.name }} - - } - - - Has Reason? -
    -
    -
    - - - @if (!!item.id) { - - } - -
    +

    Settle Option

    +
    +
    + + Name + + +
    +
    + + Voucher Type + + @for (vt of voucherTypes; track vt) { + + {{ vt.name }} + + } + + + + Reporting Level + + @for (rl of reportingLevel; track rl) { + + {{ rl.name }} + + } + + + Has Reason? +
    +
    + +
    + + @if (!!item.id) { + + } +
    diff --git a/bookie/src/app/settle-option/settle-option-detail/settle-option-detail.component.ts b/bookie/src/app/settle-option/settle-option-detail/settle-option-detail.component.ts index 5731a2f..a715355 100644 --- a/bookie/src/app/settle-option/settle-option-detail/settle-option-detail.component.ts +++ b/bookie/src/app/settle-option/settle-option-detail/settle-option-detail.component.ts @@ -1,18 +1,17 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatOptionModule } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { ReportingLevel } from '../../core/reporting-level'; import { SettleOption } from '../../core/settle-option'; -import { ToasterService } from '../../core/toaster.service'; import { VoucherType } from '../../sales/bills/voucher-type'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { SettleOptionService } from '../settle-option.service'; @@ -23,7 +22,7 @@ import { SettleOptionService } from '../settle-option.service'; styleUrls: ['./settle-option-detail.component.css'], imports: [ MatButtonModule, - MatCardModule, + MatCheckboxModule, MatFormFieldModule, MatInputModule, @@ -36,7 +35,7 @@ export class SettleOptionDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(SettleOptionService); @ViewChild('nameElement', { static: true }) nameElement?: ElementRef; @@ -95,11 +94,11 @@ export class SettleOptionDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/settle-options'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -107,11 +106,11 @@ export class SettleOptionDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/settle-options'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/settle-option/settle-option-list/settle-option-list.component.html b/bookie/src/app/settle-option/settle-option-list/settle-option-list.component.html index 169e182..5af9852 100644 --- a/bookie/src/app/settle-option/settle-option-list/settle-option-list.component.html +++ b/bookie/src/app/settle-option/settle-option-list/settle-option-list.component.html @@ -1,49 +1,43 @@ - - - - Settle Options - - add_box - Add - - - - - - - - Name - {{ row.name }} - +

    + Settle Options + + add_box + Add + +

    + + + + Name + {{ row.name }} + - - - Voucher Type - {{ voucherType(row.voucherType) }} - + + + Voucher Type + {{ voucherType(row.voucherType) }} + - - - Reporting Level - {{ reportingLevel(row.reportingLevel) }} - + + + Reporting Level + {{ reportingLevel(row.reportingLevel) }} + - - - Has Reason? - {{ row.hasReason }} - + + + Has Reason? + {{ row.hasReason }} + - - - Fixture? - {{ row.isFixture }} - + + + Fixture? + {{ row.isFixture }} + - - - -
    -
    + + + diff --git a/bookie/src/app/settle-option/settle-option-list/settle-option-list.component.ts b/bookie/src/app/settle-option/settle-option-list/settle-option-list.component.ts index abf33c7..a400d53 100644 --- a/bookie/src/app/settle-option/settle-option-list/settle-option-list.component.ts +++ b/bookie/src/app/settle-option/settle-option-list/settle-option-list.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { BehaviorSubject } from 'rxjs'; @@ -9,7 +9,6 @@ import { map } from 'rxjs/operators'; import { ReportingLevel } from '../../core/reporting-level'; import { SettleOption } from '../../core/settle-option'; -import { ToasterService } from '../../core/toaster.service'; import { VoucherType } from '../../sales/bills/voucher-type'; import { SettleOptionService } from '../settle-option.service'; import { SettleOptionListDatasource } from './settle-option-list-datasource'; @@ -18,12 +17,12 @@ import { SettleOptionListDatasource } from './settle-option-list-datasource'; selector: 'app-settle-option-list', templateUrl: './settle-option-list.component.html', styleUrls: ['./settle-option-list.component.css'], - imports: [MatButtonModule, MatCardModule, MatIconModule, MatTableModule, RouterLink], + imports: [MatButtonModule, MatIconModule, MatTableModule, RouterLink], }) export class SettleOptionListComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(SettleOptionService); // @ViewChild('table', { static: true }) table?: MatTable; diff --git a/bookie/src/app/tables/table-detail/table-detail.component.html b/bookie/src/app/tables/table-detail/table-detail.component.html index 9d5d98a..daf342b 100644 --- a/bookie/src/app/tables/table-detail/table-detail.component.html +++ b/bookie/src/app/tables/table-detail/table-detail.component.html @@ -1,42 +1,37 @@ - - - Table - - -
    -
    - - Name - - -
    -
    - - Seats - - -
    -
    - - Section - - @for (s of sections; track s) { - - {{ s.name }} - - } - - -
    -
    - Is Active? -
    -
    -
    - - - @if (!!item.id) { - - } - -
    +

    Table

    +
    +
    + + Name + + +
    +
    + + Seats + + +
    +
    + + Section + + @for (s of sections; track s) { + + {{ s.name }} + + } + + +
    +
    + Is Active? +
    +
    + +
    + + @if (!!item.id) { + + } +
    diff --git a/bookie/src/app/tables/table-detail/table-detail.component.ts b/bookie/src/app/tables/table-detail/table-detail.component.ts index 3e89502..f1d986c 100644 --- a/bookie/src/app/tables/table-detail/table-detail.component.ts +++ b/bookie/src/app/tables/table-detail/table-detail.component.ts @@ -1,18 +1,17 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatOptionModule } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { Section } from '../../core/section'; import { Table } from '../../core/table'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { TableService } from '../table.service'; @@ -22,7 +21,7 @@ import { TableService } from '../table.service'; styleUrls: ['./table-detail.component.css'], imports: [ MatButtonModule, - MatCardModule, + MatCheckboxModule, MatFormFieldModule, MatInputModule, @@ -35,7 +34,7 @@ export class TableDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(TableService); @ViewChild('nameElement', { static: true }) nameElement?: ElementRef; @@ -88,11 +87,11 @@ export class TableDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/tables'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -100,11 +99,11 @@ export class TableDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/tables'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/tables/table-list/table-list.component.html b/bookie/src/app/tables/table-list/table-list.component.html index a860334..77d133e 100644 --- a/bookie/src/app/tables/table-list/table-list.component.html +++ b/bookie/src/app/tables/table-list/table-list.component.html @@ -1,51 +1,46 @@ - - - - Tables - - - add_box - Add - - - - - + Tables + + + add_box + Add + + + + + + + Name + {{ row.name }} - - - Name - {{ row.name }} - + - - - Seats - {{ row.seats }} - + + + Seats + {{ row.seats }} + - - - Section - {{ row.section.name }} - + + + Section + {{ row.section.name }} + - - - Is Active? - {{ row.isActive }} - + + + Is Active? + {{ row.isActive }} + - - - - - + + + diff --git a/bookie/src/app/tables/table-list/table-list.component.css b/bookie/src/app/tables/table-list/table-list.component.sass similarity index 100% rename from bookie/src/app/tables/table-list/table-list.component.css rename to bookie/src/app/tables/table-list/table-list.component.sass diff --git a/bookie/src/app/tables/table-list/table-list.component.ts b/bookie/src/app/tables/table-list/table-list.component.ts index 83a63a7..2cd8a11 100644 --- a/bookie/src/app/tables/table-list/table-list.component.ts +++ b/bookie/src/app/tables/table-list/table-list.component.ts @@ -1,27 +1,27 @@ import { CdkDragDrop, moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop'; import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; +import { MatToolbarModule } from '@angular/material/toolbar'; import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { BehaviorSubject } from 'rxjs'; import { Table } from '../../core/table'; -import { ToasterService } from '../../core/toaster.service'; import { TableService } from '../table.service'; import { TableListDataSource } from './table-list-datasource'; @Component({ selector: 'app-table-list', templateUrl: './table-list.component.html', - styleUrls: ['./table-list.component.css'], - imports: [DragDropModule, MatButtonModule, MatCardModule, MatIconModule, MatTableModule, RouterLink], + styleUrls: ['./table-list.component.sass'], + imports: [DragDropModule, MatButtonModule, MatIconModule, MatTableModule, RouterLink, MatToolbarModule], }) export class TableListComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(TableService); // @ViewChild('table', { static: true }) table?: MatTable; @@ -48,10 +48,10 @@ export class TableListComponent implements OnInit { updateSortOrder() { this.ser.updateSortOrder(this.list).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/tax-report/tax-report.component.html b/bookie/src/app/tax-report/tax-report.component.html index d563ec7..5b57794 100644 --- a/bookie/src/app/tax-report/tax-report.component.html +++ b/bookie/src/app/tax-report/tax-report.component.html @@ -1,69 +1,64 @@ - - - - Tax Report - - - - -
    -
    - - Start Date - - - - - - Finish Date - - - - - -
    - - - - - Name - {{ row.name }} - +

    + Tax Report + +

    - - - Rate - {{ row.taxRate | percent: '1.2-2' }} - +
    +
    + + Start Date + + + + + + Finish Date + + + + + +
    + + + + + Name + {{ row.name }} + - - - Sale - {{ row.saleAmount | currency: 'INR' }} - + + + Rate + {{ row.taxRate | percent: '1.2-2' }} + - - - Tax - {{ row.amount | currency: 'INR' }} - + + + Sale + {{ row.saleAmount | currency: 'INR' }} + - - - -
    -
    + + + Tax + {{ row.amount | currency: 'INR' }} + + + + + diff --git a/bookie/src/app/tax-report/tax-report.component.ts b/bookie/src/app/tax-report/tax-report.component.ts index 359baf4..4475288 100644 --- a/bookie/src/app/tax-report/tax-report.component.ts +++ b/bookie/src/app/tax-report/tax-report.component.ts @@ -2,7 +2,6 @@ import { PercentPipe, CurrencyPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; @@ -22,7 +21,7 @@ import { TaxReportDatasource } from './tax-report-datasource'; imports: [ CurrencyPipe, MatButtonModule, - MatCardModule, + MatDatepickerModule, MatFormFieldModule, MatIconModule, diff --git a/bookie/src/app/taxes/tax-detail/tax-detail.component.html b/bookie/src/app/taxes/tax-detail/tax-detail.component.html index cb577f5..922f8b8 100644 --- a/bookie/src/app/taxes/tax-detail/tax-detail.component.html +++ b/bookie/src/app/taxes/tax-detail/tax-detail.component.html @@ -1,41 +1,36 @@ - - - Tax - - -
    -
    - - Name - - Format for GST: ST GST @ x% (1/2) ; CGST @ x% (1/2) - -
    -
    - - Rate - - % - -
    -
    - - Regime - - @for (reg of regimes; track reg) { - - {{ reg.name }} - - } - - -
    - -
    - - - @if (!!item.id) { - - } - -
    +

    Tax

    + +
    + + Name + + Format for GST: ST GST @ x% (1/2) ; CGST @ x% (1/2) + +
    +
    + + Rate + + % + +
    +
    + + Regime + + @for (reg of regimes; track reg) { + + {{ reg.name }} + + } + + +
    + + +
    + + @if (!!item.id) { + + } +
    diff --git a/bookie/src/app/taxes/tax-detail/tax-detail.component.ts b/bookie/src/app/taxes/tax-detail/tax-detail.component.ts index 5594032..f9096dd 100644 --- a/bookie/src/app/taxes/tax-detail/tax-detail.component.ts +++ b/bookie/src/app/taxes/tax-detail/tax-detail.component.ts @@ -1,18 +1,17 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatOptionModule } from '@angular/material/core'; import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import { round } from 'mathjs'; import { Regime } from 'src/app/core/regime'; import { Tax } from '../../core/tax'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { TaxService } from '../tax.service'; @@ -20,21 +19,13 @@ import { TaxService } from '../tax.service'; selector: 'app-tax-detail', templateUrl: './tax-detail.component.html', styleUrls: ['./tax-detail.component.css'], - imports: [ - MatButtonModule, - MatCardModule, - MatFormFieldModule, - MatInputModule, - MatOptionModule, - MatSelectModule, - ReactiveFormsModule, - ], + imports: [MatButtonModule, MatFormFieldModule, MatInputModule, MatOptionModule, MatSelectModule, ReactiveFormsModule], }) export class TaxDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(TaxService); @ViewChild('nameElement', { static: true }) nameElement?: ElementRef; @@ -84,11 +75,11 @@ export class TaxDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/taxes'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -96,11 +87,11 @@ export class TaxDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/taxes'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/taxes/tax-list/tax-list.component.html b/bookie/src/app/taxes/tax-list/tax-list.component.html index 1855d4f..745dfc6 100644 --- a/bookie/src/app/taxes/tax-list/tax-list.component.html +++ b/bookie/src/app/taxes/tax-list/tax-list.component.html @@ -1,43 +1,37 @@ - - - - Taxes - - add_box - Add - - - - - - - - Name - {{ row.name }} - +

    + Taxes + + add_box + Add + +

    + + + + Name + {{ row.name }} + - - - Rate - {{ row.rate | percent: '1.2-2' }} - + + + Rate + {{ row.rate | percent: '1.2-2' }} + - - - Regime - {{ row.regime.name }} - + + + Regime + {{ row.regime.name }} + - - - Is Fixture? - {{ row.isFixture }} - + + + Is Fixture? + {{ row.isFixture }} + - - - -
    -
    + + + diff --git a/bookie/src/app/taxes/tax-list/tax-list.component.ts b/bookie/src/app/taxes/tax-list/tax-list.component.ts index 30d3704..6a2adf3 100644 --- a/bookie/src/app/taxes/tax-list/tax-list.component.ts +++ b/bookie/src/app/taxes/tax-list/tax-list.component.ts @@ -1,7 +1,6 @@ import { PercentPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, RouterLink } from '@angular/router'; @@ -13,7 +12,7 @@ import { TaxListDataSource } from './tax-list-datasource'; selector: 'app-tax-list', templateUrl: './tax-list.component.html', styleUrls: ['./tax-list.component.css'], - imports: [MatButtonModule, MatCardModule, MatIconModule, MatTableModule, PercentPipe, RouterLink], + imports: [MatButtonModule, MatIconModule, MatTableModule, PercentPipe, RouterLink], }) export class TaxListComponent implements OnInit { private route = inject(ActivatedRoute); diff --git a/bookie/src/app/temporal-product/temporal-product-detail/temporal-product-detail.component.html b/bookie/src/app/temporal-product/temporal-product-detail/temporal-product-detail.component.html index c14c243..4b8f110 100644 --- a/bookie/src/app/temporal-product/temporal-product-detail/temporal-product-detail.component.html +++ b/bookie/src/app/temporal-product/temporal-product-detail/temporal-product-detail.component.html @@ -1,79 +1,74 @@ - - - Product - - -
    -
    - - Product ID - - -
    -
    - - Name - - - - Units - - -
    -
    - - Price - - - - Quantity - - -
    -
    - Has Happy Hour? - Is Not Available? -
    -
    - - Menu Category - - @for (mc of menuCategories; track mc) { - - {{ mc.name }} - - } - - - - Sale Category - - @for (sc of saleCategories; track sc) { - - {{ sc.name }} - - } - - -
    -
    - - Valid From - - - - - - Valid Till - - - - -
    - -
    - - - - -
    +

    Product

    + +
    + + Product ID + + +
    +
    + + Name + + + + Units + + +
    +
    + + Price + + + + Quantity + + +
    +
    + Has Happy Hour? + Is Not Available? +
    +
    + + Menu Category + + @for (mc of menuCategories; track mc) { + + {{ mc.name }} + + } + + + + Sale Category + + @for (sc of saleCategories; track sc) { + + {{ sc.name }} + + } + + +
    +
    + + Valid From + + + + + + Valid Till + + + + +
    + + +
    + + +
    diff --git a/bookie/src/app/temporal-product/temporal-product-detail/temporal-product-detail.component.ts b/bookie/src/app/temporal-product/temporal-product-detail/temporal-product-detail.component.ts index 5d6d4ec..afd8ca7 100644 --- a/bookie/src/app/temporal-product/temporal-product-detail/temporal-product-detail.component.ts +++ b/bookie/src/app/temporal-product/temporal-product-detail/temporal-product-detail.component.ts @@ -1,7 +1,6 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatOptionModule } from '@angular/material/core'; import { MatDatepickerModule } from '@angular/material/datepicker'; @@ -9,13 +8,13 @@ import { MatDialog } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; import moment from 'moment'; import { MenuCategory } from '../../core/menu-category'; import { Product } from '../../core/product'; import { SaleCategory } from '../../core/sale-category'; -import { ToasterService } from '../../core/toaster.service'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { TemporalProductService } from '../temporal-product.service'; @@ -25,12 +24,13 @@ import { TemporalProductService } from '../temporal-product.service'; styleUrls: ['./temporal-product-detail.component.css'], imports: [ MatButtonModule, - MatCardModule, + MatCheckboxModule, MatDatepickerModule, MatFormFieldModule, MatInputModule, MatOptionModule, + MatSelectModule, ReactiveFormsModule, ], @@ -39,7 +39,7 @@ export class TemporalProductDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); private dialog = inject(MatDialog); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(TemporalProductService); @ViewChild('name', { static: true }) nameElement?: ElementRef; @@ -119,11 +119,11 @@ export class TemporalProductDetailComponent implements OnInit, AfterViewInit { update() { this.ser.update(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/temporal-products'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -131,11 +131,11 @@ export class TemporalProductDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.versionId as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/temporal-products'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/temporal-product/temporal-product-list/temporal-product-list.component.html b/bookie/src/app/temporal-product/temporal-product-list/temporal-product-list.component.html index be17234..b46b310 100644 --- a/bookie/src/app/temporal-product/temporal-product-list/temporal-product-list.component.html +++ b/bookie/src/app/temporal-product/temporal-product-list/temporal-product-list.component.html @@ -1,105 +1,101 @@ - - - Temporal Products - - -
    -
    - - Filter - - - - Menu Category - - -- All Products -- - @for (mc of menuCategories; track mc) { - - {{ mc.name }} - - } - - - - Sale Category - - -- All Products -- - @for (mc of saleCategories; track mc) { - - {{ mc.name }} - - } - - -
    - - - - - Name - - - - +

    + Temporal Products +

    +
    +
    + + Filter + + + + Menu Category + + -- All Products -- + @for (mc of menuCategories; track mc) { + + {{ mc.name }} + + } + + + + Sale Category + + -- All Products -- + @for (mc of saleCategories; track mc) { + + {{ mc.name }} + + } + + +
    + + + + + Name + + + + - - - Price - {{ row.price | currency: 'INR' }} - + + + Price + {{ row.price | currency: 'INR' }} + - - - Menu Category - {{ row.menuCategory.name }} - + + + Menu Category + {{ row.menuCategory.name }} + - - - Sale Category - {{ row.saleCategory.name }} - + + + Sale Category + {{ row.saleCategory.name }} + - - - Details - -
      -
    • - Valid From: {{ row.validFrom ?? '∞' }} linear_scale - Till: {{ row.validTill ?? '∞' }} -
    • -
    • - - {{ row.hasHappyHour ? 'sentiment_satisfied_alt' : 'sentiment_dissatisfied' }} - - {{ row.hasHappyHour ? 'Has Happy Hours' : 'No Happy Hours' }} -
    • -
    • - - {{ row.isNotAvailable ? 'pause' : 'play_arrow' }} - - {{ row.isNotAvailable ? 'Is not Available' : 'Is Available' }} -
    • -
    -
    -
    + + + Details + +
      +
    • + Valid From: {{ row.validFrom ?? '∞' }} linear_scale + Till: {{ row.validTill ?? '∞' }} +
    • +
    • + + {{ row.hasHappyHour ? 'sentiment_satisfied_alt' : 'sentiment_dissatisfied' }} + + {{ row.hasHappyHour ? 'Has Happy Hours' : 'No Happy Hours' }} +
    • +
    • + + {{ row.isNotAvailable ? 'pause' : 'play_arrow' }} + + {{ row.isNotAvailable ? 'Is not Available' : 'Is Available' }} +
    • +
    +
    +
    - - - Quantity - {{ row.quantity | number: '1.2-2' }} - + + + Quantity + {{ row.quantity | number: '1.2-2' }} + - - -
    -
    -
    + + + diff --git a/bookie/src/app/temporal-product/temporal-product-list/temporal-product-list.component.ts b/bookie/src/app/temporal-product/temporal-product-list/temporal-product-list.component.ts index 3a03eb2..1fd31b4 100644 --- a/bookie/src/app/temporal-product/temporal-product-list/temporal-product-list.component.ts +++ b/bookie/src/app/temporal-product/temporal-product-list/temporal-product-list.component.ts @@ -1,7 +1,6 @@ import { DecimalPipe, CurrencyPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; -import { MatCardModule } from '@angular/material/card'; import { MatOptionModule } from '@angular/material/core'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; @@ -24,7 +23,7 @@ import { TemporalProductListDatasource } from './temporal-product-list-datasourc imports: [ CurrencyPipe, DecimalPipe, - MatCardModule, + MatFormFieldModule, MatIconModule, MatInputModule, diff --git a/bookie/src/app/update-product-prices/update-product-prices.component.html b/bookie/src/app/update-product-prices/update-product-prices.component.html index 79ab870..b937e82 100644 --- a/bookie/src/app/update-product-prices/update-product-prices.component.html +++ b/bookie/src/app/update-product-prices/update-product-prices.component.html @@ -1,64 +1,60 @@ - - - - Product Update Report - - - - -
    -
    - - Date - - - +

    + Product Update Report + +

    + + +
    + + Date + + + + + + Menu Category + + @for (s of menuCategories; track s) { + + {{ s.name }} + + } + + + +
    + + + + Name + {{ row.name }} + + + + + Old Price + {{ row.oldPrice | currency: 'INR' }} + + + + + New Price + + + New Price + + ₹  - - Menu Category - - @for (s of menuCategories; track s) { - - {{ s.name }} - - } - - - -
    - - - - Name - {{ row.name }} - + + - - - Old Price - {{ row.oldPrice | currency: 'INR' }} - + + + + - - - New Price - - - New Price - - ₹  - - - - - - - - -
    - - - -
    +
    + +
    diff --git a/bookie/src/app/update-product-prices/update-product-prices.component.ts b/bookie/src/app/update-product-prices/update-product-prices.component.ts index cb13594..f859fd9 100644 --- a/bookie/src/app/update-product-prices/update-product-prices.component.ts +++ b/bookie/src/app/update-product-prices/update-product-prices.component.ts @@ -2,20 +2,19 @@ import { CurrencyPipe } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; import { FormArray, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatOptionModule } from '@angular/material/core'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, Router } from '@angular/router'; import moment from 'moment'; import { map } from 'rxjs/operators'; import { MenuCategory } from '../core/menu-category'; -import { ToasterService } from '../core/toaster.service'; import { ToCsvService } from '../shared/to-csv.service'; import { UpdateProductPrices } from './update-product-prices'; import { UpdateProductPricesDataSource } from './update-product-prices-datasource'; @@ -28,7 +27,7 @@ import { UpdateProductPricesService } from './update-product-prices.service'; imports: [ CurrencyPipe, MatButtonModule, - MatCardModule, + MatDatepickerModule, MatFormFieldModule, MatIconModule, @@ -43,7 +42,7 @@ export class UpdateProductPricesComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); private toCsv = inject(ToCsvService); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private ser = inject(UpdateProductPricesService); info: UpdateProductPrices = new UpdateProductPrices(); @@ -152,11 +151,11 @@ export class UpdateProductPricesComponent implements OnInit { save() { this.ser.save(this.getInfo()).subscribe({ next: (result: UpdateProductPrices) => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.loadData(result); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/users/user-detail/user-detail.component.html b/bookie/src/app/users/user-detail/user-detail.component.html index 7445d09..6cab616 100644 --- a/bookie/src/app/users/user-detail/user-detail.component.html +++ b/bookie/src/app/users/user-detail/user-detail.component.html @@ -1,37 +1,32 @@ - - - User - - -
    -
    - - Name - - +

    User

    + +
    + + Name + + +
    +
    + + Password + + {{ hide ? 'visibility' : 'visibility_off' }} + +
    +
    + Is Locked Out? +
    + +
    + @for (r of item.roles; track r; let i = $index) { +
    + {{ r.name }}
    -
    - - Password - - {{ hide ? 'visibility' : 'visibility_off' }} - -
    -
    - Is Locked Out? -
    - -
    - @for (r of item.roles; track r; let i = $index) { -
    - {{ r.name }} -
    - } -
    - - - - - - - + } +
    + + +
    + + +
    diff --git a/bookie/src/app/users/user-detail/user-detail.component.ts b/bookie/src/app/users/user-detail/user-detail.component.ts index a94faca..fad4b2d 100644 --- a/bookie/src/app/users/user-detail/user-detail.component.ts +++ b/bookie/src/app/users/user-detail/user-detail.component.ts @@ -1,16 +1,15 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; import { FormArray, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatDialog } from '@angular/material/dialog'; import { MatDividerModule } from '@angular/material/divider'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; +import { MatSnackBar } from '@angular/material/snack-bar'; import { ActivatedRoute, Router } from '@angular/router'; -import { ToasterService } from '../../core/toaster.service'; import { User } from '../../core/user'; import { ConfirmDialogComponent } from '../../shared/confirm-dialog/confirm-dialog.component'; import { UserService } from '../user.service'; @@ -21,7 +20,7 @@ import { UserService } from '../user.service'; styleUrls: ['./user-detail.component.css'], imports: [ MatButtonModule, - MatCardModule, + MatCheckboxModule, MatDividerModule, MatFormFieldModule, @@ -33,7 +32,7 @@ import { UserService } from '../user.service'; export class UserDetailComponent implements OnInit, AfterViewInit { private route = inject(ActivatedRoute); private router = inject(Router); - private toaster = inject(ToasterService); + private snackBar = inject(MatSnackBar); private dialog = inject(MatDialog); private ser = inject(UserService); @@ -96,7 +95,7 @@ export class UserDetailComponent implements OnInit, AfterViewInit { save() { this.ser.saveOrUpdate(this.getItem()).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); if ((this.item.id as string) === 'me') { this.router.navigateByUrl('/'); } else { @@ -104,7 +103,7 @@ export class UserDetailComponent implements OnInit, AfterViewInit { } }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } @@ -112,11 +111,11 @@ export class UserDetailComponent implements OnInit, AfterViewInit { delete() { this.ser.delete(this.item.id as string).subscribe({ next: () => { - this.toaster.show('Success', ''); + this.snackBar.open('', 'Success'); this.router.navigateByUrl('/users'); }, error: (error) => { - this.toaster.show('Error', error); + this.snackBar.open(error, 'Error'); }, }); } diff --git a/bookie/src/app/users/user-list/user-list.component.html b/bookie/src/app/users/user-list/user-list.component.html index 85c1725..cbd8be2 100644 --- a/bookie/src/app/users/user-list/user-list.component.html +++ b/bookie/src/app/users/user-list/user-list.component.html @@ -1,51 +1,45 @@ - - - - Users - - add_box - Add - - - - - - - - Name - {{ row.name }} - +

    + Users + + add_box + Add + +

    + + + + Name + {{ row.name }} + - - - Is Locked Out? - {{ row.lockedOut }} - + + + Is Locked Out? + {{ row.lockedOut }} + - - - Roles - -
      - @for (role of row.roles; track role) { -
    • {{ role }}
    • - } -
    -
    -
    + + + Roles + +
      + @for (role of row.roles; track role) { +
    • {{ role }}
    • + } +
    +
    +
    - - - Last Login - {{ row.lastDevice }} @ {{ row.lastDate ? (row.lastDate | localTime) : 'Never' }} - + + + Last Login + {{ row.lastDevice }} @ {{ row.lastDate ? (row.lastDate | localTime) : 'Never' }} + - - -
    -
    -
    + + + diff --git a/bookie/src/app/users/user-list/user-list.component.ts b/bookie/src/app/users/user-list/user-list.component.ts index 103c35e..c4a3fc4 100644 --- a/bookie/src/app/users/user-list/user-list.component.ts +++ b/bookie/src/app/users/user-list/user-list.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit, inject } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; -import { MatCardModule } from '@angular/material/card'; import { MatIconModule } from '@angular/material/icon'; import { MatTableModule } from '@angular/material/table'; import { ActivatedRoute, RouterLink } from '@angular/router'; @@ -13,7 +12,7 @@ import { UserListDataSource } from './user-list-datasource'; selector: 'app-user-list', templateUrl: './user-list.component.html', styleUrls: ['./user-list.component.css'], - imports: [LocalTimePipe, MatButtonModule, MatCardModule, MatIconModule, MatTableModule, RouterLink], + imports: [LocalTimePipe, MatButtonModule, MatIconModule, MatTableModule, RouterLink], }) export class UserListComponent implements OnInit { private route = inject(ActivatedRoute); diff --git a/bookie/src/styles.sass b/bookie/src/styles.sass index bbfaf02..69f8be3 100644 --- a/bookie/src/styles.sass +++ b/bookie/src/styles.sass @@ -1,4 +1,6 @@ /* You can add global styles to this file, and also import other style files */ +@use 'sass:color' +@use 'sass:math' @use 'sass:map' @use '@angular/material' as mat @tailwind base @@ -7,6 +9,33 @@ @include mat.core() +@function get-on-color($background) + $r: math.div(color.channel($background, "red", $space: rgb), 255) + $g: math.div(color.channel($background, "green", $space: rgb), 255) + $b: math.div(color.channel($background, "blue", $space: rgb), 255) + $l: 0.2126 * $r + 0.7152 * $g + 0.0722 * $b + + @if ($l > 0.5) + @return #000 + @else + @return #fff + + +html + // color-scheme: light dark + @include mat.theme(( + color: ( + primary: mat.$azure-palette, + tertiary: mat.$blue-palette, + // theme-type: light, + ), + typography: ( + plain-family: Roboto, + brankd-family: Roboto + ), + density: 0 + )) + html, body height: 100% @@ -48,13 +77,17 @@ a .row-container display: flex flex-direction: row + align-items: center gap: 20px // sets 20px space between all children -$my-primary: mat.m2-define-palette(mat.$m2-indigo-palette, 500) -$my-accent: mat.m2-define-palette(mat.$m2-amber-palette, A200, A100, A400) -/* The "warn" palette is optional and defaults to red if not specified.*/ -$my-warn: mat.m2-define-palette(mat.$m2-red-palette) -$my-disabled: mat.m2-define-palette(mat.$m2-grey-palette, 500) +.space-between + justify-content: space-between + +.spacer + flex: 1 1 auto + + + .square-button min-width: 150px @@ -75,42 +108,44 @@ $my-disabled: mat.m2-define-palette(mat.$m2-grey-palette, 500) .warn background-color: red +button.mat-primary + background: var(--mat-sys-primary) !important + color: var(--mat-sys-on-primary) !important + +button.mat-warn + background: var(--mat-sys-error) !important + color: var(--mat-sys-on-error) !important + .square-button.primary - /* Read the 500 hue from the primary color palete.*/ - color: mat.m2-get-color-from-palette($my-primary, '200-contrast') - background: mat.m2-get-color-from-palette($my-primary, 200) + $sbp: map.get(mat.$violet-palette, 70) + color: get-on-color($sbp) !important + background: $sbp !important .square-button.strong-primary - /* Read the 500 hue from the primary color palete.*/ - color: mat.m2-get-color-from-palette($my-primary, '700-contrast') - background: mat.m2-get-color-from-palette($my-primary, 700) + $sbsp: map.get(mat.$violet-palette, 20) + color: get-on-color($sbsp) !important + background: $sbsp !important -.square-button.accent - /* Read the 500 hue from the primary color palete.*/ - color: mat.m2-get-color-from-palette($my-accent, '200-contrast') - background: mat.m2-get-color-from-palette($my-accent, 200) +.accent + $a: map.get(mat.$orange-palette, 70) + color: get-on-color($a) !important + background: $a !important -.square-button.strong-accent - /* Read the 500 hue from the primary color palete.*/ - color: mat.m2-get-color-from-palette($my-accent, '700-contrast') - background: mat.m2-get-color-from-palette($my-accent, 700) +.strong-accent + $sa: map.get(mat.$orange-palette, 20) + color: get-on-color($sa) !important + background: $sa !important .square-button.warn - /* Read the 500 hue from the primary color palete.*/ - color: mat.m2-get-color-from-palette($my-warn, '700-contrast') - background: mat.m2-get-color-from-palette($my-warn, 700) + $sbw: map.get(mat.$red-palette, 70) + color: get-on-color($sbw) !important + background: $sbw !important .square-button.strong-warn - /* Read the 500 hue from the primary color palete.*/ - color: mat.m2-get-color-from-palette($my-warn, '700-contrast') - background: mat.m2-get-color-from-palette($my-warn, 700) + $sbsw: map.get(mat.$red-palette, 20) + color: get-on-color($sbsw) !important + background: $sbsw !important .square-button.disabled - /* Read the 500 hue from the primary color palete.*/ - color: mat.m2-get-color-from-palette($my-disabled, '500-contrast') - background: mat.m2-get-color-from-palette($my-disabled, 500) - -.square-button.strong-disabled - /* Read the 500 hue from the primary color palete.*/ - color: mat.m2-get-color-from-palette($my-disabled, '800-contrast') - background: mat.m2-get-color-from-palette($my-disabled, 800) + color: var(--mat-sys-on-outline) !important + background: var(--mat-sys-outline) !important