committed by
Abhay Chawla
parent
d6edcf0554
commit
b0b4a926eb
@@ -29,7 +29,7 @@
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;" class="select-row"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [routerLink]="[row.id]" class="select-row"></tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { ProductsService } from '../products.service';
|
||||
|
||||
/**
|
||||
* tax Component data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class TaxComponentResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {ProductsService} productsService Products service.
|
||||
*/
|
||||
constructor(private productsService: ProductsService) {}
|
||||
|
||||
/**
|
||||
* Returns the tax Component data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const taxComponentId = route.paramMap.get('id');
|
||||
return this.productsService.getTaxComponent(taxComponentId);
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
<div class="container m-b-20" fxLayout="row" fxLayout.lt-md="column" fxLayoutAlign="end" fxLayoutGap="2%">
|
||||
<button mat-raised-button color="primary">
|
||||
<fa-icon icon="edit"></fa-icon>
|
||||
Edit
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<mat-card>
|
||||
|
||||
<mat-card-content>
|
||||
|
||||
<div fxLayout="row wrap" class="content">
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong">
|
||||
Name
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%">
|
||||
{{ taxComponentData.name }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong">
|
||||
Percentage
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%">
|
||||
{{ taxComponentData.percentage }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong" *ngIf="taxComponentData.debitAccountType">
|
||||
Debit Account Type
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" *ngIf="taxComponentData.debitAccountType">
|
||||
{{ taxComponentData.debitAccountType.value }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong" *ngIf="taxComponentData.debitAccount">
|
||||
Debit Account
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" *ngIf="taxComponentData.debitAccount">
|
||||
{{ taxComponentData.debitAccount.name}}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong" *ngIf="taxComponentData.creditAccountType">
|
||||
Credit Account Type
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" *ngIf="taxComponentData.creditAccountType">
|
||||
{{ taxComponentData.creditAccountType.value }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong" *ngIf="taxComponentData.creditAccount">
|
||||
Credit Account
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" *ngIf="taxComponentData.creditAccount">
|
||||
{{ taxComponentData.creditAccount.name }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong">
|
||||
Start date
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%">
|
||||
{{ taxComponentData.startDate | date }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
.container {
|
||||
max-width: 37rem;
|
||||
|
||||
.content {
|
||||
div {
|
||||
margin: 1rem 0;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ViewTaxComponentComponent } from './view-tax-component.component';
|
||||
|
||||
describe('ViewTaxComponentComponent', () => {
|
||||
let component: ViewTaxComponentComponent;
|
||||
let fixture: ComponentFixture<ViewTaxComponentComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ViewTaxComponentComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ViewTaxComponentComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
/**
|
||||
* View tax Component component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-view-tax-component',
|
||||
templateUrl: './view-tax-component.component.html',
|
||||
styleUrls: ['./view-tax-component.component.scss']
|
||||
})
|
||||
export class ViewTaxComponentComponent implements OnInit {
|
||||
|
||||
/** tax Component Data. */
|
||||
taxComponentData: any;
|
||||
|
||||
/**
|
||||
* Retrieves the tax Component data from `resolve`.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute) {
|
||||
this.route.data.subscribe((data: { taxComponent: any }) => {
|
||||
this.taxComponentData = data.taxComponent;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,6 +31,7 @@ import { CreateFixedDepositProductComponent } from './fixed-deposit-products/cre
|
||||
import { ProductsMixComponent } from './products-mix/products-mix.component';
|
||||
import { ManageTaxComponentsComponent } from './manage-tax-components/manage-tax-components.component';
|
||||
import { ManageTaxGroupsComponent } from './manage-tax-groups/manage-tax-groups.component';
|
||||
import { ViewTaxComponentComponent } from './manage-tax-components/view-tax-component/view-tax-component.component';
|
||||
|
||||
/** Custom Resolvers */
|
||||
import { LoanProductsResolver } from './loan-products/loan-products.resolver';
|
||||
@@ -53,6 +54,7 @@ import { FixedDepositProductsTemplateResolver } from './fixed-deposit-products/f
|
||||
import { ProductsMixResolver } from './products-mix/products-mix.resolver';
|
||||
import { ManageTaxComponentsResolver } from './manage-tax-components/manage-tax-components.resolver';
|
||||
import { ManageTaxGroupsResolver } from './manage-tax-groups/manage-tax-groups.resolver';
|
||||
import { TaxComponentResolver } from './manage-tax-components/tax-component.resolver';
|
||||
|
||||
/** Products Routes */
|
||||
const routes: Routes = [
|
||||
@@ -201,11 +203,29 @@ const routes: Routes = [
|
||||
},
|
||||
{
|
||||
path: 'tax-components',
|
||||
component: ManageTaxComponentsComponent,
|
||||
resolve: {
|
||||
taxComponents: ManageTaxComponentsResolver
|
||||
},
|
||||
data: { title: extract('Manage Tax Components'), breadcrumb: 'Tax Components'},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ManageTaxComponentsComponent,
|
||||
resolve: {
|
||||
taxComponents: ManageTaxComponentsResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':id',
|
||||
data: { title: extract('View Tax Component'), routeParamBreadcrumb: 'id' },
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ViewTaxComponentComponent,
|
||||
resolve: {
|
||||
taxComponent: TaxComponentResolver
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: 'tax-groups',
|
||||
@@ -308,7 +328,8 @@ const routes: Routes = [
|
||||
FixedDepositProductsTemplateResolver,
|
||||
ProductsMixResolver,
|
||||
ManageTaxComponentsResolver,
|
||||
ManageTaxGroupsResolver
|
||||
ManageTaxGroupsResolver,
|
||||
TaxComponentResolver
|
||||
]
|
||||
})
|
||||
export class ProductsRoutingModule { }
|
||||
|
||||
@@ -61,6 +61,7 @@ import { FixedDepositProductAccountingStepComponent } from './fixed-deposit-prod
|
||||
import { FixedDepositProductPreviewStepComponent } from './fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-preview-step/fixed-deposit-product-preview-step.component';
|
||||
import { DepositProductIncentiveFormDialogComponent } from './deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component';
|
||||
import { ManageTaxGroupsComponent } from './manage-tax-groups/manage-tax-groups.component';
|
||||
import { ViewTaxComponentComponent } from './manage-tax-components/view-tax-component/view-tax-component.component';
|
||||
|
||||
/**
|
||||
* Products Module
|
||||
@@ -126,7 +127,8 @@ import { ManageTaxGroupsComponent } from './manage-tax-groups/manage-tax-groups.
|
||||
FixedDepositProductAccountingStepComponent,
|
||||
FixedDepositProductPreviewStepComponent,
|
||||
DepositProductIncentiveFormDialogComponent,
|
||||
ManageTaxGroupsComponent
|
||||
ManageTaxGroupsComponent,
|
||||
ViewTaxComponentComponent
|
||||
],
|
||||
entryComponents: [
|
||||
DepositProductIncentiveFormDialogComponent
|
||||
|
||||
@@ -142,6 +142,14 @@ export class ProductsService {
|
||||
return this.http.get('/taxes/component');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} taxComponentId tax Component ID of tax Component.
|
||||
* @returns {Observable<any>} Tax Component.
|
||||
*/
|
||||
getTaxComponent(taxComponentId: string): Observable<any> {
|
||||
return this.http.get(`/taxes/component/${taxComponentId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Observable<any>} Tax Groups data
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user