Feature: Tax Regimes are added so that different bills with different series can be printed for Different regimes such as VAT and GST

Chore: Model relationships updated to make them simpler
Chore: Bill printing majorly refactored for it

Due to the sheer depth of the changes. There can be showstoppers. Please test it carefully
This commit is contained in:
2023-03-05 23:50:41 +05:30
parent 802eded568
commit e46fe7f90e
141 changed files with 2197 additions and 892 deletions

View File

@ -1,10 +1,10 @@
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
import { Component, OnInit } from '@angular/core';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { FormControl, FormGroup } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { BehaviorSubject } from 'rxjs';
import { Observable } from 'rxjs';
import { debounceTime, distinctUntilChanged, startWith } from 'rxjs/operators';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { MenuCategory } from '../../core/menu-category';
import { Product } from '../../core/product';
@ -29,7 +29,11 @@ export class ProductListComponent implements OnInit {
this.data,
);
form: UntypedFormGroup;
form: FormGroup<{
menuCategory: FormControl<string | null>;
filter: FormControl<string>;
}>;
list: Product[] = [];
menuCategories: MenuCategory[] = [];
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
@ -44,20 +48,18 @@ export class ProductListComponent implements OnInit {
constructor(
private route: ActivatedRoute,
private fb: UntypedFormBuilder,
private toaster: ToasterService,
private toCsv: ToCsvService,
private ser: ProductService,
) {
this.form = this.fb.group({
menuCategory: '',
filter: '',
this.form = new FormGroup({
menuCategory: new FormControl<string | null>(''),
filter: new FormControl<string>('', { nonNullable: true }),
});
this.data.subscribe((data: Product[]) => {
this.list = data;
});
this.searchFilter = (this.form.get('filter') as UntypedFormControl).valueChanges.pipe(
startWith(''),
this.searchFilter = this.form.controls.filter.valueChanges.pipe(
debounceTime(150),
distinctUntilChanged(),
);