WEB-524 Remove the lock in period (#2930)
This commit is contained in:
+54
-32
@@ -16,40 +16,62 @@
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<span class="flex-48 hide-lt-md"></span>
|
||||
<mat-divider class="flex-98"></mat-divider>
|
||||
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Lock-in Period' | translate }}</mat-label>
|
||||
<input
|
||||
type="number"
|
||||
matInput
|
||||
matTooltip="{{ 'tooltips.Used to indicate the length of time' | translate }}"
|
||||
formControlName="lockinPeriodFrequency"
|
||||
min="1"
|
||||
step="1"
|
||||
required
|
||||
/>
|
||||
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequency').hasError('required')">
|
||||
{{ 'labels.inputs.Frequency' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequency').hasError('min')">
|
||||
{{ 'tooltips.Frequency must be greater than zero' | translate }}
|
||||
</mat-error>
|
||||
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequency').hasError('pattern')">
|
||||
{{ 'tooltips.Frequency must be a positive integer' | translate }}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
<h3 class="mat-h3 flex-23">{{ 'labels.inputs.Lock-in Period' | translate }}</h3>
|
||||
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-select formControlName="lockinPeriodFrequencyType">
|
||||
@for (lockinPeriodFrequencyType of lockinPeriodFrequencyTypeData; track lockinPeriodFrequencyType) {
|
||||
<mat-option [value]="lockinPeriodFrequencyType.id">
|
||||
{{ lockinPeriodFrequencyType.value | translateKey: 'catalogs' }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox
|
||||
class="flex-73 margin-b"
|
||||
labelPosition="before"
|
||||
matTooltip="{{ 'tooltips.Used to indicate the length of time' | translate }}"
|
||||
formControlName="enableLockinPeriod"
|
||||
>
|
||||
{{ 'labels.inputs.Enable Lock-in Period' | translate }}
|
||||
</mat-checkbox>
|
||||
|
||||
@if (savingProductSettingsForm.value.enableLockinPeriod) {
|
||||
<div class="flex-fill layout-row-wrap gap-2percent responsive-column">
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Frequency' | translate }}</mat-label>
|
||||
<input
|
||||
type="number"
|
||||
matInput
|
||||
matTooltip="{{ 'tooltips.The number at which lock in period occurs' | translate }}"
|
||||
formControlName="lockinPeriodFrequency"
|
||||
min="1"
|
||||
step="1"
|
||||
required
|
||||
/>
|
||||
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequency')?.hasError('required')">
|
||||
{{ 'labels.inputs.Frequency' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequency')?.hasError('min')">
|
||||
{{ 'tooltips.Frequency must be greater than zero' | translate }}
|
||||
</mat-error>
|
||||
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequency')?.hasError('pattern')">
|
||||
{{ 'tooltips.Frequency must be a positive integer' | translate }}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="flex-48">
|
||||
<mat-label>{{ 'labels.inputs.Type' | translate }}</mat-label>
|
||||
<mat-select formControlName="lockinPeriodFrequencyType" required>
|
||||
@for (lockinPeriodFrequencyType of lockinPeriodFrequencyTypeData; track lockinPeriodFrequencyType) {
|
||||
<mat-option [value]="lockinPeriodFrequencyType.id">
|
||||
{{ lockinPeriodFrequencyType.value | translateKey: 'catalogs' }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
<mat-error *ngIf="savingProductSettingsForm.get('lockinPeriodFrequencyType')?.hasError('required')">
|
||||
{{ 'labels.inputs.Type' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
}
|
||||
|
||||
<mat-divider class="flex-98"></mat-divider>
|
||||
|
||||
<mat-checkbox
|
||||
class="flex-48 margin-v"
|
||||
|
||||
+37
-14
@@ -46,12 +46,12 @@ export class SavingProductSettingsStepComponent implements OnInit {
|
||||
this.lockinPeriodFrequencyTypeData = this.savingProductsTemplate.lockinPeriodFrequencyTypeOptions;
|
||||
this.taxGroupData = this.savingProductsTemplate.taxGroupOptions;
|
||||
|
||||
const hasLockinPeriod =
|
||||
this.savingProductsTemplate.lockinPeriodFrequency && this.savingProductsTemplate.lockinPeriodFrequency > 0;
|
||||
|
||||
this.savingProductSettingsForm.patchValue({
|
||||
minRequiredOpeningBalance: this.savingProductsTemplate.minRequiredOpeningBalance,
|
||||
lockinPeriodFrequency: this.savingProductsTemplate.lockinPeriodFrequency,
|
||||
lockinPeriodFrequencyType:
|
||||
this.savingProductsTemplate.lockinPeriodFrequencyType &&
|
||||
this.savingProductsTemplate.lockinPeriodFrequencyType.id,
|
||||
enableLockinPeriod: hasLockinPeriod,
|
||||
withdrawalFeeForTransfers: this.savingProductsTemplate.withdrawalFeeForTransfers,
|
||||
minBalanceForInterestCalculation: this.savingProductsTemplate.minBalanceForInterestCalculation,
|
||||
enforceMinRequiredBalance: this.savingProductsTemplate.enforceMinRequiredBalance,
|
||||
@@ -67,6 +67,15 @@ export class SavingProductSettingsStepComponent implements OnInit {
|
||||
daysToDormancy: this.savingProductsTemplate.daysToDormancy,
|
||||
daysToEscheat: this.savingProductsTemplate.daysToEscheat
|
||||
});
|
||||
|
||||
if (hasLockinPeriod) {
|
||||
this.savingProductSettingsForm.patchValue({
|
||||
lockinPeriodFrequency: this.savingProductsTemplate.lockinPeriodFrequency,
|
||||
lockinPeriodFrequencyType:
|
||||
this.savingProductsTemplate.lockinPeriodFrequencyType &&
|
||||
this.savingProductsTemplate.lockinPeriodFrequencyType.id
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
createSavingProductSettingsForm() {
|
||||
@@ -75,15 +84,7 @@ export class SavingProductSettingsStepComponent implements OnInit {
|
||||
'',
|
||||
[Validators.min(0)]
|
||||
],
|
||||
lockinPeriodFrequency: [
|
||||
'',
|
||||
[
|
||||
Validators.required,
|
||||
Validators.min(1),
|
||||
Validators.pattern('^[1-9]\\d*$')
|
||||
]
|
||||
],
|
||||
lockinPeriodFrequencyType: [''],
|
||||
enableLockinPeriod: [false],
|
||||
withdrawalFeeForTransfers: [false],
|
||||
minBalanceForInterestCalculation: [''],
|
||||
enforceMinRequiredBalance: [false],
|
||||
@@ -95,6 +96,26 @@ export class SavingProductSettingsStepComponent implements OnInit {
|
||||
}
|
||||
|
||||
setConditionalControls() {
|
||||
this.savingProductSettingsForm.get('enableLockinPeriod').valueChanges.subscribe((enableLockinPeriod: any) => {
|
||||
if (enableLockinPeriod) {
|
||||
this.savingProductSettingsForm.addControl(
|
||||
'lockinPeriodFrequency',
|
||||
new UntypedFormControl('', [
|
||||
Validators.required,
|
||||
Validators.min(1),
|
||||
Validators.pattern('^[1-9]\\d*$')
|
||||
])
|
||||
);
|
||||
this.savingProductSettingsForm.addControl(
|
||||
'lockinPeriodFrequencyType',
|
||||
new UntypedFormControl('', Validators.required)
|
||||
);
|
||||
} else {
|
||||
this.savingProductSettingsForm.removeControl('lockinPeriodFrequency');
|
||||
this.savingProductSettingsForm.removeControl('lockinPeriodFrequencyType');
|
||||
}
|
||||
});
|
||||
|
||||
this.savingProductSettingsForm.get('allowOverdraft').valueChanges.subscribe((allowOverdraft: any) => {
|
||||
if (allowOverdraft) {
|
||||
this.savingProductSettingsForm.addControl('minOverdraftForInterestCalculation', new UntypedFormControl(''));
|
||||
@@ -131,6 +152,8 @@ export class SavingProductSettingsStepComponent implements OnInit {
|
||||
}
|
||||
|
||||
get savingProductSettings() {
|
||||
return this.savingProductSettingsForm.value;
|
||||
const formValue = { ...this.savingProductSettingsForm.value };
|
||||
delete formValue.enableLockinPeriod;
|
||||
return formValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1598,6 +1598,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "Povolit automatické splácení zálohy",
|
||||
"Enable Dormancy Tracking": "Povolit sledování dormance",
|
||||
"Enable Down Payment": "Povolit zálohu",
|
||||
"Enable Lock-in Period": "Povolit zamykací období",
|
||||
"Enable Multiple Disbursals": "Povolit vícenásobné výplaty",
|
||||
"Enabled": "Povoleno",
|
||||
"End Date": "Datum ukončení",
|
||||
|
||||
@@ -1598,6 +1598,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "Aktivieren Sie die automatische Rückzahlung für die Anzahlung",
|
||||
"Enable Dormancy Tracking": "Aktivieren Sie die Ruheverfolgung",
|
||||
"Enable Down Payment": "Anzahlung aktivieren",
|
||||
"Enable Lock-in Period": "Sperrfrist aktivieren",
|
||||
"Enable Multiple Disbursals": "Aktivieren Sie Mehrfachauszahlungen",
|
||||
"Enabled": "Ermöglicht",
|
||||
"End Date": "Endtermin",
|
||||
|
||||
@@ -1602,6 +1602,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "Enable Auto Repayment for Down Payment",
|
||||
"Enable Dormancy Tracking": "Enable Dormancy Tracking",
|
||||
"Enable Down Payment": "Enable Down Payment",
|
||||
"Enable Lock-in Period": "Enable Lock-in Period",
|
||||
"Enable Multiple Disbursals": "Enable Multiple Disbursals",
|
||||
"Allow full term for each tranche": "Allow full term for each tranche",
|
||||
"Enabled": "Enabled",
|
||||
|
||||
@@ -1597,6 +1597,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "Habilitar el pago automático para el pago inicial",
|
||||
"Enable Dormancy Tracking": "Habilitar seguimiento de inactividad",
|
||||
"Enable Down Payment": "Habilitar Pago inicial",
|
||||
"Enable Lock-in Period": "Habilitar período de bloqueo",
|
||||
"Enable Multiple Disbursals": "Habilitar múltiples desembolsos",
|
||||
"Enabled": "Activado",
|
||||
"End Date": "Fecha final",
|
||||
|
||||
@@ -1597,6 +1597,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "Habilitar el pago automático para el pago inicial",
|
||||
"Enable Dormancy Tracking": "Habilitar seguimiento de inactividad",
|
||||
"Enable Down Payment": "Habilitar Pago inicial",
|
||||
"Enable Lock-in Period": "Habilitar período de bloqueo",
|
||||
"Enable Multiple Disbursals": "Habilitar múltiples desembolsos",
|
||||
"Enabled": "Activado",
|
||||
"End Date": "Fecha final",
|
||||
|
||||
@@ -1598,6 +1598,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "Activer le remboursement automatique pour l'acompte",
|
||||
"Enable Dormancy Tracking": "Activer le suivi de la dormance",
|
||||
"Enable Down Payment": "Activer l'acompte",
|
||||
"Enable Lock-in Period": "Activer la période de blocage",
|
||||
"Enable Multiple Disbursals": "Activer les décaissements multiples",
|
||||
"Enabled": "Activé",
|
||||
"End Date": "Date de fin",
|
||||
|
||||
@@ -1598,6 +1598,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "Abilita il rimborso automatico per l'acconto",
|
||||
"Enable Dormancy Tracking": "Abilita il monitoraggio della dormienza",
|
||||
"Enable Down Payment": "Abilita l'acconto",
|
||||
"Enable Lock-in Period": "Abilita periodo di blocco",
|
||||
"Enable Multiple Disbursals": "Abilita esborsi multipli",
|
||||
"Enabled": "Abilitato",
|
||||
"End Date": "Data di fine",
|
||||
|
||||
@@ -1599,6 +1599,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "계약금 자동 상환 활성화",
|
||||
"Enable Dormancy Tracking": "휴면 추적 활성화",
|
||||
"Enable Down Payment": "계약금 활성화",
|
||||
"Enable Lock-in Period": "잠금 기간 활성화",
|
||||
"Enable Multiple Disbursals": "다중 지불 활성화",
|
||||
"Enabled": "활성화됨",
|
||||
"End Date": "종료일",
|
||||
|
||||
@@ -1598,6 +1598,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "Įgalinti automatinį pradinio įnašo grąžinimą",
|
||||
"Enable Dormancy Tracking": "Įgalinti ramybės būsenos stebėjimą",
|
||||
"Enable Down Payment": "Įgalinti pradinį įnašą",
|
||||
"Enable Lock-in Period": "Įgalinti užrakinimo laikotarpį",
|
||||
"Enable Multiple Disbursals": "Įgalinti kelias išmokas",
|
||||
"Enabled": "Įjungtas",
|
||||
"End Date": "Pabaigos data",
|
||||
|
||||
@@ -1598,6 +1598,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "Iespējot pirmās iemaksas automātisko atmaksu",
|
||||
"Enable Dormancy Tracking": "Iespējot miega režīma izsekošanu",
|
||||
"Enable Down Payment": "Iespējot pirmo iemaksu",
|
||||
"Enable Lock-in Period": "Iespējot bloķēšanas periodu",
|
||||
"Enable Multiple Disbursals": "Iespējot vairākas izmaksas",
|
||||
"Enabled": "Iespējots",
|
||||
"End Date": "Beigu datums",
|
||||
|
||||
@@ -1598,6 +1598,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "डाउन पेमेन्टको लागि स्वत: भुक्तानी सक्षम गर्नुहोस्",
|
||||
"Enable Dormancy Tracking": "निष्क्रियता ट्र्याकिङ सक्षम गर्नुहोस्",
|
||||
"Enable Down Payment": "डाउन पेमेन्ट सक्षम गर्नुहोस्",
|
||||
"Enable Lock-in Period": "लक-इन अवधि सक्षम गर्नुहोस्",
|
||||
"Enable Multiple Disbursals": "बहुविध वितरण सक्षम गर्नुहोस्",
|
||||
"Enabled": "सक्षम गरियो",
|
||||
"End Date": "अन्त्य मिति",
|
||||
|
||||
@@ -1598,6 +1598,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "Ativar reembolso automático para adiantamento",
|
||||
"Enable Dormancy Tracking": "Habilitar rastreamento de dormência",
|
||||
"Enable Down Payment": "Ativar adiantamento",
|
||||
"Enable Lock-in Period": "Ativar período de bloqueio",
|
||||
"Enable Multiple Disbursals": "Habilitar múltiplos desembolsos",
|
||||
"Enabled": "Habilitado",
|
||||
"End Date": "Data final",
|
||||
|
||||
@@ -1596,6 +1596,7 @@
|
||||
"Enable Auto Repayment for Down Payment": "Washa Ulipaji Kiotomatiki kwa Malipo ya Chini",
|
||||
"Enable Dormancy Tracking": "Washa Ufuatiliaji wa Malalamiko",
|
||||
"Enable Down Payment": "Washa Malipo ya Chini",
|
||||
"Enable Lock-in Period": "Washa Kipindi cha Kufunga",
|
||||
"Enable Multiple Disbursals": "Washa Utoaji Nyingi",
|
||||
"Enabled": "Imewashwa",
|
||||
"End Date": "Tarehe ya mwisho",
|
||||
|
||||
Reference in New Issue
Block a user