Merge branch 'master' into glim

This commit is contained in:
Ramveer
2022-08-30 17:37:37 +05:30
committed by GitHub
25 changed files with 189 additions and 170 deletions
@@ -3,7 +3,8 @@
<mat-form-field fxFlex="48%">
<mat-label>Charge</mat-label>
<mat-select #charge>
<mat-option *ngFor="let charge of chargeData | chargesFilter:chargesDataSource:currencyCode.value" [value]="charge">
<mat-option *ngFor="let charge of chargeData | chargesFilter:chargesDataSource:currencyCode.value"
[value]="charge">
{{ charge.name }}
</mat-option>
</mat-select>
@@ -16,7 +17,8 @@
</button>
</div>
<table fxFlex="98%" class="mat-elevation-z1" mat-table [dataSource]="chargesDataSource" [hidden]="chargesDataSource.length === 0">
<table fxFlex="98%" class="mat-elevation-z1" mat-table [dataSource]="chargesDataSource"
*ngIf="chargesDataSource.length > 0">
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef> Name </th>
@@ -35,7 +37,7 @@
<ng-container matColumnDef="amount">
<th mat-header-cell *matHeaderCellDef> Amount </th>
<td mat-cell *matCellDef="let charge">
{{ charge.amount }}
{{ charge.amount }}
<button mat-icon-button color="primary" (click)="editChargeAmount(charge)">
<fa-icon icon="pen"></fa-icon>
</button>
@@ -52,21 +54,19 @@
<ng-container matColumnDef="date">
<th mat-header-cell *matHeaderCellDef> Date </th>
<td mat-cell *matCellDef="let charge">
<span *ngIf="charge.chargeTimeType.value === 'Specified due date' || charge.chargeTimeType.value === 'Weekly Fee'">
{{(charge.dueDate | dateFormat) || 'Unassigned'}}
<span
*ngIf="charge.chargeTimeType.value === 'Specified due date' || charge.chargeTimeType.value === 'Weekly Fee'">
{{(charge.dueDate | dateFormat) || 'Unassigned'}}
</span>
<span *ngIf="charge.chargeTimeType.value === 'Monthly Fee' || charge.chargeTimeType.value === 'Annual Fee'">
{{(charge.feeOnMonthDay | dateFormat) || 'Unassigned'}}
{{(charge.feeOnMonthDay | dateFormat) || 'Unassigned'}}
</span>
<span
*ngIf="!(charge.chargeTimeType.value === 'Monthly Fee' || charge.chargeTimeType.value === 'Annual Fee'
<span *ngIf="!(charge.chargeTimeType.value === 'Monthly Fee' || charge.chargeTimeType.value === 'Annual Fee'
|| charge.chargeTimeType.value === 'Specified due date' || charge.chargeTimeType.value === 'Weekly Fee')">
N/A
</span>
<button mat-icon-button color="primary"
*ngIf="charge.chargeTimeType.value === 'Weekly Fee' || charge.chargeTimeType.value === 'Annual Fee'
|| charge.chargeTimeType.value === 'Specified due date'"
(click)="editChargeDate(charge)">
<button mat-icon-button color="primary" *ngIf="charge.chargeTimeType.value === 'Weekly Fee' || charge.chargeTimeType.value === 'Annual Fee'
|| charge.chargeTimeType.value === 'Specified due date'" (click)="editChargeDate(charge)">
<fa-icon icon="pen"></fa-icon>
</button>
</td>
@@ -75,8 +75,8 @@
<ng-container matColumnDef="repaymentsEvery">
<th mat-header-cell *matHeaderCellDef> Repayments Every </th>
<td mat-cell *matCellDef="let charge">
{{ charge.feeInterval || 'Not Provided' }}
<button mat-icon-button color="primary"
{{ charge.feeInterval || 'Not Provided' }}
<button mat-icon-button color="primary"
*ngIf="charge.chargeTimeType.value === 'Weekly Fee' || charge.chargeTimeType.value === 'Monthly Fee'"
(click)="editChargeFeeInterval(charge)">
<fa-icon icon="pen"></fa-icon>
@@ -59,20 +59,22 @@ export class SavingsAccountChargesStepComponent implements OnInit, OnChanges {
private dateUtils: Dates) {}
ngOnInit() {
this.currencyCode.valueChanges.subscribe(() => {
if (this.savingsAccountTemplate) {
if (!this.isChargesPatched && this.savingsAccountTemplate.charges) {
this.chargesDataSource = this.savingsAccountTemplate.charges.map((charge: any) => ({...charge, id: charge.chargeId})) || [];
this.chargesDataSource = this.savingsAccountProductTemplate.charges.map((charge: any) => ({...charge, id: charge.chargeId})) || [];
this.isChargesPatched = true;
} else {
this.chargesDataSource = [];
}
this.dataSource = new MatTableDataSource<any>(this.activeClientMembers);
});
}
}
ngOnChanges() {
if (this.savingsAccountProductTemplate) {
this.chargeData = this.savingsAccountProductTemplate.chargeOptions;
this.chargesDataSource = this.savingsAccountProductTemplate.charges.map((charge: any) => ({...charge, id: charge.chargeId})) || [];
}
}
@@ -12,6 +12,11 @@
<input type="number" matInput formControlName="decimal">
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Currency in multiples of</mat-label>
<input type="number" matInput formControlName="currencyMultiple" >
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Nominal Annual Interest Rate</mat-label>
<input type="number" matInput formControlName="nominalAnnualInterestRate" required>
@@ -32,11 +37,6 @@
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Currency in multiples of</mat-label>
<input type="number" matInput formControlName="currencyMultiple" >
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Interest Posting Period</mat-label>
<mat-select formControlName="interestPostingPeriodType" required>
@@ -51,7 +51,20 @@ export class SavingsAccountTermsStepComponent implements OnChanges, OnInit {
'currencyCode': this.savingsAccountProductTemplate.currency.code,
'decimal': this.savingsAccountProductTemplate.currency.decimalPlaces,
'currencyMultiple': this.savingsAccountProductTemplate.currency.inMultiplesOf,
'minBalanceForInterestCalculation': this.savingsAccountProductTemplate.minBalanceForInterestCalculation
'minBalanceForInterestCalculation': this.savingsAccountProductTemplate.minBalanceForInterestCalculation,
'nominalAnnualInterestRate': this.savingsAccountProductTemplate.nominalAnnualInterestRate,
'interestCompoundingPeriodType': this.savingsAccountProductTemplate.interestCompoundingPeriodType.id,
'interestPostingPeriodType': this.savingsAccountProductTemplate.interestPostingPeriodType.id,
'interestCalculationType': this.savingsAccountProductTemplate.interestCalculationType.id,
'interestCalculationDaysInYearType': this.savingsAccountProductTemplate.interestCalculationDaysInYearType.id,
'minRequiredOpeningBalance': this.savingsAccountProductTemplate.minRequiredOpeningBalance,
'allowOverdraft': this.savingsAccountProductTemplate.allowOverdraft,
'overdraftLimit': this.savingsAccountProductTemplate.overdraftLimit,
'enforceMinRequiredBalance': this.savingsAccountProductTemplate.enforceMinRequiredBalance,
'minOverdraftForInterestCalculation': this.savingsAccountProductTemplate.minOverdraftForInterestCalculation,
'nominalAnnualInterestRateOverdraft': this.savingsAccountProductTemplate.nominalAnnualInterestRateOverdraft,
'minRequiredBalance': this.savingsAccountProductTemplate.minRequiredBalance,
'withdrawalFeeForTransfers': this.savingsAccountProductTemplate.withdrawalFeeForTransfers
});
this.setOptions();
}