Manage Tax configurations views to use i18n
This commit is contained in:
committed by
Jose Alberto Hernandez
parent
cdc9d74122
commit
caf3d39719
@@ -16,6 +16,7 @@ export class DateFormatPipe implements PipeTransform {
|
||||
return '';
|
||||
}
|
||||
let dateVal;
|
||||
moment.locale(this.settingsService.language.code);
|
||||
if (value instanceof Array) {
|
||||
dateVal = moment(value.join('-'), 'YYYY-MM-DD');
|
||||
} else {
|
||||
|
||||
+33
-42
@@ -9,88 +9,79 @@
|
||||
<div fxLayout="column">
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Name</mat-label>
|
||||
<mat-label>{{'labels.inputs.Name' | translate}}</mat-label>
|
||||
<input matInput required formControlName="name">
|
||||
<mat-error *ngIf="taxComponentForm.controls.name.hasError('required')">
|
||||
Name is <strong>required</strong>
|
||||
{{'labels.inputs.Name' | translate}} {{'labels.commons.is' | translate}}
|
||||
<strong>{{'labels.commons.required' | translate}}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Percentage</mat-label>
|
||||
<mat-label>{{'labels.inputs.Percentage' | translate}}</mat-label>
|
||||
<input type="number" matInput required formControlName="percentage">
|
||||
<mat-error *ngIf="taxComponentForm.controls.percentage.hasError('required')">
|
||||
Percentage is <strong>required</strong>
|
||||
{{'labels.inputs.Percentage ' | translate}} {{'labels.commons.is' | translate}}
|
||||
<strong>{{'labels.commons.required' | translate}}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="taxComponentForm.controls.percentage.hasError('pattern') ||
|
||||
taxComponentForm.controls.percentage.hasError('max')">
|
||||
Percentage <strong>should</strong> be larger than 0 and at most 100
|
||||
{{'labels.inputs.Percentage' | translate}} <strong>should</strong> be larger than 0 and at most 100
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Debit Account Type</mat-label>
|
||||
<mat-label>{{'labels.inputs.Debit Account Type' | translate}}</mat-label>
|
||||
<mat-select formControlName="debitAccountType">
|
||||
<mat-option *ngFor="let debitAccountType of debitAccountTypeData" [value]="debitAccountType.id">
|
||||
{{ debitAccountType.value }}
|
||||
{{ 'labels.inputs.accounting.' + debitAccountType.value | translate }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="taxComponentForm.controls.debitAccountType.value">
|
||||
<mat-label>Debit Account</mat-label>
|
||||
<mat-select required formControlName="debitAcountId">
|
||||
<mat-option *ngFor="let debitAccount of debitAccountData" [value]="debitAccount.id">
|
||||
{{ debitAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="taxComponentForm.controls.debitAcountId.hasError('required')">
|
||||
Debit account is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
<mifosx-gl-account-selector *ngIf="debitAccountData.length > 0"
|
||||
[inputFormControl]="taxComponentForm.controls.debitAcountId"
|
||||
[glAccountList]="debitAccountData" [required]="false" [inputLabel]="'Credit Account'">
|
||||
</mifosx-gl-account-selector>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Credit Account Type</mat-label>
|
||||
<mat-label>{{'labels.inputs.Credit Account Type' | translate}}</mat-label>
|
||||
<mat-select formControlName="creditAccountType">
|
||||
<mat-option *ngFor="let creditAccountType of creditAccountTypeData" [value]="creditAccountType.id">
|
||||
{{ creditAccountType.value }}
|
||||
{{ 'labels.inputs.accounting.' + creditAccountType.value | translate }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="taxComponentForm.controls.creditAccountType.value">
|
||||
<mat-label>Credit Account</mat-label>
|
||||
<mat-select required formControlName="creditAcountId">
|
||||
<mat-option *ngFor="let creditAccount of creditAccountData" [value]="creditAccount.id">
|
||||
{{ creditAccount.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="taxComponentForm.controls.creditAcountId.hasError('required')">
|
||||
Credit account is <strong>required</strong>
|
||||
<mifosx-gl-account-selector *ngIf="creditAccountData.length > 0"
|
||||
[inputFormControl]="taxComponentForm.controls.creditAcountId"
|
||||
[glAccountList]="creditAccountData" [required]="false" [inputLabel]="'Credit Account'">
|
||||
</mifosx-gl-account-selector>
|
||||
|
||||
<mat-form-field (click)="startDatePicker.open()">
|
||||
<mat-label>{{'labels.inputs.Start Date' | translate}}</mat-label>
|
||||
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="startDatePicker" required
|
||||
formControlName="startDate">
|
||||
<mat-datepicker-toggle matSuffix [for]="startDatePicker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #startDatePicker></mat-datepicker>
|
||||
<mat-error *ngIf="taxComponentForm.controls.startDate.hasError('required')">
|
||||
{{'labels.inputs.Start Date' | translate}} {{'labels.commons.is' | translate}}
|
||||
<strong>{{'labels.commons.required' | translate}}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field (click)="startDatePicker.open()">
|
||||
<mat-label>Start date</mat-label>
|
||||
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="startDatePicker" required formControlName="startDate">
|
||||
<mat-datepicker-toggle matSuffix [for]="startDatePicker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #startDatePicker></mat-datepicker>
|
||||
<mat-error *ngIf="taxComponentForm.controls.startDate.hasError('required')">
|
||||
Start date is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!taxComponentForm.valid" *mifosxHasPermission="'CREATE_TAXCOMPONENT'">Submit</button>
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">{{'labels.buttons.Cancel' | translate}}</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!taxComponentForm.valid"
|
||||
*mifosxHasPermission="'CREATE_TAXCOMPONENT'">{{'labels.buttons.Submit' | translate}}</button>
|
||||
</mat-card-actions>
|
||||
|
||||
</form>
|
||||
|
||||
</mat-card>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
+2
-2
@@ -29,11 +29,11 @@ export class CreateTaxComponentComponent implements OnInit {
|
||||
/** Credit Account Type data. */
|
||||
creditAccountTypeData: any;
|
||||
/** Credit Account data. */
|
||||
creditAccountData: any;
|
||||
creditAccountData: any[] = [];
|
||||
/** Debit Account Type data. */
|
||||
debitAccountTypeData: any;
|
||||
/** Debit Account data. */
|
||||
debitAccountData: any;
|
||||
debitAccountData: any[] = [];
|
||||
|
||||
/**
|
||||
* Retrieves the tax Component template data from `resolve`.
|
||||
|
||||
+10
-10
@@ -9,38 +9,38 @@
|
||||
<div fxLayout="column">
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Name</mat-label>
|
||||
<mat-label>{{'labels.inputs.Name' | translate}}</mat-label>
|
||||
<input matInput required formControlName="name">
|
||||
<mat-error *ngIf="taxComponentForm.controls.name.hasError('required')">
|
||||
Name is <strong>required</strong>
|
||||
{{'labels.inputs.Name' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Percentage</mat-label>
|
||||
<mat-label>{{'labels.inputs.Percentage' | translate}}</mat-label>
|
||||
<input matInput required formControlName="percentage">
|
||||
<mat-error *ngIf="taxComponentForm.controls.name.hasError('required')">
|
||||
Percentage is <strong>required</strong>
|
||||
{{'labels.inputs.Percentage' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="taxComponentData.creditAccountType.value">
|
||||
<mat-label>Credit Account Type</mat-label>
|
||||
<mat-label>{{'labels.inputs.Credit Account Type' | translate}}</mat-label>
|
||||
<input matInput formControlName="creditAccountType">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="taxComponentData.creditAccount.name">
|
||||
<mat-label>Credit Account</mat-label>
|
||||
<mat-label>{{'labels.inputs.Credit Account' | translate}}</mat-label>
|
||||
<input matInput formControlName="creditAccount">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field (click)="startDatePicker.open()">
|
||||
<mat-label>Start Date</mat-label>
|
||||
<mat-label>{{'labels.inputs.Start Date' | translate}}</mat-label>
|
||||
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="startDatePicker" required formControlName="startDate">
|
||||
<mat-datepicker-toggle matSuffix [for]="startDatePicker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #startDatePicker></mat-datepicker>
|
||||
<mat-error *ngIf="taxComponentForm.controls.startDate.hasError('required')">
|
||||
Start Date is <strong>required</strong>
|
||||
{{'labels.inputs.Start Date' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!taxComponentForm.valid" *mifosxHasPermission="'UPDATE_TAXCOMPONENT'">Submit</button>
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">{{'labels.buttons.Cancel' | translate}}</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!taxComponentForm.valid" *mifosxHasPermission="'UPDATE_TAXCOMPONENT'">{{'labels.buttons.Submit' | translate}}</button>
|
||||
</mat-card-actions>
|
||||
|
||||
</form>
|
||||
|
||||
+4
-2
@@ -7,6 +7,7 @@ import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { ProductsService } from '../../products.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
/**
|
||||
* Edit tax component.
|
||||
@@ -41,7 +42,8 @@ export class EditTaxComponentComponent implements OnInit {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) {
|
||||
private settingsService: SettingsService,
|
||||
private translateService: TranslateService) {
|
||||
this.route.data.subscribe((data: { taxComponent: any }) => {
|
||||
this.taxComponentData = data.taxComponent;
|
||||
});
|
||||
@@ -64,7 +66,7 @@ export class EditTaxComponentComponent implements OnInit {
|
||||
'name': [this.taxComponentData.name, [Validators.required]],
|
||||
'percentage': [this.taxComponentData.percentage, [Validators.required, Validators.pattern('^(0*[1-9][0-9]*(\\.[0-9]+)?|0+\\.[0-9]*[1-9][0-9]*)$'), Validators.max(100)]],
|
||||
'startDate': [this.taxComponentData.startDate && new Date(this.taxComponentData.startDate)],
|
||||
'creditAccountType': [{ value: this.taxComponentData.creditAccountType.value, disabled: true }],
|
||||
'creditAccountType': [{ value: this.translateService.instant('labels.inputs.accounting.' + this.taxComponentData.creditAccountType.value), disabled: true }],
|
||||
'creditAccount': [{ value: this.taxComponentData.creditAccount.name, disabled: true }]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
|
||||
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_TAXCOMPONENT'">
|
||||
<fa-icon icon="plus" class="m-r-10"></fa-icon>
|
||||
Create Tax Component
|
||||
{{'labels.buttons.Create Tax Component' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -19,13 +19,23 @@
|
||||
<table mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Name' | translate}} </th>
|
||||
<td mat-cell *matCellDef="let taxComponent"> {{ taxComponent.name }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="percentage">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Percentage </th>
|
||||
<td mat-cell *matCellDef="let taxComponent"> {{ taxComponent.percentage }} </td>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Percentage' | translate}} %</th>
|
||||
<td mat-cell *matCellDef="let taxComponent"> {{ taxComponent.percentage | formatNumber }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="startDate">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Start Date' | translate}} </th>
|
||||
<td mat-cell *matCellDef="let taxComponent"> {{ taxComponent.startDate | dateFormat }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="glAccount">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Account' | translate}} </th>
|
||||
<td mat-cell *matCellDef="let taxComponent"> ({{ taxComponent.creditAccount.glCode }}) {{ taxComponent.creditAccount.name }} </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
|
||||
@@ -21,7 +21,7 @@ export class ManageTaxComponentsComponent implements OnInit {
|
||||
/** Tax Components data. */
|
||||
taxComponentData: any;
|
||||
/** Columns to be displayed in tax component table. */
|
||||
displayedColumns: string[] = ['name', 'percentage'];
|
||||
displayedColumns: string[] = ['name', 'percentage', 'startDate', 'glAccount'];
|
||||
/** Data source for tax component table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
|
||||
|
||||
+12
-12
@@ -1,7 +1,7 @@
|
||||
<div class="container m-b-20" fxLayout="row" fxLayout.lt-md="column" fxLayoutAlign="end" fxLayoutGap="2%">
|
||||
<button mat-raised-button color="primary" [routerLink]="['edit']" *mifosxHasPermission="'UPDATE_TAXCOMPONENT'">
|
||||
<fa-icon icon="edit" class="m-r-10"></fa-icon>
|
||||
Edit
|
||||
{{'labels.buttons.Edit' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div fxLayout="row wrap" class="content">
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong">
|
||||
Name
|
||||
{{ 'labels.inputs.Name' | translate}}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%">
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong">
|
||||
Percentage
|
||||
{{ 'labels.inputs.Percentage' | translate}}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%">
|
||||
@@ -30,7 +30,7 @@
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong" *ngIf="taxComponentData.debitAccountType">
|
||||
Debit Account Type
|
||||
{{'labels.inputs.Debit Account Type' | translate }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" *ngIf="taxComponentData.debitAccountType">
|
||||
@@ -38,31 +38,31 @@
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong" *ngIf="taxComponentData.debitAccount">
|
||||
Debit Account
|
||||
{{ 'labels.inputs.Debit Account' | translate }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" *ngIf="taxComponentData.debitAccount">
|
||||
{{ taxComponentData.debitAccount.name}}
|
||||
({{ 'labels.inputs.accounting.' + taxComponentData.debitAccount.glCode }}) {{ taxComponentData.debitAccount.name | translate }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong" *ngIf="taxComponentData.creditAccountType">
|
||||
Credit Account Type
|
||||
{{ 'labels.inputs.Credit Account Type' | translate }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" *ngIf="taxComponentData.creditAccountType">
|
||||
{{ taxComponentData.creditAccountType.value }}
|
||||
{{ 'labels.inputs.accounting.' + taxComponentData.creditAccountType.value | translate }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong" *ngIf="taxComponentData.creditAccount">
|
||||
Credit Account
|
||||
{{ 'labels.inputs.Credit Account' | translate }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" *ngIf="taxComponentData.creditAccount">
|
||||
{{ taxComponentData.creditAccount.name }}
|
||||
({{ taxComponentData.creditAccount.glCode }}) {{ taxComponentData.creditAccount.name }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong">
|
||||
Start date
|
||||
{{ 'labels.inputs.Start Date' | translate }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%">
|
||||
@@ -74,7 +74,7 @@
|
||||
</mat-card-content>
|
||||
|
||||
<div fxLayout="row" fxLayoutAlign="center" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||
<button type="button" color="primary" mat-raised-button [routerLink]="['../']">Back</button>
|
||||
<button type="button" color="primary" mat-raised-button [routerLink]="['../']">{{'labels.buttons.Back' | translate}}</button>
|
||||
</div>
|
||||
</mat-card>
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
<mat-icon matListIcon>
|
||||
<fa-icon icon="building" size="sm"></fa-icon>
|
||||
</mat-icon>
|
||||
<h4 matLine>Manage Tax Components</h4>
|
||||
<p matLine>Define Tax components</p>
|
||||
<h4 matLine>{{'labels.heading.Manage Tax Components' | translate}}</h4>
|
||||
<p matLine>{{'labels.heading.Define Tax Components' | translate}}</p>
|
||||
</mat-list-item>
|
||||
|
||||
</mat-nav-list>
|
||||
@@ -28,8 +28,8 @@
|
||||
<mat-icon matListIcon>
|
||||
<fa-icon icon="building" size="sm"></fa-icon>
|
||||
</mat-icon>
|
||||
<h4 matLine>Manage Tax Groups</h4>
|
||||
<p matLine>Define Tax Groups</p>
|
||||
<h4 matLine>{{'labels.heading.Manage Tax Groups' | translate}}</h4>
|
||||
<p matLine>{{'labels.heading.Define Tax Groups' | translate}}</p>
|
||||
</mat-list-item>
|
||||
|
||||
</mat-nav-list>
|
||||
|
||||
+11
-14
@@ -9,46 +9,43 @@
|
||||
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||
|
||||
<mat-form-field fxFlex="100%">
|
||||
<mat-label>Name</mat-label>
|
||||
<mat-label>{{'labels.inputs.Name' | translate}}</mat-label>
|
||||
<input matInput required formControlName="name">
|
||||
<mat-error *ngIf="taxGroupForm.controls.name.hasError('required')">
|
||||
Name is <strong>required</strong>
|
||||
{{'labels.inputs.Name' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<h3 fxFlex="40%" class="mat-h3">Tax Components</h3>
|
||||
<h3 fxFlex="40%" class="mat-h3">{{'labels.inputs.Tax Components' | translate}}</h3>
|
||||
|
||||
<div fxFlex="40%" fxLayout="row" fxLayoutAlign="start center">
|
||||
<button type="button" mat-raised-button color="primary" (click)="addTaxGroup()">
|
||||
<fa-icon icon="plus" class="m-r-10"></fa-icon>
|
||||
Add
|
||||
{{'labels.buttons.Add' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<table mat-table [dataSource]="taxComponentsDataSource" [hidden]="taxComponentsDataSource.length === 0">
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef> Name </th>
|
||||
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Name' | translate}} </th>
|
||||
<td mat-cell *matCellDef="let taxComponent">
|
||||
{{ taxComponent.taxComponentId | find: taxComponentOptions:'id':'name'}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="startDate">
|
||||
<th mat-header-cell *matHeaderCellDef> Start Date </th>
|
||||
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Start Date' | translate}} </th>
|
||||
<td mat-cell *matCellDef="let taxComponent"> {{ taxComponent.startDate | dateFormat }}
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef> Actions </th>
|
||||
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Actions' | translate}} </th>
|
||||
<td mat-cell *matCellDef="let taxComponent; let taxComponentIndex = index">
|
||||
<button type="button" mat-icon-button color="primary" (click)="editTaxGroup(taxComponent, taxComponentIndex)"
|
||||
matTooltip="Edit" matTooltipPosition="left">
|
||||
<button type="button" mat-icon-button color="primary" (click)="editTaxGroup(taxComponent, taxComponentIndex)">
|
||||
<fa-icon icon="edit"></fa-icon>
|
||||
</button>
|
||||
<button type="button" mat-icon-button color="warn"
|
||||
(click)="delete(taxComponentIndex)" matTooltip="Delete"
|
||||
matTooltipPosition="left">
|
||||
<button type="button" mat-icon-button color="warn" (click)="delete(taxComponentIndex)" matTooltipPosition="left">
|
||||
<fa-icon icon="trash"></fa-icon>
|
||||
</button>
|
||||
</td>
|
||||
@@ -64,8 +61,8 @@
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!taxGroupForm.valid" *mifosxHasPermission="'CREATE_TAXGROUP'">Submit</button>
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">{{'labels.buttons.Cancel' | translate}}</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!taxGroupForm.valid" *mifosxHasPermission="'CREATE_TAXGROUP'">{{'labels.buttons.Submit' | translate}}</button>
|
||||
</mat-card-actions>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -15,6 +15,7 @@ import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicke
|
||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
/**
|
||||
* Create Tax Group component.
|
||||
@@ -57,8 +58,9 @@ export class CreateTaxGroupComponent implements OnInit {
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService) {
|
||||
private dialog: MatDialog,
|
||||
private settingsService: SettingsService,
|
||||
private translateService: TranslateService) {
|
||||
this.route.data.subscribe((data: { taxGroupTemplate: any }) => {
|
||||
this.taxGroupTemplateData = data.taxGroupTemplate;
|
||||
this.taxComponentOptions = this.taxGroupTemplateData.taxComponents;
|
||||
@@ -86,20 +88,20 @@ export class CreateTaxGroupComponent implements OnInit {
|
||||
const formfields: FormfieldBase[] = [
|
||||
new SelectBase({
|
||||
controlName: 'taxComponentId',
|
||||
label: 'Tax Component',
|
||||
label: this.translateService.instant('labels.inputs.Tax Component'),
|
||||
options: { label: 'name', value: 'id', data: this.taxComponentOptions },
|
||||
order: 1
|
||||
}),
|
||||
new DatepickerBase({
|
||||
controlName: 'startDate',
|
||||
label: 'Start Date',
|
||||
label: this.translateService.instant('labels.inputs.Start Date'),
|
||||
minDate: this.minDate,
|
||||
maxDate: this.maxDate,
|
||||
order: 2
|
||||
})
|
||||
];
|
||||
const data = {
|
||||
title: 'Add Tax Component',
|
||||
title: this.translateService.instant('labels.buttons.Add') + ' ' + this.translateService.instant('labels.inputs.Tax Component'),
|
||||
layout: { addButtonText: 'Add' },
|
||||
formfields: formfields
|
||||
};
|
||||
|
||||
@@ -9,47 +9,46 @@
|
||||
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||
|
||||
<mat-form-field fxFlex="100%">
|
||||
<mat-label>Name</mat-label>
|
||||
<mat-label>{{'labels.inputs.Name' | translate}}</mat-label>
|
||||
<input matInput required formControlName="name">
|
||||
<mat-error *ngIf="taxGroupForm.controls.name.hasError('required')">
|
||||
Name is <strong>required</strong>
|
||||
{{'labels.inputs.Name' | translate}} {{'labels.commons.is' | translate}} <strong>{{'labels.commons.required' | translate}}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<h3 fxFlex="40%" class="mat-h3">Tax Components</h3>
|
||||
<h3 fxFlex="40%" class="mat-h3">{{'labels.inputs.Tax Components' | translate}}</h3>
|
||||
|
||||
<div fxFlex="40%" fxLayout="row" fxLayoutAlign="start center">
|
||||
<button type="button" mat-raised-button color="primary" (click)="addTaxGroup()">
|
||||
<fa-icon icon="plus" class="m-r-10"></fa-icon>
|
||||
Add
|
||||
{{'labels.buttons.Add' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<table mat-table [dataSource]="taxComponentsDataSource" [hidden]="taxComponentsDataSource.length === 0">
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef> Name </th>
|
||||
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Name' | translate}} </th>
|
||||
<td mat-cell *matCellDef="let taxComponent">
|
||||
{{ taxComponent.taxComponentId | find: taxComponentOptions:'id':'name'}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="startDate">
|
||||
<th mat-header-cell *matHeaderCellDef> Start Date </th>
|
||||
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Start Date' | translate}} </th>
|
||||
<td mat-cell *matCellDef="let taxComponent"> {{ taxComponent.startDate | dateFormat }}
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="endDate">
|
||||
<th mat-header-cell *matHeaderCellDef> End Date </th>
|
||||
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.End Date' | translate}} </th>
|
||||
<td mat-cell *matCellDef="let taxComponent"> {{ taxComponent.endDate ? (taxComponent.endDate | dateFormat) : '' }}
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef> Actions </th>
|
||||
<th mat-header-cell *matHeaderCellDef> {{'labels.inputs.Actions' | translate}} </th>
|
||||
<td mat-cell *matCellDef="let taxComponent; let taxComponentIndex = index">
|
||||
<button type="button" mat-icon-button color="primary" (click)="editTaxGroup(taxComponent, taxComponentIndex)"
|
||||
matTooltip="Edit" matTooltipPosition="left">
|
||||
<button type="button" mat-icon-button color="primary" (click)="editTaxGroup(taxComponent, taxComponentIndex)">
|
||||
<fa-icon icon="edit"></fa-icon>
|
||||
</button>
|
||||
<button type="button" mat-icon-button color="warn" *ngIf="taxComponent.isNew"
|
||||
@@ -70,8 +69,8 @@
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!taxGroupForm.valid" *mifosxHasPermission="'UPDATE_TAXGROUP'">Submit</button>
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">{{'labels.buttons.Cancel' | translate}}</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!taxGroupForm.valid" *mifosxHasPermission="'UPDATE_TAXGROUP'">{{'labels.buttons.Submit' | translate}}</button>
|
||||
</mat-card-actions>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
|
||||
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_TAXGROUP'">
|
||||
<fa-icon icon="plus" class="m-r-10"></fa-icon>
|
||||
Create Tax Groups
|
||||
{{'labels.buttons.Create Tax Groups' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<table mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="name">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{'labels.inputs.Name' | translate }} </th>
|
||||
<td mat-cell *matCellDef="let taxGroups"> {{ taxGroups.name }} </td>
|
||||
</ng-container>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="container m-b-20" fxLayout="row" fxLayout.lt-md="column" fxLayoutAlign="end" fxLayoutGap="2%">
|
||||
<button mat-raised-button color="primary" [routerLink]="['edit']" *mifosxHasPermission="'UPDATE_TAXGROUP'">
|
||||
<fa-icon icon="edit" class="m-r-10"></fa-icon>
|
||||
Edit
|
||||
{{ 'labels.buttons.Edit' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<div fxLayout="row wrap" class="content">
|
||||
|
||||
<div fxFlex="33%" class="mat-body-strong">
|
||||
Name
|
||||
{{'labels.inputs.Name' | translate}}
|
||||
</div>
|
||||
|
||||
<div fxFlex="67%">
|
||||
@@ -22,15 +22,15 @@
|
||||
</div>
|
||||
|
||||
<div fxFlex="34%" class="mat-body-strong">
|
||||
Tax-Component Name
|
||||
{{'labels.inputs.Tax Component' | translate}}
|
||||
</div>
|
||||
|
||||
<div fxFlex="33%" class="mat-body-strong">
|
||||
Start Date
|
||||
{{'labels.inputs.Start Date' | translate}}
|
||||
</div>
|
||||
|
||||
<div fxFlex="33%" class="mat-body-strong">
|
||||
End Date
|
||||
{{'labels.inputs.End Date' | translate}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user