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:
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { Regime } from 'src/app/core/regime';
|
||||
|
||||
import { Table } from '../../core/table';
|
||||
import { ToasterService } from '../../core/toaster.service';
|
||||
@@ -13,6 +14,7 @@ import { BillNumberComponent } from '../bill-number/bill-number.component';
|
||||
styleUrls: ['./running-tables.component.css'],
|
||||
})
|
||||
export class RunningTablesComponent implements OnInit {
|
||||
regimes: Regime[] = [];
|
||||
list: Table[] = [];
|
||||
|
||||
constructor(
|
||||
@@ -24,7 +26,8 @@ export class RunningTablesComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data.subscribe((value) => {
|
||||
const data = value as { list: Table[] };
|
||||
const data = value as { list: Table[]; regimes: Regime[] };
|
||||
this.regimes = data.regimes;
|
||||
this.list = data.list;
|
||||
});
|
||||
}
|
||||
@@ -45,7 +48,7 @@ export class RunningTablesComponent implements OnInit {
|
||||
|
||||
openBill() {
|
||||
return this.dialog
|
||||
.open(BillNumberComponent)
|
||||
.open(BillNumberComponent, { data: this.regimes })
|
||||
.afterClosed()
|
||||
.pipe(
|
||||
map((x) => {
|
||||
|
||||
Reference in New Issue
Block a user