Chore: Updated to Angular 16

This commit is contained in:
2023-07-23 09:01:18 +05:30
parent 9589081046
commit 78d98f979d
99 changed files with 416 additions and 232 deletions
+3 -3
View File
@@ -9,8 +9,8 @@ RUN cd /app/overlord \
ADD https://git.tanshu.com/api/v1/repos/tanshu/brewman/tags /tags.json
RUN git clone --single-branch --depth 1 --branch latest https://git.tanshu.com/tanshu/brewman.git /app
WORKDIR /app/overlord
RUN mv /node_modules /app/overlord/ \
&& /app/overlord/node_modules/.bin/ng build
RUN mv /node_modules /app/bookie/ \
&& /app/bookie/node_modules/.bin/ng build
FROM python:3.11
@@ -27,7 +27,7 @@ ENV LANG en_IN
ENV LC_ALL en_IN
# Install Poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | POETRY_HOME=/opt/poetry python && \
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python - && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
-1
View File
@@ -13,7 +13,6 @@
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:@angular-eslint/recommended--extra",
"prettier"
],
"plugins": [
+1 -2
View File
@@ -1,8 +1,7 @@
module.exports = {
trailingComma: "all",
tabWidth: 2,
semi: true,
singleQuote: true,
bracketSpacing: true,
printWidth: 100
printWidth: 120
};
+39 -40
View File
@@ -14,61 +14,60 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^15.2.6",
"@angular/cdk": "^15.2.6",
"@angular/common": "^15.2.6",
"@angular/compiler": "^15.2.6",
"@angular/core": "^15.2.6",
"@angular/forms": "^15.2.6",
"@angular/material": "^15.2.6",
"@angular/material-moment-adapter": "^15.2.6",
"@angular/platform-browser": "^15.2.6",
"@angular/platform-browser-dynamic": "^15.2.6",
"@angular/router": "^15.2.6",
"@angular/animations": "^16.1.6",
"@angular/cdk": "^16.1.5",
"@angular/common": "^16.1.6",
"@angular/compiler": "^16.1.6",
"@angular/core": "^16.1.6",
"@angular/forms": "^16.1.6",
"@angular/material": "^16.1.5",
"@angular/material-moment-adapter": "^16.1.5",
"@angular/platform-browser": "^16.1.6",
"@angular/platform-browser-dynamic": "^16.1.6",
"@angular/router": "^16.1.6",
"@ngx-loading-bar/core": "^6.0.2",
"@ngx-loading-bar/http-client": "^6.0.2",
"@ngx-loading-bar/router": "^6.0.2",
"@types/mousetrap": "1.6.11",
"angular2-hotkeys": "^13.2.0",
"mathjs": "^11.8.0",
"angular2-hotkeys": "^15.0.0",
"mathjs": "^11.9.0",
"moment": "^2.29.4",
"rxjs": "~7.8.0",
"tslib": "^2.5.0",
"zone.js": "~0.12.0"
"tslib": "^2.6.0",
"zone.js": "~0.13.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^15.2.5",
"@angular-eslint/builder": "^15.2.1",
"@angular-eslint/eslint-plugin": "^15.2.1",
"@angular-eslint/eslint-plugin-template": "^15.2.1",
"@angular-eslint/schematics": "^15.2.1",
"@angular-eslint/template-parser": "^15.2.1",
"@angular/cli": "^15.2.5",
"@angular/compiler-cli": "^15.2.6",
"@angular/language-service": "^15.2.6",
"@types/jasmine": "~4.3.0",
"@typescript-eslint/eslint-plugin": "^5.57.1",
"@typescript-eslint/parser": "^5.57.1",
"@angular-devkit/build-angular": "^16.1.5",
"@angular-eslint/builder": "^16.1.0",
"@angular-eslint/eslint-plugin": "^16.1.0",
"@angular-eslint/eslint-plugin-template": "^16.1.0",
"@angular-eslint/schematics": "^16.1.0",
"@angular-eslint/template-parser": "^16.1.0",
"@angular/cli": "^16.1.5",
"@angular/compiler-cli": "^16.1.6",
"@angular/language-service": "^16.1.6",
"@types/jasmine": "~4.3.5",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"autoprefixer": "^10.4.14",
"eslint": "^8.37.0",
"eslint": "^8.39.0",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-unused-imports": "^2.0.0",
"eslint-plugin-unused-imports": "^3.0.0",
"husky": "^8.0.2",
"jasmine-core": "~4.5.0",
"jasmine-core": "~5.1.0",
"jasmine-spec-reporter": "7.0.0",
"karma": "^6.4.1",
"karma-chrome-launcher": "~3.1.1",
"karma-coverage": "~2.2.0",
"karma": "^6.4.2",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.1",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.0.0",
"lint-staged": "^13.1.0",
"postcss": "^8.4.21",
"prettier": "^2.8.7",
"karma-jasmine-html-reporter": "^2.1.0",
"lint-staged": "^13.2.3",
"postcss": "^8.4.27",
"prettier": "^3.0.0",
"standard-version": "^9.5.0",
"tailwindcss": "^3.3.1",
"ts-node": "^9.1.1",
"typescript": "~4.9.4"
"tailwindcss": "^3.3.3",
"typescript": "~5.1.6"
},
"husky": {
"hooks": {
@@ -13,7 +13,10 @@ const serviceName = 'AccountTypeService';
providedIn: 'root',
})
export class AccountTypeService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(): Observable<AccountType[]> {
return this.http
@@ -12,7 +12,10 @@ const serviceName = 'AttendanceTypeService';
@Injectable({ providedIn: 'root' })
export class AttendanceTypeService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(): Observable<AttendanceType[]> {
return this.http
@@ -12,7 +12,10 @@ const serviceName = 'AttendanceService';
@Injectable({ providedIn: 'root' })
export class AttendanceService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(date: string | null): Observable<Attendance> {
const getUrl: string = date === null ? url : `${url}/${date}`;
@@ -9,7 +9,11 @@ import { AuthService } from '../auth.service';
template: '',
})
export class LogoutComponent implements OnInit {
constructor(private auth: AuthService, private router: Router, private toaster: ToasterService) {}
constructor(
private auth: AuthService,
private router: Router,
private toaster: ToasterService,
) {}
ngOnInit() {
this.auth.logout();
@@ -25,7 +25,10 @@ export class BalanceSheetComponent implements OnInit {
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['group', 'name', 'subAmount', 'total'];
constructor(private route: ActivatedRoute, private router: Router) {
constructor(
private route: ActivatedRoute,
private router: Router,
) {
this.form = new FormGroup({
date: new FormControl(new Date(), { nonNullable: true }),
});
@@ -14,7 +14,10 @@ const serviceName = 'BalanceSheetService';
providedIn: 'root',
})
export class BalanceSheetService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(date: string | null): Observable<BalanceSheet> {
const listUrl = date === null ? url : `${url}/${date}`;
@@ -14,7 +14,10 @@ export class BatchIntegrityReportComponent implements OnInit {
dataSource: BatchIntegrityReportDatasource = new BatchIntegrityReportDatasource(this.info);
displayedColumns = ['batch', 'details'];
constructor(private route: ActivatedRoute, private router: Router) {}
constructor(
private route: ActivatedRoute,
private router: Router,
) {}
ngOnInit() {
this.route.data.subscribe((value) => {
@@ -13,7 +13,10 @@ const serviceName = 'BatchIntegrityReportService';
providedIn: 'root',
})
export class BatchIntegrityReportService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
batchIntegrity(): Observable<BatchIntegrity[]> {
const url = '/api/batch-integrity';
@@ -22,7 +22,10 @@ export class CashFlowComponent implements OnInit {
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['name', 'amount'];
constructor(private route: ActivatedRoute, private router: Router) {
constructor(
private route: ActivatedRoute,
private router: Router,
) {
this.form = new FormGroup({
startDate: new FormControl(new Date(), { nonNullable: true }),
finishDate: new FormControl(new Date(), { nonNullable: true }),
@@ -14,7 +14,10 @@ const serviceName = 'CashFlowService';
providedIn: 'root',
})
export class CashFlowService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(
id: string | null,
@@ -11,7 +11,11 @@ import { Client } from '../client';
const compare = (a: string | number, b: string | number, isAsc: boolean) =>
(a < b ? -1 : 1) * (isAsc ? 1 : -1);
export class ClientListDataSource extends DataSource<Client> {
constructor(public data: Client[], private paginator?: MatPaginator, private sort?: MatSort) {
constructor(
public data: Client[],
private paginator?: MatPaginator,
private sort?: MatSort,
) {
super();
}
+4 -1
View File
@@ -14,7 +14,10 @@ const serviceName = 'ClientService';
providedIn: 'root',
})
export class ClientService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(id: string | null): Observable<Client> {
const getUrl: string = id === null ? url : `${url}/${id}`;
@@ -14,7 +14,10 @@ const serviceName = 'ClosingStockService';
providedIn: 'root',
})
export class ClosingStockService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(date: string | null, costCentre: string | null): Observable<ClosingStock> {
const listUrl = date === null ? url : `${url}/${date}`;
+4 -1
View File
@@ -12,7 +12,10 @@ const serviceName = 'AccountService';
@Injectable({ providedIn: 'root' })
export class AccountService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(id: string | null): Observable<Account> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
+4 -1
View File
@@ -11,7 +11,10 @@ const serviceName = 'BatchService';
@Injectable({ providedIn: 'root' })
export class BatchService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
autocomplete(date: string, term: string): Observable<Batch[]> {
const options = { params: new HttpParams().set('q', term).set('d', date) };
@@ -9,7 +9,10 @@ import { AuthService } from '../../auth/auth.service';
styleUrls: ['./nav-bar.component.css'],
})
export class NavBarComponent {
constructor(private router: Router, public auth: AuthService) {}
constructor(
private router: Router,
public auth: AuthService,
) {}
logout() {
this.auth.logout();
+4 -1
View File
@@ -13,7 +13,10 @@ const serviceName = 'VoucherService';
providedIn: 'root',
})
export class VoucherService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
static dataURLtoBlob(dataURL: string) {
const re = /^data:([\w/\-.]+);\w+,(.*)$/;
@@ -11,7 +11,11 @@ import { CostCentre } from '../../core/cost-centre';
const compare = (a: string | number, b: string | number, isAsc: boolean) =>
(a < b ? -1 : 1) * (isAsc ? 1 : -1);
export class CostCentreListDataSource extends DataSource<CostCentre> {
constructor(public data: CostCentre[], private paginator?: MatPaginator, private sort?: MatSort) {
constructor(
public data: CostCentre[],
private paginator?: MatPaginator,
private sort?: MatSort,
) {
super();
}
@@ -13,7 +13,10 @@ const serviceName = 'CostCentreService';
providedIn: 'root',
})
export class CostCentreService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(id: string | null): Observable<CostCentre> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
@@ -35,7 +35,10 @@ export class DaybookComponent implements OnInit {
'creditAmount',
];
constructor(private route: ActivatedRoute, private router: Router) {
constructor(
private route: ActivatedRoute,
private router: Router,
) {
this.form = new FormGroup({
startDate: new FormControl(new Date(), { nonNullable: true }),
finishDate: new FormControl(new Date(), { nonNullable: true }),
+4 -1
View File
@@ -14,7 +14,10 @@ const serviceName = 'DaybookService';
providedIn: 'root',
})
export class DaybookService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(startDate: string | null, finishDate: string | null): Observable<Daybook> {
const startDateWithSlash = startDate ? `/${startDate}` : '';
@@ -12,7 +12,10 @@ const serviceName = 'EmployeeAttendanceService';
@Injectable({ providedIn: 'root' })
export class EmployeeAttendanceService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(
id: string | null,
@@ -25,7 +25,10 @@ export class EmployeeFunctionsComponent {
fingerprintFile: File | null = null;
constructor(private toaster: ToasterService, private ser: EmployeeFunctionsService) {
constructor(
private toaster: ToasterService,
private ser: EmployeeFunctionsService,
) {
const startDate = moment().date(1);
const finishDate = moment().date(startDate.daysInMonth());
this.creditSalaryForm = new FormGroup({
@@ -9,7 +9,10 @@ const serviceName = 'EmployeeFunctionsService';
@Injectable({ providedIn: 'root' })
export class EmployeeFunctionsService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
creditSalary(month: string): Observable<boolean> {
const url = '/api/credit-salary';
@@ -40,7 +40,10 @@ export class EmployeeListComponent implements OnInit, AfterViewInit {
'leavingDate',
];
constructor(private route: ActivatedRoute, private toCsv: ToCsvService) {
constructor(
private route: ActivatedRoute,
private toCsv: ToCsvService,
) {
this.form = new FormGroup({
filter: new FormControl<string>('', { nonNullable: true }),
});
@@ -12,7 +12,10 @@ const serviceName = 'EmployeeService';
@Injectable({ providedIn: 'root' })
export class EmployeeService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(id: string | null): Observable<Employee> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
@@ -38,7 +38,10 @@ export class EntriesComponent implements OnInit {
posted: boolean | null = null;
issue = false;
constructor(private route: ActivatedRoute, private router: Router) {
constructor(
private route: ActivatedRoute,
private router: Router,
) {
this.form = new FormGroup({
startDate: new FormControl(new Date(), { nonNullable: true }),
finishDate: new FormControl(new Date(), { nonNullable: true }),
+4 -1
View File
@@ -14,7 +14,10 @@ const serviceName = 'EntriesService';
providedIn: 'root',
})
export class EntriesService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(
start_date: string | null,
+4 -1
View File
@@ -13,7 +13,10 @@ const serviceName = 'IssueGridService';
providedIn: 'root',
})
export class IssueGridService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
issueGrid(date: string): Observable<IssueGridItem[]> {
return this.http
+5 -1
View File
@@ -11,7 +11,11 @@ import { LedgerItem } from './ledger-item';
const compare = (a: string | number, b: string | number, isAsc: boolean) =>
(a < b ? -1 : 1) * (isAsc ? 1 : -1);
export class LedgerDataSource extends DataSource<LedgerItem> {
constructor(public data: LedgerItem[], private paginator?: MatPaginator, private sort?: MatSort) {
constructor(
public data: LedgerItem[],
private paginator?: MatPaginator,
private sort?: MatSort,
) {
super();
}
+4 -1
View File
@@ -14,7 +14,10 @@ const serviceName = 'LedgerService';
providedIn: 'root',
})
export class LedgerService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(id: string | null, startDate: string | null, finishDate: string | null): Observable<Ledger> {
const listUrl = id === null ? url : `${url}/${id}`;
@@ -27,7 +27,10 @@ export class NetTransactionsComponent implements OnInit {
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['type', 'name', 'debit', 'credit'];
constructor(private route: ActivatedRoute, private router: Router) {
constructor(
private route: ActivatedRoute,
private router: Router,
) {
this.form = new FormGroup({
startDate: new FormControl(new Date(), { nonNullable: true }),
finishDate: new FormControl(new Date(), { nonNullable: true }),
@@ -14,7 +14,10 @@ const serviceName = 'NetTransactionsService';
providedIn: 'root',
})
export class NetTransactionsService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(startDate: string | null, finishDate: string | null): Observable<NetTransactions> {
const startDateWithSlash = startDate ? `/${startDate}` : '';
@@ -14,7 +14,10 @@ export class NonContractPurchaseComponent implements OnInit {
dataSource: NonContractPurchaseDatasource = new NonContractPurchaseDatasource(this.info);
displayedColumns = ['date', 'vendor', 'product', 'contractPrice', 'purchasePrice'];
constructor(private route: ActivatedRoute, private router: Router) {}
constructor(
private route: ActivatedRoute,
private router: Router,
) {}
ngOnInit() {
this.route.data.subscribe((value) => {
@@ -14,7 +14,10 @@ const serviceName = 'NonContractPurchaseService';
providedIn: 'root',
})
export class NonContractPurchaseService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
nonContractPurchase(): Observable<NonContractPurchase[]> {
return this.http
+4 -1
View File
@@ -12,7 +12,10 @@ const serviceName = 'PeriodService';
@Injectable({ providedIn: 'root' })
export class PeriodService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(id: string | null): Observable<Period> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
@@ -13,7 +13,10 @@ const serviceName = 'ProductGroupService';
providedIn: 'root',
})
export class ProductGroupService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(id: string | null): Observable<ProductGroup> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
@@ -14,7 +14,10 @@ const serviceName = 'ProductLedgerService';
providedIn: 'root',
})
export class ProductLedgerService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(
id: string | null,
@@ -32,7 +32,10 @@ export class ProductListComponent implements OnInit, AfterViewInit {
private _showExtended = true;
constructor(private route: ActivatedRoute, private toCsv: ToCsvService) {
constructor(
private route: ActivatedRoute,
private toCsv: ToCsvService,
) {
this.showExtended = true;
this.form = new FormGroup({
filter: new FormControl<string>('', { nonNullable: true }),
+4 -1
View File
@@ -12,7 +12,10 @@ const serviceName = 'ProductService';
@Injectable({ providedIn: 'root' })
export class ProductService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(id: string | null): Observable<Product> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
@@ -27,7 +27,10 @@ export class ProfitLossComponent implements OnInit {
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['group', 'name', 'amount', 'total'];
constructor(private route: ActivatedRoute, private router: Router) {
constructor(
private route: ActivatedRoute,
private router: Router,
) {
this.form = new FormGroup({
startDate: new FormControl(new Date(), { nonNullable: true }),
finishDate: new FormControl(new Date(), { nonNullable: true }),
@@ -14,7 +14,10 @@ const serviceName = 'ProfitLossService';
providedIn: 'root',
})
export class ProfitLossService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(startDate: string | null, finishDate: string | null): Observable<ProfitLoss> {
const startDateWithSlash = startDate ? `/${startDate}` : '';
@@ -36,7 +36,10 @@ export class PurchaseEntriesComponent implements OnInit {
'amount',
];
constructor(private route: ActivatedRoute, private router: Router) {
constructor(
private route: ActivatedRoute,
private router: Router,
) {
this.form = new FormGroup({
startDate: new FormControl(new Date(), { nonNullable: true }),
finishDate: new FormControl(new Date(), { nonNullable: true }),
@@ -14,7 +14,10 @@ const serviceName = 'PurchaseEntriesService';
providedIn: 'root',
})
export class PurchaseEntriesService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(startDate: string | null, finishDate: string | null): Observable<PurchaseEntries> {
const startDateWithSlash = startDate ? `/${startDate}` : '';
@@ -28,7 +28,10 @@ export class PurchasesComponent implements OnInit {
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['product', 'quantity', 'rate', 'amount'];
constructor(private route: ActivatedRoute, private router: Router) {
constructor(
private route: ActivatedRoute,
private router: Router,
) {
this.form = new FormGroup({
startDate: new FormControl(new Date(), { nonNullable: true }),
finishDate: new FormControl(new Date(), { nonNullable: true }),
@@ -14,7 +14,10 @@ const serviceName = 'PurchasesService';
providedIn: 'root',
})
export class PurchasesService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(startDate: string | null, finishDate: string | null): Observable<Purchases> {
const startDateWithSlash = startDate ? `/${startDate}` : '';
@@ -106,9 +106,7 @@
<!-- Price Column -->
<ng-container matColumnDef="price">
<mat-header-cell *matHeaderCellDef class="right">Price</mat-header-cell>
<mat-cell *matCellDef="let row" class="right">{{
row.price | currency : 'INR'
}}</mat-cell>
<mat-cell *matCellDef="let row" class="right">{{ row.price | currency: 'INR' }}</mat-cell>
</ng-container>
<!-- Action Column -->
@@ -14,7 +14,10 @@ const serviceName = 'RateContractService';
providedIn: 'root',
})
export class RateContractService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(id: string | null): Observable<RateContract> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
@@ -36,7 +36,11 @@ export class RawMaterialCostComponent implements OnInit {
columnsNoId = ['name', 'issue', 'sale', 'rmc'];
columnsId = ['name', 'group', 'quantity', 'net', 'gross'];
constructor(private route: ActivatedRoute, private router: Router, private toCsv: ToCsvService) {
constructor(
private route: ActivatedRoute,
private router: Router,
private toCsv: ToCsvService,
) {
this.form = new FormGroup({
startDate: new FormControl(new Date(), { nonNullable: true }),
finishDate: new FormControl(new Date(), { nonNullable: true }),
@@ -14,7 +14,10 @@ const serviceName = 'RawMaterialCostService';
providedIn: 'root',
})
export class RawMaterialCostService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(
id: string | null,
@@ -14,7 +14,10 @@ const serviceName = 'RecipeTemplateService';
providedIn: 'root',
})
export class RecipeTemplateService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(id: string | null): Observable<RecipeTemplate> {
const getUrl: string = id === null ? url : `${url}/${id}`;
@@ -35,7 +35,10 @@ export class RecipeListComponent implements OnInit {
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['name', 'yield', 'date', 'source'];
constructor(private route: ActivatedRoute, private router: Router) {
constructor(
private route: ActivatedRoute,
private router: Router,
) {
this.form = new FormGroup({
period: new FormControl(new Period(), { nonNullable: true }),
productGroup: new FormControl<ProductGroup | string | null>(null),
+4 -1
View File
@@ -12,7 +12,10 @@ const serviceName = 'RecipeService';
@Injectable({ providedIn: 'root' })
export class RecipeService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(id: string | null): Observable<Recipe> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
@@ -11,7 +11,11 @@ import { Role } from '../role';
const compare = (a: string | number, b: string | number, isAsc: boolean) =>
(a < b ? -1 : 1) * (isAsc ? 1 : -1);
export class RoleListDatasource extends DataSource<Role> {
constructor(public data: Role[], private paginator?: MatPaginator, private sort?: MatSort) {
constructor(
public data: Role[],
private paginator?: MatPaginator,
private sort?: MatSort,
) {
super();
}
+4 -1
View File
@@ -14,7 +14,10 @@ const serviceName = 'RoleService';
providedIn: 'root',
})
export class RoleService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(id: string | null): Observable<Role> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
@@ -11,7 +11,10 @@ const serviceName = 'SettingsService';
@Injectable({ providedIn: 'root' })
export class SettingsService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
getLockInformation(): Observable<[LockInfo]> {
const url = '/api/lock-information';
@@ -13,7 +13,10 @@ const serviceName = 'VoucherTypeService';
providedIn: 'root',
})
export class VoucherTypeService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(): Observable<AccountType[]> {
return this.http
@@ -57,9 +57,7 @@
<!-- Opening Column -->
<ng-container matColumnDef="opening">
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Opening</mat-header-cell>
<mat-cell *matCellDef="let row" class="right">{{
row.opening | number : '1.2-2'
}}</mat-cell>
<mat-cell *matCellDef="let row" class="right">{{ row.opening | number: '1.2-2' }}</mat-cell>
</ng-container>
<!-- Purchaase Column -->
@@ -79,9 +77,7 @@
<!-- Closing Column -->
<ng-container matColumnDef="closing">
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Closing</mat-header-cell>
<mat-cell *matCellDef="let row" class="right">{{
row.closing | number : '1.2-2'
}}</mat-cell>
<mat-cell *matCellDef="let row" class="right">{{ row.closing | number: '1.2-2' }}</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
@@ -27,7 +27,10 @@ export class StockMovementComponent implements OnInit {
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['group', 'name', 'opening', 'purchase', 'issue', 'closing'];
constructor(private route: ActivatedRoute, private router: Router) {
constructor(
private route: ActivatedRoute,
private router: Router,
) {
this.form = new FormGroup({
startDate: new FormControl(new Date(), { nonNullable: true }),
finishDate: new FormControl(new Date(), { nonNullable: true }),
@@ -14,7 +14,10 @@ const serviceName = 'StockMovementService';
providedIn: 'root',
})
export class StockMovementService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(startDate: string | null, finishDate: string | null): Observable<StockMovement> {
const startDateWithSlash = startDate ? `/${startDate}` : '';
@@ -25,7 +25,10 @@ export class TrialBalanceComponent implements OnInit {
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['type', 'name', 'debit', 'credit'];
constructor(private route: ActivatedRoute, private router: Router) {
constructor(
private route: ActivatedRoute,
private router: Router,
) {
this.form = new FormGroup({
date: new FormControl(new Date(), { nonNullable: true }),
});
@@ -14,7 +14,10 @@ const serviceName = 'TrialBalanceService';
providedIn: 'root',
})
export class TrialBalanceService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
list(date: string | null): Observable<TrialBalance> {
const listUrl = date === null ? url : `${url}/${date}`;
@@ -12,7 +12,11 @@ const compare = (a: string | number, b: string | number, isAsc: boolean) =>
(a < b ? -1 : 1) * (isAsc ? 1 : -1);
export class UserListDataSource extends DataSource<User> {
constructor(public data: User[], private paginator?: MatPaginator, private sort?: MatSort) {
constructor(
public data: User[],
private paginator?: MatPaginator,
private sort?: MatSort,
) {
super();
}
+4 -1
View File
@@ -13,7 +13,10 @@ const serviceName = 'UserService';
providedIn: 'root',
})
export class UserService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
constructor(
private http: HttpClient,
private log: ErrorLoggerService,
) {}
get(id: string | null): Observable<User> {
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;