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

@ -12,8 +12,8 @@ export class BeerSaleReportResolver implements Resolve<BeerSaleReport> {
constructor(private ser: BeerSaleReportService) {}
resolve(route: ActivatedRouteSnapshot): Observable<BeerSaleReport> {
const startDate = route.queryParamMap.get('startDate') || null;
const finishDate = route.queryParamMap.get('finishDate') || null;
const startDate = route.queryParamMap.get('startDate') ?? null;
const finishDate = route.queryParamMap.get('finishDate') ?? null;
const regular = route.queryParamMap.get('regular') !== 'false';
const happy = route.queryParamMap.get('happy') !== 'false';
const staff = route.queryParamMap.get('staff') !== 'false';

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { FormControl, FormGroup } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import * as moment from 'moment';
@ -17,25 +17,27 @@ import { BeerSaleReportDataSource } from './beer-sale-report-datasource';
export class BeerSaleReportComponent implements OnInit {
info: BeerSaleReport = new BeerSaleReport();
dataSource: BeerSaleReportDataSource = new BeerSaleReportDataSource(this.info.data);
form: UntypedFormGroup;
form: FormGroup<{
startDate: FormControl<Date>;
finishDate: FormControl<Date>;
regular: FormControl<boolean>;
happy: FormControl<boolean>;
staff: FormControl<boolean>;
nc: FormControl<boolean>;
}>;
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns: string[] = ['date'];
constructor(
private route: ActivatedRoute,
private router: Router,
private fb: UntypedFormBuilder,
private toCsv: ToCsvService,
) {
constructor(private route: ActivatedRoute, private router: Router, private toCsv: ToCsvService) {
// Create form
this.form = this.fb.group({
startDate: '',
finishDate: '',
regular: true,
happy: true,
staff: true,
nc: true,
this.form = new FormGroup({
startDate: new FormControl(new Date(), { nonNullable: true }),
finishDate: new FormControl(new Date(), { nonNullable: true }),
regular: new FormControl<boolean>(true, { nonNullable: true }),
happy: new FormControl<boolean>(true, { nonNullable: true }),
staff: new FormControl<boolean>(true, { nonNullable: true }),
nc: new FormControl<boolean>(true, { nonNullable: true }),
});
}