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 fb711089e..a485041cf 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 @@ -10,7 +10,12 @@ {{ 'labels.inputs.accounting.' + accountType.value | translate }} - + {{ 'labels.inputs.Account Type' | translate }} {{ 'labels.commons.is' | translate }} {{ 'labels.commons.required' | translate }} @@ -19,7 +24,12 @@ {{ 'labels.inputs.Account Name' | translate }} - + {{ 'labels.inputs.Account Name' | translate }} {{ 'labels.commons.is' | translate }} {{ 'labels.commons.required' | translate }} @@ -32,7 +42,12 @@ {{ accountUsage.value }} - + {{ 'labels.inputs.Account Usage' | translate }} {{ 'labels.commons.is' | translate }} {{ 'labels.commons.required' | translate }} @@ -41,7 +56,12 @@ {{ 'labels.inputs.GL Code' | translate }} - + {{ 'labels.inputs.GL Code' | translate }} {{ 'labels.commons.is' | translate }} {{ 'labels.commons.required' | translate }} 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 5f3a0a3c5..764085681 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 @@ -154,8 +154,6 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit { break; } }); - - this.glAccountForm.get('type').setValue(this.accountTypeId); } /** @@ -163,6 +161,9 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit { * if successful redirects to view created account. */ submit() { + if (this.glAccountForm.invalid) { + return; + } this.accountingService.createGlAccount(this.glAccountForm.value).subscribe((response: any) => { if (this.configurationWizardService.showChartofAccounts === true) { this.configurationWizardService.showChartofAccounts = false;