From 1bb307905ee368268efbd371082c1fdcdbd931b9 Mon Sep 17 00:00:00 2001
From: Pushpendra <76156941+PC-11-00@users.noreply.github.com>
Date: Thu, 14 Dec 2023 18:41:22 +0530
Subject: [PATCH] fix:GL account can be created (#1931)
Fixes: #1921
---
.../create-gl-account.component.html | 39 +++++++----
.../create-gl-account.component.ts | 68 +++++++++----------
2 files changed, 60 insertions(+), 47 deletions(-)
diff --git a/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.html b/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.html
index bba9ea984..68e824915 100644
--- a/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.html
+++ b/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.html
@@ -16,7 +16,8 @@
- {{"labels.inputs.Account Type" | translate}} {{"labels.commons.is" | translate}} {{"labels.commons.required" | translate}}
+ {{"labels.inputs.Account Type" | translate}} {{"labels.commons.is" | translate}}
+ {{"labels.commons.required" | translate}}
@@ -24,7 +25,8 @@
{{"labels.inputs.Account Name" | translate}}
- {{"labels.inputs.Account Name" | translate}} {{"labels.commons.is" | translate}} {{"labels.commons.required" | translate}}
+ {{"labels.inputs.Account Name" | translate}} {{"labels.commons.is" | translate}}
+ {{"labels.commons.required" | translate}}
@@ -36,7 +38,8 @@
- {{"labels.inputs.Account Usage" | translate}} {{"labels.commons.is" | translate}} {{"labels.commons.required" | translate}}
+ {{"labels.inputs.Account Usage" | translate}} {{"labels.commons.is" | translate}}
+ {{"labels.commons.required" | translate}}
@@ -44,7 +47,8 @@
{{"labels.inputs.GL Code" | translate}}
- {{"labels.inputs.GL Code" | translate}} {{"labels.commons.is" | translate}} {{"labels.commons.required" | translate}}
+ {{"labels.inputs.GL Code" | translate}} {{"labels.commons.is" | translate}}
+ {{"labels.commons.required" | translate}}
@@ -67,7 +71,7 @@
-
+
{{"labels.inputs.Manual Entries Allowed" | translate}}
@@ -82,8 +86,10 @@
-
-
+
+
@@ -94,11 +100,18 @@
{{"labels.heading.Create GL account" | translate}}
- {{"labels.text.Filling Details" | translate}} {{"labels.inputs.Chart of Accounts" | translate}}
+ {{"labels.text.Filling Details" | translate}} {{"labels.inputs.Chart of Accounts" | translate}}
-
-
-
-
+
+
+
+
-
+
\ No newline at end of file
diff --git a/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.ts b/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.ts
index 1c01f7330..09a5e0207 100644
--- a/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.ts
+++ b/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.ts
@@ -57,12 +57,12 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit {
* @param {Matdialog} dialog Matdialog.
*/
constructor(private formBuilder: UntypedFormBuilder,
- private accountingService: AccountingService,
- private route: ActivatedRoute,
- private router: Router,
- private configurationWizardService: ConfigurationWizardService,
- private popoverService: PopoverService,
- public dialog: MatDialog) {
+ private accountingService: AccountingService,
+ private route: ActivatedRoute,
+ private router: Router,
+ private configurationWizardService: ConfigurationWizardService,
+ private popoverService: PopoverService,
+ public dialog: MatDialog) {
this.route.queryParamMap.subscribe(params => {
this.accountTypeId = Number(params.get('accountType'));
this.parentId = Number(params.get('parent'));
@@ -97,7 +97,7 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit {
'glCode': ['', Validators.required],
'parentId': [this.parentId || undefined],
'tagId': [''],
- 'manualEntriesAllowed': [true, Validators.required],
+ 'manualEntriesAllowed': [true],
'description': ['']
});
}
@@ -109,20 +109,20 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit {
this.glAccountForm.get('type').valueChanges.subscribe(accountTypeId => {
switch (accountTypeId) {
case 1: this.parentData = this.chartOfAccountsData.assetHeaderAccountOptions;
- this.tagData = this.chartOfAccountsData.allowedAssetsTagOptions;
- break;
+ this.tagData = this.chartOfAccountsData.allowedAssetsTagOptions;
+ break;
case 2: this.parentData = this.chartOfAccountsData.liabilityHeaderAccountOptions;
- this.tagData = this.chartOfAccountsData.allowedLiabilitiesTagOptions;
- break;
+ this.tagData = this.chartOfAccountsData.allowedLiabilitiesTagOptions;
+ break;
case 3: this.parentData = this.chartOfAccountsData.equityHeaderAccountOptions;
- this.tagData = this.chartOfAccountsData.allowedEquityTagOptions;
- break;
+ this.tagData = this.chartOfAccountsData.allowedEquityTagOptions;
+ break;
case 4: this.parentData = this.chartOfAccountsData.incomeHeaderAccountOptions;
- this.tagData = this.chartOfAccountsData.allowedIncomeTagOptions;
- break;
+ this.tagData = this.chartOfAccountsData.allowedIncomeTagOptions;
+ break;
case 5: this.parentData = this.chartOfAccountsData.expenseHeaderAccountOptions;
- this.tagData = this.chartOfAccountsData.allowedExpensesTagOptions;
- break;
+ this.tagData = this.chartOfAccountsData.allowedExpensesTagOptions;
+ break;
}
});
@@ -188,25 +188,25 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit {
* Opens dialog if the user wants to create more accounts.
*/
openDialog() {
- const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, {
- data: {
- stepName: 'GL account'
- },
- });
+ const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, {
+ data: {
+ stepName: 'GL account'
+ },
+ });
continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => {
if (response.step === 1) {
- this.configurationWizardService.showChartofAccountsForm = false;
- this.router.navigate(['../'], { relativeTo: this.route });
- } else if (response.step === 2) {
- this.configurationWizardService.showChartofAccountsForm = true;
- this.router.routeReuseStrategy.shouldReuseRoute = () => false;
- this.router.onSameUrlNavigation = 'reload';
- this.router.navigate(['/accounting/chart-of-accounts/gl-accounts/create']);
- } else if (response.step === 3) {
- this.configurationWizardService.showChartofAccountsForm = false;
- this.configurationWizardService.showAccountsLinked = true;
- this.router.navigate(['/accounting']);
- }
+ this.configurationWizardService.showChartofAccountsForm = false;
+ this.router.navigate(['../'], { relativeTo: this.route });
+ } else if (response.step === 2) {
+ this.configurationWizardService.showChartofAccountsForm = true;
+ this.router.routeReuseStrategy.shouldReuseRoute = () => false;
+ this.router.onSameUrlNavigation = 'reload';
+ this.router.navigate(['/accounting/chart-of-accounts/gl-accounts/create']);
+ } else if (response.step === 3) {
+ this.configurationWizardService.showChartofAccountsForm = false;
+ this.configurationWizardService.showAccountsLinked = true;
+ this.router.navigate(['/accounting']);
+ }
});
}
}