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,5 +1,5 @@
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { FormControl, FormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { MatSelectChange } from '@angular/material/select';
import { ActivatedRoute, Router } from '@angular/router';
@ -17,22 +17,25 @@ import { HeaderFooterService } from './header-footer.service';
})
export class HeaderFooterComponent implements OnInit {
@ViewChild('section', { static: true }) sectionElement?: ElementRef;
form: UntypedFormGroup;
form: FormGroup<{
id: FormControl<string>;
text: FormControl<string>;
}>;
list: HeaderFooter[] = [];
id = '';
constructor(
private route: ActivatedRoute,
private router: Router,
private fb: UntypedFormBuilder,
private toaster: ToasterService,
private dialog: MatDialog,
private ser: HeaderFooterService,
) {
// Create form
this.form = this.fb.group({
id: '',
text: '',
this.form = new FormGroup({
id: new FormControl<string>('', { nonNullable: true }),
text: new FormControl<string>('', { nonNullable: true }),
});
route.params.pipe(map((p) => p['id'])).subscribe((x) => {
this.id = x;
@ -74,7 +77,7 @@ export class HeaderFooterComponent implements OnInit {
if (item === undefined) {
return new HeaderFooter();
}
item.text = formModel.text;
item.text = formModel.text ?? '';
return item;
}