+25
-12
@@ -16,7 +16,8 @@
|
|||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<mat-error *ngIf="glAccountForm.controls.type.hasError('required')">
|
<mat-error *ngIf="glAccountForm.controls.type.hasError('required')">
|
||||||
{{"labels.inputs.Account Type" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
|
{{"labels.inputs.Account Type" | translate}} {{"labels.commons.is" | translate}}
|
||||||
|
<strong>{{"labels.commons.required" | translate}}</strong>
|
||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -24,7 +25,8 @@
|
|||||||
<mat-label>{{"labels.inputs.Account Name" | translate}}</mat-label>
|
<mat-label>{{"labels.inputs.Account Name" | translate}}</mat-label>
|
||||||
<input matInput required formControlName="name">
|
<input matInput required formControlName="name">
|
||||||
<mat-error *ngIf="glAccountForm.controls.name.hasError('required')">
|
<mat-error *ngIf="glAccountForm.controls.name.hasError('required')">
|
||||||
{{"labels.inputs.Account Name" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
|
{{"labels.inputs.Account Name" | translate}} {{"labels.commons.is" | translate}}
|
||||||
|
<strong>{{"labels.commons.required" | translate}}</strong>
|
||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -36,7 +38,8 @@
|
|||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<mat-error *ngIf="glAccountForm.controls.usage.hasError('required')">
|
<mat-error *ngIf="glAccountForm.controls.usage.hasError('required')">
|
||||||
{{"labels.inputs.Account Usage" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
|
{{"labels.inputs.Account Usage" | translate}} {{"labels.commons.is" | translate}}
|
||||||
|
<strong>{{"labels.commons.required" | translate}}</strong>
|
||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -44,7 +47,8 @@
|
|||||||
<mat-label>{{"labels.inputs.GL Code" | translate}}</mat-label>
|
<mat-label>{{"labels.inputs.GL Code" | translate}}</mat-label>
|
||||||
<input matInput required formControlName="glCode">
|
<input matInput required formControlName="glCode">
|
||||||
<mat-error *ngIf="glAccountForm.controls.glCode.hasError('required')">
|
<mat-error *ngIf="glAccountForm.controls.glCode.hasError('required')">
|
||||||
{{"labels.inputs.GL Code" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
|
{{"labels.inputs.GL Code" | translate}} {{"labels.commons.is" | translate}}
|
||||||
|
<strong>{{"labels.commons.required" | translate}}</strong>
|
||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -67,7 +71,7 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<div fxFlex="18%" class="manual-entries-allowed-wrapper">
|
<div fxFlex="18%" class="manual-entries-allowed-wrapper">
|
||||||
<mat-checkbox labelPosition="before" required formControlName="manualEntriesAllowed" class="manual-entries-allowed">
|
<mat-checkbox labelPosition="before" formControlName="manualEntriesAllowed" class="manual-entries-allowed">
|
||||||
{{"labels.inputs.Manual Entries Allowed" | translate}}
|
{{"labels.inputs.Manual Entries Allowed" | translate}}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
@@ -82,8 +86,10 @@
|
|||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
|
||||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||||
<button type="button" mat-raised-button [routerLink]="[cancelRoute]">{{"labels.buttons.Cancel" | translate}}</button>
|
<button type="button" mat-raised-button [routerLink]="[cancelRoute]">{{"labels.buttons.Cancel" |
|
||||||
<button mat-raised-button color="primary" [disabled]="!glAccountForm.valid" *mifosxHasPermission="'CREATE_GLACCOUNT'">{{"labels.buttons.Submit" | translate}}</button>
|
translate}}</button>
|
||||||
|
<button mat-raised-button color="primary" [disabled]="!glAccountForm.valid"
|
||||||
|
*mifosxHasPermission="'CREATE_GLACCOUNT'">{{"labels.buttons.Submit" | translate}}</button>
|
||||||
</mat-card-actions>
|
</mat-card-actions>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
@@ -94,11 +100,18 @@
|
|||||||
|
|
||||||
<ng-template #templateAccountFormRef let-popover="popover">
|
<ng-template #templateAccountFormRef let-popover="popover">
|
||||||
<h2>{{"labels.heading.Create GL account" | translate}}</h2>
|
<h2>{{"labels.heading.Create GL account" | translate}}</h2>
|
||||||
<p class="mw400">{{"labels.text.Filling Details" | translate}} <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/67141745/Chart+of+Accounts+-+General+Ledger+Setup" target="_blank">{{"labels.inputs.Chart of Accounts" | translate}}</a></p>
|
<p class="mw400">{{"labels.text.Filling Details" | translate}} <a
|
||||||
|
href="https://mifosforge.jira.com/wiki/spaces/docs/pages/67141745/Chart+of+Accounts+-+General+Ledger+Setup"
|
||||||
|
target="_blank">{{"labels.inputs.Chart of Accounts" | translate}}</a></p>
|
||||||
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
|
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||||
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">{{"labels.buttons.Close" | translate}}</button>
|
<button mat-raised-button color="warn"
|
||||||
<button mat-raised-button color="primary" (click)="popover.close()">{{"labels.buttons.Create GL Account" | translate}}</button>
|
(click)="popover.close();configurationWizardService.closeConfigWizard()">{{"labels.buttons.Close" |
|
||||||
<button mat-raised-button color="primary" (click)="popover.close();previousStep()">{{"labels.buttons.Back" | translate}}</button>
|
translate}}</button>
|
||||||
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">{{"labels.buttons.Next" | translate}}</button>
|
<button mat-raised-button color="primary" (click)="popover.close()">{{"labels.buttons.Create GL Account" |
|
||||||
|
translate}}</button>
|
||||||
|
<button mat-raised-button color="primary" (click)="popover.close();previousStep()">{{"labels.buttons.Back" |
|
||||||
|
translate}}</button>
|
||||||
|
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">{{"labels.buttons.Next" |
|
||||||
|
translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
+34
-34
@@ -57,12 +57,12 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit {
|
|||||||
* @param {Matdialog} dialog Matdialog.
|
* @param {Matdialog} dialog Matdialog.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: UntypedFormBuilder,
|
constructor(private formBuilder: UntypedFormBuilder,
|
||||||
private accountingService: AccountingService,
|
private accountingService: AccountingService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private configurationWizardService: ConfigurationWizardService,
|
private configurationWizardService: ConfigurationWizardService,
|
||||||
private popoverService: PopoverService,
|
private popoverService: PopoverService,
|
||||||
public dialog: MatDialog) {
|
public dialog: MatDialog) {
|
||||||
this.route.queryParamMap.subscribe(params => {
|
this.route.queryParamMap.subscribe(params => {
|
||||||
this.accountTypeId = Number(params.get('accountType'));
|
this.accountTypeId = Number(params.get('accountType'));
|
||||||
this.parentId = Number(params.get('parent'));
|
this.parentId = Number(params.get('parent'));
|
||||||
@@ -97,7 +97,7 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit {
|
|||||||
'glCode': ['', Validators.required],
|
'glCode': ['', Validators.required],
|
||||||
'parentId': [this.parentId || undefined],
|
'parentId': [this.parentId || undefined],
|
||||||
'tagId': [''],
|
'tagId': [''],
|
||||||
'manualEntriesAllowed': [true, Validators.required],
|
'manualEntriesAllowed': [true],
|
||||||
'description': ['']
|
'description': ['']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -109,20 +109,20 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit {
|
|||||||
this.glAccountForm.get('type').valueChanges.subscribe(accountTypeId => {
|
this.glAccountForm.get('type').valueChanges.subscribe(accountTypeId => {
|
||||||
switch (accountTypeId) {
|
switch (accountTypeId) {
|
||||||
case 1: this.parentData = this.chartOfAccountsData.assetHeaderAccountOptions;
|
case 1: this.parentData = this.chartOfAccountsData.assetHeaderAccountOptions;
|
||||||
this.tagData = this.chartOfAccountsData.allowedAssetsTagOptions;
|
this.tagData = this.chartOfAccountsData.allowedAssetsTagOptions;
|
||||||
break;
|
break;
|
||||||
case 2: this.parentData = this.chartOfAccountsData.liabilityHeaderAccountOptions;
|
case 2: this.parentData = this.chartOfAccountsData.liabilityHeaderAccountOptions;
|
||||||
this.tagData = this.chartOfAccountsData.allowedLiabilitiesTagOptions;
|
this.tagData = this.chartOfAccountsData.allowedLiabilitiesTagOptions;
|
||||||
break;
|
break;
|
||||||
case 3: this.parentData = this.chartOfAccountsData.equityHeaderAccountOptions;
|
case 3: this.parentData = this.chartOfAccountsData.equityHeaderAccountOptions;
|
||||||
this.tagData = this.chartOfAccountsData.allowedEquityTagOptions;
|
this.tagData = this.chartOfAccountsData.allowedEquityTagOptions;
|
||||||
break;
|
break;
|
||||||
case 4: this.parentData = this.chartOfAccountsData.incomeHeaderAccountOptions;
|
case 4: this.parentData = this.chartOfAccountsData.incomeHeaderAccountOptions;
|
||||||
this.tagData = this.chartOfAccountsData.allowedIncomeTagOptions;
|
this.tagData = this.chartOfAccountsData.allowedIncomeTagOptions;
|
||||||
break;
|
break;
|
||||||
case 5: this.parentData = this.chartOfAccountsData.expenseHeaderAccountOptions;
|
case 5: this.parentData = this.chartOfAccountsData.expenseHeaderAccountOptions;
|
||||||
this.tagData = this.chartOfAccountsData.allowedExpensesTagOptions;
|
this.tagData = this.chartOfAccountsData.allowedExpensesTagOptions;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -188,25 +188,25 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit {
|
|||||||
* Opens dialog if the user wants to create more accounts.
|
* Opens dialog if the user wants to create more accounts.
|
||||||
*/
|
*/
|
||||||
openDialog() {
|
openDialog() {
|
||||||
const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, {
|
const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, {
|
||||||
data: {
|
data: {
|
||||||
stepName: 'GL account'
|
stepName: 'GL account'
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => {
|
continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => {
|
||||||
if (response.step === 1) {
|
if (response.step === 1) {
|
||||||
this.configurationWizardService.showChartofAccountsForm = false;
|
this.configurationWizardService.showChartofAccountsForm = false;
|
||||||
this.router.navigate(['../'], { relativeTo: this.route });
|
this.router.navigate(['../'], { relativeTo: this.route });
|
||||||
} else if (response.step === 2) {
|
} else if (response.step === 2) {
|
||||||
this.configurationWizardService.showChartofAccountsForm = true;
|
this.configurationWizardService.showChartofAccountsForm = true;
|
||||||
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
|
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
|
||||||
this.router.onSameUrlNavigation = 'reload';
|
this.router.onSameUrlNavigation = 'reload';
|
||||||
this.router.navigate(['/accounting/chart-of-accounts/gl-accounts/create']);
|
this.router.navigate(['/accounting/chart-of-accounts/gl-accounts/create']);
|
||||||
} else if (response.step === 3) {
|
} else if (response.step === 3) {
|
||||||
this.configurationWizardService.showChartofAccountsForm = false;
|
this.configurationWizardService.showChartofAccountsForm = false;
|
||||||
this.configurationWizardService.showAccountsLinked = true;
|
this.configurationWizardService.showAccountsLinked = true;
|
||||||
this.router.navigate(['/accounting']);
|
this.router.navigate(['/accounting']);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user