Translated all HTML files within the charges folder under the product module. Utilized TranslateService for the translation process. Additionally, added the missing translation.

This commit enhances the internationalization of the product module, ensuring a more comprehensive localization for users.
This commit is contained in:
omar
2024-03-22 21:53:21 -06:00
committed by Jose Alberto Hernandez
parent cac62aae2a
commit dac11a5758
17 changed files with 188 additions and 101 deletions
+12 -12
View File
@@ -2,7 +2,7 @@
<div #buttonCreateCharge class="in-block">
<button mat-raised-button color="primary" [routerLink]="['create']" *mifosxHasPermission="'CREATE_CHARGE'">
<fa-icon icon="plus" class="m-r-10"></fa-icon>
Create Charge
{{"labels.text.Create Charge" | translate}}
</button>
</div>
</div>
@@ -21,32 +21,32 @@
<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 charge"> {{ charge.name }} </td>
</ng-container>
<ng-container matColumnDef="chargeAppliesTo">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Applies To </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.inputs.Applies To" | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{ charge.chargeAppliesTo.value }} </td>
</ng-container>
<ng-container matColumnDef="chargeTimeType">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Time </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.inputs.Time" | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{ charge.chargeTimeType.value }} </td>
</ng-container>
<ng-container matColumnDef="chargeCalculationType">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Calculation </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.inputs.Calculation" | translate}} </th>
<td mat-cell *matCellDef="let charge"> {{ charge.chargeCalculationType.value }} </td>
</ng-container>
<ng-container matColumnDef="amount">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Amount </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.inputs.Amount" | translate}} </th>
<td mat-cell *matCellDef="let charge" class="r-amount"> {{ charge.amount | formatNumber }} </td>
</ng-container>
<ng-container matColumnDef="penalty">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Is Penalty? </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.commons.Is" | translate}} {{"labels.inputs.Penalty" | translate}}? </th>
<td mat-cell *matCellDef="let charge" class="center">
<fa-icon *ngIf="charge.penalty" icon="check-circle" size="lg" class="ispenalty" matTooltip="Yes" matTooltipPosition="right"></fa-icon>
<fa-icon *ngIf="!charge.penalty" icon="times-circle" size="lg" class="nopenalty" matTooltip="No" matTooltipPosition="right"></fa-icon>
@@ -54,7 +54,7 @@
</ng-container>
<ng-container matColumnDef="active">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Is Active? </th>
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.commons.Is" | translate}} {{"labels.status.Active" | translate}}? </th>
<td mat-cell *matCellDef="let charge" class="center">
<div [className]="charge.active === true ? 'true' : 'false'">
<fa-icon matTooltip="{{ charge.active === true ? 'Active' : 'Inactive' }}" matTooltipPosition="right" icon="circle" size="lg"></fa-icon>
@@ -74,8 +74,8 @@
</div>
<ng-template #templateButtonCreateCharge let-popover="popover">
<h2>Create Charge</h2>
<p class="mw300">This option allows you to create new charges. It supports Loan charges, Savings & deposits charges and Client charges.</p>
<h2>{{"labels.text.Create Charge" | translate}}</h2>
<p class="mw300">{{"labels.text.Supports Loan charges, Savings & deposits" | translate}}</p>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStep()">Back</button>
@@ -84,7 +84,7 @@
</ng-template>
<ng-template #templateFilter let-popover="popover">
<h4>Search bar to filter charges.</h4>
<h4>{{"labels.heading.Search bar to filter charges." | translate}}</h4>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateButtonCreateCharge,buttonCreateCharge , 'bottom', true)">Back</button>
@@ -93,7 +93,7 @@
</ng-template>
<ng-template #templateChargesTable let-popover="popover">
<h4 class="mw300">List of charges in the organization. For more details click: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/72908813/Charges" target="_blank">Charges</a></h4>
<h4 class="mw300">{{"labels.heading.List of charges in the organization. For more details click" | translate}}: <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/72908813/Charges" target="_blank">Charges</a></h4>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter,filter, 'bottom', true)">Back</button>
@@ -9,7 +9,7 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-label>Charge Applies To</mat-label>
<mat-label>{{"labels.inputs.Charge Applies To" | translate}}</mat-label>
<mat-select required formControlName="chargeAppliesTo">
<mat-option *ngFor="let chargeAppliesTo of chargesTemplateData.chargeAppliesToOptions"
[value]="chargeAppliesTo.id">
@@ -17,7 +17,7 @@
</mat-option>
</mat-select>
<mat-error *ngIf="chargeForm.controls.chargeAppliesTo.hasError('required')">
Charge Applies To is <strong>required</strong>
{{"labels.inputs.Charge Applies To" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
@@ -27,39 +27,39 @@
fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-label>Charge Name</mat-label>
<mat-label>{{"labels.inputs.Charge Name" | translate}}</mat-label>
<input matInput required formControlName="name">
<mat-error *ngIf="chargeForm.controls.name.hasError('required')">
Charge Name is <strong>required</strong>
{{"labels.inputs.Charge Name" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Currency</mat-label>
<mat-label>{{"labels.inputs.Currency" | translate}}</mat-label>
<mat-select required formControlName="currencyCode">
<mat-option *ngFor="let currency of chargesTemplateData.currencyOptions" [value]="currency.code">
{{ currency.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="chargeForm.controls.currencyCode.hasError('required')">
Currency is <strong>required</strong>
{{"labels.inputs.Currency" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Charge Time Type</mat-label>
<mat-label>{{"labels.inputs.Charge Time Type" | translate}}</mat-label>
<mat-select required formControlName="chargeTimeType">
<mat-option *ngFor="let chargeTimeType of chargeTimeTypeData" [value]="chargeTimeType.id">
{{ chargeTimeType.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="chargeForm.controls.chargeTimeType.hasError('required')">
Charge Time Type is <strong>required</strong>
{{"labels.inputs.Charge Time Type" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Charge Calculation Type</mat-label>
<mat-label>{{"labels.inputs.Charge Calculation Type" | translate}}</mat-label>
<mat-select required formControlName="chargeCalculationType">
<mat-option *ngFor="let chargeCalculationType of filteredChargeCalculationType()"
[value]="chargeCalculationType.id">
@@ -67,12 +67,12 @@
</mat-option>
</mat-select>
<mat-error *ngIf="chargeForm.controls.chargeCalculationType.hasError('required')">
Charge Calculation Type is <strong>required</strong>
{{"labels.inputs.Charge Calculation Type" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field *ngIf="chargeForm.controls.chargeAppliesTo.value === 1" fxFlex="48%">
<mat-label>Charge Payment Mode</mat-label>
<mat-label>{{"labels.inputs.Charge Payment Mode" | translate}}</mat-label>
<mat-select required formControlName="chargePaymentMode">
<mat-option *ngFor="let chargePaymentMode of chargesTemplateData.chargePaymetModeOptions"
[value]="chargePaymentMode.id">
@@ -80,33 +80,33 @@
</mat-option>
</mat-select>
<mat-error *ngIf="chargeForm.controls.chargePaymentMode.hasError('required')">
Charge Payment Mode is <strong>required</strong>
{{"labels.inputs.Charge Payment Mode" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<div fxFlex="48%" *ngIf="chargeForm.controls.chargeTimeType.value === 9" class="add-fee-frequency-wrapper">
<mat-checkbox labelPosition="before" formControlName="addFeeFrequency">
Add Fee Frequency
{{"labels.inputs.Add Fee Frequency" | translate}}
</mat-checkbox>
</div>
<mat-form-field
*ngIf="chargeForm.controls.chargeTimeType.value === 9 && chargeForm.controls.addFeeFrequency.value"
fxFlex="48%">
<mat-label>Frequency Interval</mat-label>
<mat-label>{{"labels.inputs.Frequency Interval" | translate}}</mat-label>
<input matInput required formControlName="feeInterval">
<mat-error *ngIf="chargeForm.controls.feeInterval.hasError('required')">
Frequency Interval is <strong>required</strong>
{{"labels.inputs.Frequency Interval" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
<mat-error *ngIf="chargeForm.controls.feeInterval.hasError('pattern')">
Frequency Interval <strong>must be a positive integer</strong>
{{"labels.inputs.Frequency Interval" | translate}} <strong>{{"labels.commons.must be a positive integer" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field
*ngIf="chargeForm.controls.chargeTimeType.value === 9 && chargeForm.controls.addFeeFrequency.value"
fxFlex="48%">
<mat-label>Charge Frequency</mat-label>
<mat-label>{{"labels.inputs.Charge Frequency" | translate}}</mat-label>
<mat-select required formControlName="feeFrequency">
<mat-option *ngFor="let feeFrequency of chargesTemplateData.feeFrequencyOptions"
[value]="feeFrequency.id">
@@ -114,87 +114,87 @@
</mat-option>
</mat-select>
<mat-error *ngIf="chargeForm.controls.feeFrequency.hasError('required')">
Charge Frequency is <strong>required</strong>
{{"labels.inputs.Charge Frequency" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field (click)="dueDatePicker.open()"
*ngIf="chargeForm.controls.chargeTimeType.value === 6 || chargeForm.controls.chargeTimeType.value === 7"
fxFlex="48%">
<mat-label>Due Date</mat-label>
<mat-label>{{"labels.inputs.Due Date" | translate}}</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="dueDatePicker" required
formControlName="feeOnMonthDay">
<mat-datepicker-toggle matSuffix [for]="dueDatePicker"></mat-datepicker-toggle>
<mat-datepicker #dueDatePicker></mat-datepicker>
<mat-error *ngIf="chargeForm.controls.feeOnMonthDay.hasError('required')">
Due Date is <strong>required</strong>
{{"labels.inputs.Due Date" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%"
*ngIf="chargeForm.controls.chargeTimeType.value === 7 || chargeForm.controls.chargeTimeType.value === 11">
<mat-label>Repeat Every ({{ repeatEveryLabel }})</mat-label>
<mat-label>{{"labels.inputs.Repeat Every" | translate}} ({{ repeatEveryLabel }})</mat-label>
<input matInput required formControlName="feeInterval">
<mat-error *ngIf="chargeForm.controls.feeInterval.hasError('required')">
Repeat Every ({{ repeatEveryLabel }}) is <strong>required</strong>
{{"labels.inputs.Repeat Every" | translate}} ({{ repeatEveryLabel }}) {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
<mat-error
*ngIf="(chargeForm.controls.feeInterval.hasError('min') || chargeForm.controls.feeInterval.hasError('max')) && !chargeForm.controls.feeInterval.hasError('pattern')">
Repeat Every ({{ repeatEveryLabel }}) <strong>must be between 1 and 12</strong>
{{"labels.inputs.Repeat Every" | translate}} ({{ repeatEveryLabel }}) <strong>{{"labels.commons.must be between 1 and 12" | translate}}</strong>
</mat-error>
<mat-error *ngIf="chargeForm.controls.feeInterval.hasError('pattern')">
Repeat Every ({{ repeatEveryLabel }}) <strong>must be a positive integer</strong>
{{"labels.inputs.Repeat Every" | translate}} ({{ repeatEveryLabel }}) <strong>{{"labels.commons.must be a positive integer" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Amount</mat-label>
<mat-label>{{"labels.inputs.Amount" | translate}}</mat-label>
<input matInput required formControlName="amount">
<mat-error *ngIf="chargeForm.controls.amount.hasError('required')">
Amount is <strong>required</strong>
{{"labels.inputs.Amount" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
<mat-error *ngIf="chargeForm.controls.amount.hasError('pattern') && currencyDecimalPlaces !== undefined">
Amount must be <strong>a positive number with {{ currencyDecimalPlaces ? 'up to ' +
currencyDecimalPlaces : 'no' }} decimal places</strong>
{{"labels.inputs.Amount" | translate}} {{"labels.commons.must be" | translate}} <strong>{{"labels.commons.a positive number with" | translate}} {{ currencyDecimalPlaces ? 'up to ' +
currencyDecimalPlaces : 'no' }} {{"labels.inputs.decimal places" | translate}}</strong>
</mat-error>
<mat-error *ngIf="chargeForm.controls.amount.hasError('pattern') && currencyDecimalPlaces === undefined">
Amount must be <strong>a positive number</strong>
{{"labels.inputs.Amount" | translate}} {{"labels.commons.must be" | translate}} <strong>{{"labels.commons.a positive number" | translate}}</strong>
</mat-error>
</mat-form-field>
<!--
* minCap and maxCap only allowed for loan ,shares and savings entitites
* In Loan case: Only for the "charge calculation type" set as "%amount", "% loan amount+interest", "%interest",and"%disbursement amount".
* In Loan case: Only for the "charge calculation type" set as "%amount", "% loan amount+interest", "%interest",and"%disbursement amount".
* In saving case: Only for 1. charge time type is "withdrawlfee" or "savings no activity fee" with charge calculation type as "% amount"
* In shares case: Only for charge time type: SHARE_PURCHASE and SHARE_REDEEM and with charge calculation type as % amount only
-->
<mat-form-field fxFlex="48%"
*ngIf="(chargeForm.controls.chargeAppliesTo.value === 1 && (chargeForm.controls.chargeCalculationType.value === 2 || chargeForm.controls.chargeCalculationType.value === 3 || chargeForm.controls.chargeCalculationType.value === 4 || chargeForm.controls.chargeCalculationType.value==5)) || (chargeForm.controls.chargeAppliesTo.value === 2 && (chargeForm.controls.chargeTimeType.value === 16 || chargeForm.controls.chargeTimeType.value === 5)&&(chargeForm.controls.chargeCalculationType.value === 2)) || (chargeForm.controls.chargeAppliesTo.value === 4 && (chargeForm.controls.chargeTimeType.value==14 || chargeForm.controls.chargeTimeType.value==15) && chargeForm.controls.chargeCalculationType.value === 2)">
<mat-label>Minimum Charge Cap</mat-label>
<mat-label>{{"labels.inputs.Minimum Charge Cap" | translate}}</mat-label>
<input matInput formControlName="minCap">
</mat-form-field>
<mat-form-field fxFlex="48%"
*ngIf="(chargeForm.controls.chargeAppliesTo.value === 1 && (chargeForm.controls.chargeCalculationType.value === 2 || chargeForm.controls.chargeCalculationType.value === 3 || chargeForm.controls.chargeCalculationType.value === 4 || chargeForm.controls.chargeCalculationType.value==5)) || (chargeForm.controls.chargeAppliesTo.value === 2 && (chargeForm.controls.chargeTimeType.value === 16 || chargeForm.controls.chargeTimeType.value === 5)&&(chargeForm.controls.chargeCalculationType.value === 2)) || (chargeForm.controls.chargeAppliesTo.value === 4 && (chargeForm.controls.chargeTimeType.value==14 || chargeForm.controls.chargeTimeType.value==15) && chargeForm.controls.chargeCalculationType.value === 2)">
<mat-label>Maximum Charge Cap</mat-label>
<mat-label>{{"labels.inputs.Maximum Charge Cap" | translate}}</mat-label>
<input matInput formControlName="maxCap">
</mat-form-field>
<div fxFlex="48%" fxLayout="row" fxLayoutGap="2%" fxLayout.lt-md="column">
<div fxFlex="50%" class="active-wrapper">
<mat-checkbox labelPosition="before" formControlName="active">
Active
{{"labels.status.Active" | translate}}
</mat-checkbox>
</div>
<div fxFlex="50%" class="penalty-wrapper">
<mat-checkbox labelPosition="before" formControlName="penalty">
Is Penalty
{{"labels.commons.Is" | translate}} {{"labels.inputs.Penalty" | translate}}
</mat-checkbox>
</div>
</div>
<mat-form-field *ngIf="chargeForm.controls.chargeAppliesTo.value === 3" fxFlex="48%">
<mat-label>Income from Charge </mat-label>
<mat-label>{{"labels.inputs.Income from Charge" | translate}} </mat-label>
<mat-select formControlName="incomeAccountId">
<mat-option *ngFor="let incomeOrLiabilityAccount of incomeAndLiabilityAccountData"
[value]="incomeOrLiabilityAccount.id">
@@ -204,7 +204,7 @@
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Tax Group</mat-label>
<mat-label>{{"labels.inputs.Tax Group" | translate}}</mat-label>
<mat-select formControlName="taxGroupId">
<mat-option *ngFor="let taxGroup of chargesTemplateData.taxGroupOptions" [value]="taxGroup.id">
{{ taxGroup.name }}
@@ -219,13 +219,13 @@
</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 type="button" mat-raised-button [routerLink]="['../']">{{"labels.buttons.Cancel" | translate}}</button>
<button mat-raised-button color="primary" [disabled]="!chargeForm.valid"
*mifosxHasPermission="'CREATE_CHARGE'">Submit</button>
*mifosxHasPermission="'CREATE_CHARGE'">{{"labels.buttons.Submit" | translate}}</button>
</mat-card-actions>
</form>
</mat-card>
</div>
</div>
@@ -9,7 +9,7 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-label>Charges applies to</mat-label>
<mat-label>{{"labels.inputs.Charge Applies To" | translate}}</mat-label>
<mat-select required formControlName="chargeAppliesTo">
<mat-option *ngFor="let chargeAppliesTo of chargeData.chargeAppliesToOptions"
[value]="chargeAppliesTo.id">
@@ -23,53 +23,53 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column" style="margin-top:10px;">
<mat-form-field fxFlex="48%">
<mat-label>Name</mat-label>
<mat-label>{{"labels.inputs.Name" | translate}}</mat-label>
<input matInput required autofocus formControlName="name">
<mat-error *ngIf="chargeForm.controls.name.hasError('required')">
Name <strong>is required</strong>
{{"labels.inputs.Name" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Currency</mat-label>
<mat-label>{{"labels.inputs.Currency" | translate}}</mat-label>
<mat-select required formControlName="currencyCode">
<mat-option *ngFor="let currency of chargeData.currencyOptions" [value]="currency.code">
{{ currency.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="chargeForm.controls.currencyCode.hasError('required')">
Currency Type is <strong>required</strong>
{{"labels.inputs.Currency" | translate}} {{"labels.inputs.Type" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Charge time type</mat-label>
<mat-label>{{"labels.inputs.Charge Time Type" | translate}}</mat-label>
<mat-select required formControlName="chargeTimeType">
<mat-option *ngFor="let chargeTime of chargeTimeTypeOptions" [value]="chargeTime.id">
{{ chargeTime.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="chargeForm.controls.chargeTimeType.hasError('required')">
Charge Time Type is <strong>required</strong>
{{"labels.inputs.Charge Time Type" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Charge calculation</mat-label>
<mat-label>{{"labels.inputs.Charge Calculation" | translate}}</mat-label>
<mat-select required formControlName="chargeCalculationType">
<mat-option *ngFor="let chargeCalculation of chargeCalculationTypeOptions" [value]="chargeCalculation.id">
{{ chargeCalculation.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="chargeForm.controls.chargeCalculationType.hasError('required')">
Charge Calculation Type is <strong>required</strong>
{{"labels.inputs.Charge Calculation Type" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%" *ngIf="chargePaymentMode">
<mat-label>Charge Payment By</mat-label>
<mat-label>{{"labels.inputs.Charge Payment By" | translate}}</mat-label>
<mat-select required formControlName="chargePaymentMode">
<mat-option *ngFor="let chargePaymentMode of chargeData.chargePaymetModeOptions"
[value]="chargePaymentMode.id">
@@ -77,15 +77,15 @@
</mat-option>
</mat-select>
<mat-error *ngIf="chargeForm.controls.chargePaymentMode.hasError('required')">
Charge Payment Mode is <strong>required</strong>
{{"labels.inputs.Charge Payment Mode" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Amount</mat-label>
<mat-label>{{"labels.inputs.Amount" | translate}}</mat-label>
<input matInput required autofocus type="text" formControlName="amount">
<mat-error *ngIf="chargeForm.controls.amount.hasError('required')">
Amount <strong>is required</strong>
{{"labels.inputs.Amount" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<!--
@@ -96,17 +96,17 @@
-->
<mat-form-field fxFlex="48%"
*ngIf="(chargeForm.controls.chargeAppliesTo.value === 1 && (chargeForm.controls.chargeCalculationType.value === 2 || chargeForm.controls.chargeCalculationType.value === 3 || chargeForm.controls.chargeCalculationType.value === 4 || chargeForm.controls.chargeCalculationType.value==5)) || (chargeForm.controls.chargeAppliesTo.value === 2 && (chargeForm.controls.chargeTimeType.value === 16 || chargeForm.controls.chargeTimeType.value === 5)&&(chargeForm.controls.chargeCalculationType.value === 2)) || (chargeForm.controls.chargeAppliesTo.value === 4 && (chargeForm.controls.chargeTimeType.value==14 || chargeForm.controls.chargeTimeType.value==15) && chargeForm.controls.chargeCalculationType.value === 2)">
<mat-label>Minimum Charge Cap </mat-label>
<mat-label>{{"labels.inputs.Minimum Charge Cap" | translate}}</mat-label>
<input matInput autofocus formControlName="minCap">
</mat-form-field>
<mat-form-field fxFlex="48%"
*ngIf="(chargeForm.controls.chargeAppliesTo.value === 1 && (chargeForm.controls.chargeCalculationType.value === 2 || chargeForm.controls.chargeCalculationType.value === 3 || chargeForm.controls.chargeCalculationType.value === 4 || chargeForm.controls.chargeCalculationType.value==5)) || (chargeForm.controls.chargeAppliesTo.value === 2 && (chargeForm.controls.chargeTimeType.value === 16 || chargeForm.controls.chargeTimeType.value === 5)&&(chargeForm.controls.chargeCalculationType.value === 2)) || (chargeForm.controls.chargeAppliesTo.value === 4 && (chargeForm.controls.chargeTimeType.value==14 || chargeForm.controls.chargeTimeType.value==15) && chargeForm.controls.chargeCalculationType.value === 2)">
<mat-label>Maximum Charge Cap </mat-label>
<mat-label>{{"labels.inputs.Maximum Charge Cap" | translate}}</mat-label>
<input matInput autofocus formControlName="maxCap">
</mat-form-field>
<mat-form-field fxFlex="48%" *ngIf="showGLAccount">
<mat-label>Income from charge</mat-label>
<mat-label>{{"labels.inputs.Income from charge" | translate}}</mat-label>
<mat-select required formControlName="incomeAccountId">
<mat-option *ngFor="let income of chargeData.incomeOrLiabilityAccountOptions.incomeAccountOptions"
[value]="income.id">
@@ -114,12 +114,12 @@
</mat-option>
</mat-select>
<mat-error *ngIf="chargeForm.controls.incomeAccountId.hasError('required')">
Income from charge is <strong>required</strong>
{{"labels.inputs.Income from charge" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Tax Group</mat-label>
<mat-label>{{"labels.inputs.Tax Group" | translate}}</mat-label>
<mat-select *ngIf="chargeData.taxGroup" formControlName="taxGroupId">
<mat-option *ngFor="let taxGroup of chargeData.taxGroupOptions" [value]="taxGroup.id">
{{ taxGroup.name }}
@@ -136,27 +136,27 @@
<div fxFlex="48%" class="password-never-expires-wrapper checkbox" *ngIf="addFeeFrequency">
<mat-checkbox labelPosition="before" [checked]="addFeeFrequency && showFeeOptions"
(change)="getFeeFrequency($event.checked)">
Add Fee Frequency
{{"labels.inputs.Add Fee Frequency" | translate}}
</mat-checkbox>
</div>
<mat-form-field fxFlex="48%" *ngIf="addFeeFrequency && showFeeOptions">
<mat-label>Frequency Interval</mat-label>
<mat-label>{{"labels.inputs.Frequency Interval" | translate}}</mat-label>
<input matInput required autofocus type="text" formControlName="feeInterval">
<mat-error *ngIf="chargeForm.controls.feeInterval.hasError('required')">
Frequency Interval <strong>is required</strong>
{{"labels.inputs.Frequency Interval" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%" *ngIf="addFeeFrequency && showFeeOptions">
<mat-label>Charge Frequency</mat-label>
<mat-label>{{"labels.inputs.Charge Frequency" | translate}}</mat-label>
<mat-select required formControlName="feeFrequency">
<mat-option *ngFor="let chargeFrequency of chargeData.feeFrequencyOptions" [value]="chargeFrequency.id">
{{ chargeFrequency.value }}
</mat-option>
</mat-select>
<mat-error *ngIf="chargeForm.controls.feeFrequency.hasError('required')">
Fee Frequency <strong>is required</strong>
{{"labels.inputs.Add Fee Frequency" | translate}} {{"labels.commons.is" | translate}} <strong>{{"labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
@@ -165,13 +165,13 @@
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column" style="margin-top:10px;">
<div fxFlex="48%" class="password-never-expires-wrapper">
<mat-checkbox labelPosition="before" formControlName="active">
Active
{{"labels.status.Active" | translate}}
</mat-checkbox>
</div>
<div fxFlex="48%" class="send-password-to-email-wrapper" *ngIf="showPenalty">
<mat-checkbox labelPosition="before" formControlName="penalty">
Is Penalty
{{"labels.commons.Is" | translate}} {{"labels.inputs.Penalty" | translate}}
</mat-checkbox>
</div>
@@ -180,13 +180,13 @@
</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 type="button" mat-raised-button [routerLink]="['../']">{{"labels.buttons.Cancel" | translate}}</button>
<button mat-raised-button color="primary" [disabled]="!chargeForm.valid"
*mifosxHasPermission="'UPDATE_CHARGE'">Submit</button>
*mifosxHasPermission="'UPDATE_CHARGE'">{{"labels.buttons.Submit" | translate}}</button>
</mat-card-actions>
</form>
</mat-card>
</div>
</div>
@@ -1,11 +1,11 @@
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column" class="container m-b-20">
<button mat-raised-button color="primary" [routerLink]="['edit']" *mifosxHasPermission="'UPDATE_CHARGE'">
<fa-icon icon="edit" class="m-r-10"></fa-icon>
Edit
{{"labels.heading.Edit" | translate}}
</button>
<button mat-raised-button color="warn" (click)="deleteCharge()" *mifosxHasPermission="'DELETE_CHARGE'">
<fa-icon icon="trash" class="m-r-10"></fa-icon>
Delete
{{"labels.heading.Delete" | translate}}
</button>
</div>
@@ -18,7 +18,7 @@
<div fxLayout="row wrap" class="content">
<div fxFlex="50%" class="mat-body-strong">
Charge Name
{{"labels.inputs.Charge Name" | translate}}
</div>
<div fxFlex="50%">
@@ -26,7 +26,7 @@
</div>
<div fxFlex="50%" class="mat-body-strong">
Charge Type
{{"labels.inputs.Charge Type" | translate}}
</div>
<div fxFlex="50%">
@@ -34,7 +34,7 @@
</div>
<div fxFlex="50%" class="mat-body-strong">
Currency
{{"labels.inputs.Currency" | translate}}
</div>
<div fxFlex="50%">
@@ -42,7 +42,7 @@
</div>
<div fxFlex="50%" class="mat-body-strong">
Amount
{{"labels.inputs.Amount" | translate}}
</div>
<div fxFlex="50%">
@@ -50,7 +50,7 @@
</div>
<div fxFlex="50%" class="mat-body-strong" *ngIf="minCap">
Minimum Charge Cap
{{"labels.inputs.Minimum Charge Cap" | translate}}
</div>
<div fxFlex="50%" *ngIf="minCap">
@@ -58,15 +58,15 @@
</div>
<div fxFlex="50%" class="mat-body-strong" *ngIf="maxCap">
Maximum Charge Cap
{{"labels.inputs.Maximum Charge Cap" | translate}}
</div>
<div fxFlex="50%" *ngIf="maxCap">
{{ chargeData.maxCap }}
</div>
<div fxFlex="50%" class="mat-body-strong">
Charge Time Type
{{"labels.inputs.Charge Time Type" | translate}}
</div>
<div fxFlex="50%">
@@ -74,7 +74,7 @@
</div>
<div fxFlex="50%" class="mat-body-strong">
Charge Applies to
{{"labels.inputs.Charge Applies To" | translate}}
</div>
<div fxFlex="50%">
@@ -82,7 +82,7 @@
</div>
<div fxFlex="50%" class="mat-body-strong">
Charge Calculation Type
{{"labels.inputs.Charge Calculation Type" | translate}}
</div>
<div fxFlex="50%">
@@ -90,7 +90,7 @@
</div>
<div fxFlex="50%" class="mat-body-strong">
Charge Payment Mode
{{"labels.inputs.Charge Payment Mode" | translate}}
</div>
<div fxFlex="50%">
@@ -98,7 +98,7 @@
</div>
<div fxFlex="50%" class="mat-body-strong">
Active
{{"labels.status.Active" | translate}}
</div>
<div fxFlex="50%">
@@ -106,7 +106,7 @@
</div>
<div fxFlex="50%" class="mat-body-strong" *ngIf="chargeData.chargeTimeType.id == 9 && chargeData.feeFrequency">
Fee Frequency
{{"labels.inputs.Add Fee Frequency" | translate}}
</div>
<div fxFlex="50%"
@@ -115,7 +115,7 @@
</div>
<div fxFlex="50%" class="mat-body-strong" *ngIf="chargeData.chargeTimeType.id == 9 && chargeData.feeInterval">
Frequency Interval
{{"labels.inputs.Frequency Interval" | translate}}
</div>
<div fxFlex="50%" *ngIf="chargeData.chargeTimeType.id == 9 && chargeData.feeInterval">
@@ -123,7 +123,7 @@
</div>
<div fxFlex="50%" class="mat-body-strong" *ngIf="chargeData.incomeOrLiabilityAccount">
Income from Charges
{{"labels.heading.Income" | translate}} {{"labels.inputs.From" | translate}} {{"labels.heading.Charges" | translate}}
</div>
<div fxFlex="50%" *ngIf="chargeData.incomeOrLiabilityAccount">
@@ -131,7 +131,7 @@
</div>
<div fxFlex="50%" class="mat-body-strong" *ngIf="chargeData.taxGroup">
Tax Group
{{"labels.inputs.Tax Group" | translate}}
</div>
<div fxFlex="50%" *ngIf="chargeData.taxGroup">
@@ -147,4 +147,4 @@
</mat-card>
</div>
</div>
@@ -1,12 +1,13 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
/** Custom Services */
import { ProductsService } from 'app/products/products.service';
/** Custom Components */
import { TranslateService } from '@ngx-translate/core';
import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dialog.component';
/**
@@ -30,11 +31,13 @@ export class ViewChargeComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
* @param {MatDialog} dialog Dialog reference.
* @param {TranslateService} translateService Translate Service.
*/
constructor(private productsService: ProductsService,
private route: ActivatedRoute,
private router: Router,
private dialog: MatDialog) {
private dialog: MatDialog,
private translateService:TranslateService) {
this.route.data.subscribe((data: { charge: any }) => {
this.chargeData = data.charge;
if (this.chargeData.minCap) {
@@ -54,7 +57,7 @@ export class ViewChargeComponent implements OnInit {
*/
deleteCharge() {
const deleteChargeDialogRef = this.dialog.open(DeleteDialogComponent, {
data: { deleteContext: `charge ${this.chargeData.id}` }
data: { deleteContext: this.translateService.instant('labels.inputs.Charge') + " " + this.chargeData.id}
});
deleteChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {