fasd
This commit is contained in:
@@ -9,10 +9,9 @@ import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Router } from '@angular/router';
|
||||
import moment from 'moment';
|
||||
|
||||
import { SaleCategory } from '../core/sale-category';
|
||||
import { SaleCategoryService } from '../sale-category/sale-category.service';
|
||||
import { ToCsvService } from '../shared/to-csv.service';
|
||||
import { BeerSaleExportHeaderInterface } from './beer-sale-export-header-interface';
|
||||
@@ -48,7 +47,6 @@ export interface BeerSaleReportFormData {
|
||||
})
|
||||
export class BeerSaleReportComponent {
|
||||
private router = inject(Router);
|
||||
private route = inject(ActivatedRoute);
|
||||
private toCsv = inject(ToCsvService);
|
||||
private ser = inject(BeerSaleReportService);
|
||||
private saleCategoryService = inject(SaleCategoryService);
|
||||
@@ -125,22 +123,13 @@ export class BeerSaleReportComponent {
|
||||
});
|
||||
}
|
||||
|
||||
filterOn(id: string) {
|
||||
const sc = this.saleCategories().find((x: SaleCategory) => x.id === id);
|
||||
const currentInfo = this.info();
|
||||
if (currentInfo) {
|
||||
currentInfo.saleCategory = sc ? sc : new SaleCategory({ id });
|
||||
}
|
||||
}
|
||||
|
||||
getInfo(): BeerSaleReport {
|
||||
const formModel = this.formModel();
|
||||
const currentInfo = this.info();
|
||||
|
||||
return new BeerSaleReport({
|
||||
startDate: moment(formModel.startDate).format('DD-MMM-YYYY'),
|
||||
finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'),
|
||||
saleCategory: currentInfo?.saleCategory,
|
||||
saleCategory: this.saleCategories().find((sc) => sc.id === formModel.saleCategory),
|
||||
regular: formModel.regular,
|
||||
happy: formModel.happy,
|
||||
staff: formModel.staff,
|
||||
|
||||
Reference in New Issue
Block a user