diff --git a/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.html b/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.html
new file mode 100644
index 000000000..0888cfd7b
--- /dev/null
+++ b/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.html
@@ -0,0 +1,96 @@
+
diff --git a/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.scss b/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.scss
new file mode 100644
index 000000000..d774f68da
--- /dev/null
+++ b/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.scss
@@ -0,0 +1,3 @@
+.container {
+ max-width: 37rem;
+}
diff --git a/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.spec.ts b/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.spec.ts
new file mode 100644
index 000000000..5734f144f
--- /dev/null
+++ b/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { CreateTaxComponentComponent } from './create-tax-component.component';
+
+describe('CreateTaxComponentComponent', () => {
+ let component: CreateTaxComponentComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ CreateTaxComponentComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(CreateTaxComponentComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.ts b/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.ts
new file mode 100644
index 000000000..b05d7fbc0
--- /dev/null
+++ b/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.ts
@@ -0,0 +1,128 @@
+/** Angular Imports */
+import { Component, OnInit } from '@angular/core';
+import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
+import { Router, ActivatedRoute } from '@angular/router';
+import { DatePipe } from '@angular/common';
+
+/** Custom Services */
+import { ProductsService } from '../../products.service';
+
+/**
+ * Create Tax Component component.
+ */
+@Component({
+ selector: 'mifosx-create-tax-component',
+ templateUrl: './create-tax-component.component.html',
+ styleUrls: ['./create-tax-component.component.scss']
+})
+export class CreateTaxComponentComponent implements OnInit {
+
+ /** Minimum start date allowed. */
+ minDate = new Date();
+ /** Maximum start date allowed. */
+ maxDate = new Date(new Date().setFullYear(new Date().getFullYear() + 10));
+ /** Tax Component form. */
+ taxComponentForm: FormGroup;
+ /** Tax Component template data. */
+ taxComponentTemplateData: any;
+ /** Credit Account Type data. */
+ creditAccountTypeData: any;
+ /** Credit Account data. */
+ creditAccountData: any;
+ /** Debit Account Type data. */
+ debitAccountTypeData: any;
+ /** Debit Account data. */
+ debitAccountData: any;
+
+ /**
+ * Retrieves the tax Component template data from `resolve`.
+ * @param {FormBuilder} formBuilder Form Builder.
+ * @param {ProductsService} productsService Products Service.
+ * @param {ActivatedRoute} route Activated Route.
+ * @param {Router} router Router for navigation.
+ * @param {DatePipe} datePipe Date Pipe to format date.
+ */
+ constructor(private formBuilder: FormBuilder,
+ private productsService: ProductsService,
+ private route: ActivatedRoute,
+ private router: Router,
+ private datePipe: DatePipe) {
+ this.route.data.subscribe(( data: { taxComponentTemplate: any }) => {
+ this.taxComponentTemplateData = data.taxComponentTemplate;
+ });
+ }
+
+ /**
+ * Creates the tax Component form
+ */
+ ngOnInit() {
+ this.createTaxComponentForm();
+ this.setConditionalControls();
+ }
+
+ /**
+ * Creates the tax Component form
+ */
+ createTaxComponentForm() {
+ this.creditAccountTypeData = this.debitAccountTypeData = this.taxComponentTemplateData.glAccountTypeOptions;
+ this.taxComponentForm = this.formBuilder.group({
+ 'name': ['', Validators.required],
+ 'percentage': ['', [Validators.required, Validators.pattern('^(0*[1-9][0-9]*(\\.[0-9]+)?|0+\\.[0-9]*[1-9][0-9]*)$'), Validators.max(100)]],
+ 'creditAccountType': [''],
+ 'debitAccountType': [''],
+ 'startDate': ['', Validators.required],
+ });
+ }
+
+ /**
+ * Sets the conditional controls of the tax Component form
+ */
+ setConditionalControls() {
+ this.taxComponentForm.get('debitAccountType').valueChanges.subscribe(debitAccountTypeId => {
+ this.debitAccountData = this.getAccountsData(debitAccountTypeId);
+ this.taxComponentForm.addControl('debitAcountId', new FormControl('', Validators.required));
+ });
+ this.taxComponentForm.get('creditAccountType').valueChanges.subscribe(creditAccountTypeId => {
+ this.creditAccountData = this.getAccountsData(creditAccountTypeId);
+ this.taxComponentForm.addControl('creditAcountId', new FormControl('', Validators.required));
+ });
+ }
+
+ /**
+ * @param {number} accountTypeId Account type ID of account type.
+ * @returns {any} Accounts data
+ */
+ getAccountsData(accountTypeId: number) {
+ switch (accountTypeId) {
+ case 1:
+ return this.taxComponentTemplateData.glAccountOptions.assetAccountOptions;
+ case 2:
+ return this.taxComponentTemplateData.glAccountOptions.liabilityAccountOptions;
+ case 3:
+ return this.taxComponentTemplateData.glAccountOptions.equityAccountOptions;
+ case 4:
+ return this.taxComponentTemplateData.glAccountOptions.incomeAccountOptions;
+ case 5:
+ return this.taxComponentTemplateData.glAccountOptions.expenseAccountOptions;
+ }
+ }
+
+ /**
+ * Submits the tax Component form and creates the tax Component,
+ * if successful redirects to Tax Components.
+ */
+ submit() {
+ const prevStartDate: Date = this.taxComponentForm.value.startDate;
+ // TODO: Update once language and date settings are setup
+ const dateFormat = 'yyyy-MM-dd';
+ this.taxComponentForm.patchValue({
+ startDate: this.datePipe.transform(prevStartDate, dateFormat)
+ });
+ const taxComponent = this.taxComponentForm.value;
+ taxComponent.locale = 'en';
+ taxComponent.dateFormat = dateFormat;
+ this.productsService.createTaxComponent(taxComponent).subscribe((response: any) => {
+ this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
+ });
+ }
+}
diff --git a/src/app/products/manage-tax-components/manage-tax-components.component.html b/src/app/products/manage-tax-components/manage-tax-components.component.html
index 6fba8ffe2..cad53b36d 100644
--- a/src/app/products/manage-tax-components/manage-tax-components.component.html
+++ b/src/app/products/manage-tax-components/manage-tax-components.component.html
@@ -1,5 +1,5 @@
-