Fix: Recipe now checks for recursion (hopefully)
Feature: Recipe prices are now calculated based on periods and saved Feature: The recipe export excel now has prices
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
<mat-card-header>
|
||||
<mat-card-title-group>
|
||||
<mat-card-title>Recipes</mat-card-title>
|
||||
<a mat-icon-button href="{{ excelLink() }}">
|
||||
<a mat-icon-button [href]="'/api/recipes/xlsx?t=' + period.id">
|
||||
<mat-icon>save_alt</mat-icon>
|
||||
</a>
|
||||
<a mat-button [routerLink]="['/recipes', 'new']">
|
||||
|
||||
@ -31,6 +31,7 @@ export class RecipeListComponent implements OnInit {
|
||||
list: Recipe[] = [];
|
||||
data: BehaviorSubject<Recipe[]> = new BehaviorSubject<Recipe[]>([]);
|
||||
dataSource: RecipeListDatasource = new RecipeListDatasource(this.productGroupFilter, this.data);
|
||||
period: Period = new Period();
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['name', 'yield', 'date', 'source'];
|
||||
@ -44,13 +45,14 @@ export class RecipeListComponent implements OnInit {
|
||||
productGroup: new FormControl<ProductGroup | string | null>(null),
|
||||
});
|
||||
// Listen to Payment Account Change
|
||||
this.form.controls.period.valueChanges.subscribe((x) =>
|
||||
this.form.controls.period.valueChanges.subscribe((x) => {
|
||||
this.router.navigate([], {
|
||||
relativeTo: this.route,
|
||||
queryParams: { p: x.id },
|
||||
replaceUrl: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
this.period = x;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@ -73,8 +75,4 @@ export class RecipeListComponent implements OnInit {
|
||||
filterProductGroup(val: string) {
|
||||
this.productGroupFilter.next(val || '');
|
||||
}
|
||||
|
||||
excelLink() {
|
||||
return `/api/recipes/xlsx`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user