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, OnInit } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
|
||||
import { FormControl, FormGroup } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
@ -22,27 +22,29 @@ import { GuestBookListDataSource } from './guest-book-list-datasource';
|
||||
export class GuestBookListComponent implements OnInit {
|
||||
data: BehaviorSubject<GuestBook[]> = new BehaviorSubject<GuestBook[]>([]);
|
||||
dataSource: GuestBookListDataSource = new GuestBookListDataSource(this.data);
|
||||
form: UntypedFormGroup;
|
||||
form: FormGroup<{
|
||||
date: FormControl<Date>;
|
||||
}>;
|
||||
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['sno', 'name', 'phone', 'pax', 'date', 'action'];
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: UntypedFormBuilder,
|
||||
private dialog: MatDialog,
|
||||
private toaster: ToasterService,
|
||||
private ser: GuestBookService,
|
||||
) {
|
||||
// Create form
|
||||
this.form = this.fb.group({
|
||||
date: '',
|
||||
this.form = new FormGroup({
|
||||
date: new FormControl(new Date(), { nonNullable: true }),
|
||||
});
|
||||
this.listenToDateChange();
|
||||
}
|
||||
|
||||
listenToDateChange(): void {
|
||||
(this.form.get('date') as UntypedFormControl).valueChanges
|
||||
this.form.controls.date.valueChanges
|
||||
.pipe(map((x) => moment(x).format('DD-MMM-YYYY')))
|
||||
.subscribe((x) =>
|
||||
this.ser.list(x).subscribe((list: GuestBookList) => {
|
||||
|
||||
Reference in New Issue
Block a user