Chore: Moved from css to sass, god knows what to do now.

Chore: Prettier line length changed to 120 from 100
Fix: Hard coded the face as the primary color to make the buttons stand out
This commit is contained in:
2023-03-13 23:52:44 +05:30
parent b021861ba3
commit efa2af396d
123 changed files with 313 additions and 836 deletions

View File

@ -3,17 +3,9 @@
<mat-card-title>Bill</mat-card-title>
</mat-card-header>
<mat-card-content>
<table
mat-table
#table
[dataSource]="dataSource"
aria-label="Elements"
class="mat-elevation-z8"
>
<table mat-table #table [dataSource]="dataSource" aria-label="Elements" class="mat-elevation-z8">
<ng-container matColumnDef="bill-no-title">
<mat-header-cell *matHeaderCellDef class="deep-purple-200 bold"
>Bill / KOT number</mat-header-cell
>
<mat-header-cell *matHeaderCellDef class="deep-purple-200 bold">Bill / KOT number</mat-header-cell>
</ng-container>
<ng-container matColumnDef="bill-no-details">
<mat-header-cell *matHeaderCellDef class="deep-purple-200 bold right-align"
@ -28,18 +20,12 @@
<ng-container matColumnDef="time-details">
<mat-header-cell *matHeaderCellDef class="deep-purple-100 bold right-align"
><span [matTooltip]="bs.bill.dateTip">{{ bs.bill.date }}</span
>&nbsp;/&nbsp;<span [matTooltip]="bs.bill.creationDateTip">{{
bs.bill.creationDate
}}</span
>&nbsp;/&nbsp;<span [matTooltip]="bs.bill.lastEditDateTip">{{
bs.bill.lastEditDate
}}</span></mat-header-cell
>&nbsp;/&nbsp;<span [matTooltip]="bs.bill.creationDateTip">{{ bs.bill.creationDate }}</span
>&nbsp;/&nbsp;<span [matTooltip]="bs.bill.lastEditDateTip">{{ bs.bill.lastEditDate }}</span></mat-header-cell
>
</ng-container>
<ng-container matColumnDef="table-title">
<mat-header-cell *matHeaderCellDef class="deep-purple-50 bold"
>Table / Pax / Customer</mat-header-cell
>
<mat-header-cell *matHeaderCellDef class="deep-purple-50 bold">Table / Pax / Customer</mat-header-cell>
</ng-container>
<ng-container matColumnDef="table-details">
<mat-header-cell *matHeaderCellDef class="deep-purple-50 bold right-align"
@ -73,7 +59,7 @@
</ng-container>
<!-- Info Column -->
<ng-container matColumnDef="info">
<mat-cell *matCellDef="let row" [class.blue800]="row.isNewKot">
<mat-cell *matCellDef="let row">
<span>
{{ row.info }}
</span>
@ -86,52 +72,22 @@
<ng-container matColumnDef="quantity">
<mat-header-cell *matHeaderCellDef>Quantity</mat-header-cell>
<mat-cell *matCellDef="let row" class="right-align">
<button
mat-icon-button
(click)="subtractOne(row)"
[disabled]="row.isPrinted"
*ngIf="!row.isKot"
>
<button mat-icon-button (click)="subtractOne(row)" [disabled]="row.isPrinted" *ngIf="!row.isKot">
<mat-icon class="del">indeterminate_check_box</mat-icon>
</button>
<button
mat-icon-button
(click)="quantity(row)"
[disabled]="rowQuantityDisabled(row)"
*ngIf="!row.isKot"
>
<button mat-icon-button (click)="quantity(row)" [disabled]="rowQuantityDisabled(row)" *ngIf="!row.isKot">
{{ row.quantity }}
</button>
<button
mat-icon-button
(click)="addOne(row)"
[disabled]="row.isPrinted"
*ngIf="!row.isKot"
>
<button mat-icon-button (click)="addOne(row)" [disabled]="row.isPrinted" *ngIf="!row.isKot">
<mat-icon class="del">control_point</mat-icon>
</button>
<button
mat-icon-button
(click)="removeItem(row)"
[disabled]="row.isPrinted"
*ngIf="!row.isKot"
>
<button mat-icon-button (click)="removeItem(row)" [disabled]="row.isPrinted" *ngIf="!row.isKot">
<mat-icon class="del">cancel</mat-icon>
</button>
<button
mat-icon-button
(click)="modifier(row)"
[disabled]="row.isPrinted"
*ngIf="!row.isKot"
>
<button mat-icon-button (click)="modifier(row)" [disabled]="row.isPrinted" *ngIf="!row.isKot">
<mat-icon class="del">assignment</mat-icon>
</button>
<button
mat-icon-button
(click)="moveKot(row)"
[disabled]="row.isKot && !row.kotId"
*ngIf="row.isKot"
>
<button mat-icon-button (click)="moveKot(row)" [disabled]="row.isKot && !row.kotId" *ngIf="row.isKot">
<mat-icon class="del">open_in_new</mat-icon>
</button>
</mat-cell>
@ -145,9 +101,7 @@
}}</mat-footer-cell>
</ng-container>
<ng-container matColumnDef="hh-title">
<mat-footer-cell *matFooterCellDef class="grey300 bold"
>Happy Hour Discount</mat-footer-cell
>
<mat-footer-cell *matFooterCellDef class="grey300 bold">Happy Hour Discount</mat-footer-cell>
</ng-container>
<ng-container matColumnDef="hh-amount">
<mat-footer-cell *matFooterCellDef class="grey300 bold right-align">{{

View File

@ -76,7 +76,8 @@ export class BillsComponent implements OnInit {
chooseCustomer() {
const dialogRef = this.dialog.open(ChooseCustomerComponent, {
// width: '750px',
maxWidth: '100%',
width: '50%',
data: this.bs.bill.customer?.id,
});

View File

@ -25,11 +25,7 @@ export class VoucherService {
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Bill>;
}
getFromTable(
tableId: string,
voucherId: string | null,
guestId: string | null,
): Observable<Bill> {
getFromTable(tableId: string, voucherId: string | null, guestId: string | null): Observable<Bill> {
let params = new HttpParams();
if (voucherId !== null) {
params = params.set('v', voucherId);
@ -53,17 +49,10 @@ export class VoucherService {
getFromBill(billId: string): Observable<Bill> {
return this.http
.get<Bill>(`${url}/from-bill/${billId}`)
.pipe(
catchError(this.log.handleError(serviceName, `getFromBill billId=${billId}`)),
) as Observable<Bill>;
.pipe(catchError(this.log.handleError(serviceName, `getFromBill billId=${billId}`))) as Observable<Bill>;
}
save(
voucher: Bill,
voucherType: VoucherType,
guestBookId: string | null,
updateTable: boolean,
): Observable<boolean> {
save(voucher: Bill, voucherType: VoucherType, guestBookId: string | null, updateTable: boolean): Observable<boolean> {
const options = {
params: new HttpParams().set('p', voucherType.toString()).set('u', updateTable.toString()),
};
@ -169,9 +158,7 @@ export class VoucherService {
kotId,
tableId: table.id,
})
.pipe(
catchError(this.log.handleError(serviceName, 'moveKotToNewTable')),
) as Observable<boolean>;
.pipe(catchError(this.log.handleError(serviceName, 'moveKotToNewTable'))) as Observable<boolean>;
}
mergeKotWithOldBill(id: string, kotId: string, table: Table): Observable<boolean> {
@ -182,9 +169,7 @@ export class VoucherService {
tableId: table.id,
newVoucherId: table.voucherId,
})
.pipe(
catchError(this.log.handleError(serviceName, 'mergeKotWithOldBill')),
) as Observable<boolean>;
.pipe(catchError(this.log.handleError(serviceName, 'mergeKotWithOldBill'))) as Observable<boolean>;
}
splitBill(id: string, inventoriesToMove: string[], table: Table, updateTable: boolean) {