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:
@@ -1,5 +1,5 @@
|
||||
import { Component, ElementRef, Inject, ViewChild } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
import { ReasonDatasource } from './reason-datasource';
|
||||
@@ -11,7 +11,10 @@ import { ReasonDatasource } from './reason-datasource';
|
||||
})
|
||||
export class ReasonComponent {
|
||||
@ViewChild('son', { static: true }) son?: ElementRef;
|
||||
form: UntypedFormGroup;
|
||||
form: FormGroup<{
|
||||
son: FormControl<string>;
|
||||
}>;
|
||||
|
||||
dataSource: ReasonDatasource;
|
||||
title: string;
|
||||
selected = '';
|
||||
@@ -21,12 +24,11 @@ export class ReasonComponent {
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<ReasonComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) private data: { title: string; reasons: string[] },
|
||||
private fb: UntypedFormBuilder,
|
||||
) {
|
||||
this.reasons = data.reasons || [];
|
||||
this.reasons = data.reasons ?? [];
|
||||
this.title = data.title;
|
||||
this.form = this.fb.group({
|
||||
son: '',
|
||||
this.form = new FormGroup({
|
||||
son: new FormControl<string>('', { nonNullable: true }),
|
||||
});
|
||||
this.dataSource = new ReasonDatasource(this.reasons);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user