Fixed Deposit account request with Maturity Instruction

This commit is contained in:
Jose Alberto Hernandez
2023-12-22 15:28:04 +01:00
committed by Adam Saghy
parent af97eba60b
commit 77814f03a1
22 changed files with 73 additions and 137 deletions
@@ -8,7 +8,6 @@ import { SettingsService } from 'app/settings/settings.service';
/** Custom Components */
import { FixedDepositAccountDetailsStepComponent } from '../fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component';
import { FixedDepositAccountCurrencyStepComponent } from '../fixed-deposit-account-stepper/fixed-deposit-account-currency-step/fixed-deposit-account-currency-step.component';
import { FixedDepositAccountTermsStepComponent } from '../fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component';
import { FixedDepositAccountSettingsStepComponent } from '../fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component';
import { FixedDepositAccountChargesStepComponent } from '../fixed-deposit-account-stepper/fixed-deposit-account-charges-step/fixed-deposit-account-charges-step.component';
@@ -27,8 +26,6 @@ export class EditFixedDepositAccountComponent {
/** Fixed Deposits Account Details Step */
@ViewChild(FixedDepositAccountDetailsStepComponent, { static: true }) fixedDepositsAccountDetailsStep: FixedDepositAccountDetailsStepComponent;
/** Fixed Deposits Account Currency Step */
@ViewChild(FixedDepositAccountCurrencyStepComponent, { static: true }) fixedDepositAccountCurrencyStep: FixedDepositAccountCurrencyStepComponent;
/** Fixed Deposits Account Terms Step */
@ViewChild(FixedDepositAccountTermsStepComponent, { static: true }) fixedDepositAccountTermsStep: FixedDepositAccountTermsStepComponent;
/** Fixed Deposits Account Settings Step */
@@ -77,13 +74,6 @@ export class EditFixedDepositAccountComponent {
return this.fixedDepositsAccountDetailsStep.fixedDepositAccountDetailsForm;
}
/**
* Retrieves Fixed Deposit Account Currency Form Data
*/
get fixedDepositAccountCurrencyForm() {
return this.fixedDepositAccountCurrencyStep.fixedDepositAccountCurrencyForm;
}
/**
* Retrieves Fixed Deposit Account Terms Form Data
*/
@@ -1,33 +0,0 @@
<form [formGroup]="fixedDepositAccountCurrencyForm">
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-label>{{"labels.inputs.Currency" | translate }}</mat-label>
<input type="text" matInput formControlName="currencyCode" >
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>{{"labels.inputs.Decimal Places" | translate }}</mat-label>
<input type="number" matInput formControlName="decimalPlaces" >
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>{{"labels.inputs.Currency Multiple" | translate }}</mat-label>
<input type="number" matInput formControlName="currencyMultiple">
</mat-form-field>
</div>
<div fxLayout="row" class="margin-t" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="2%">
<button mat-raised-button matStepperPrevious>
<fa-icon icon="arrow-left" class="m-r-10"></fa-icon>
{{"labels.buttons.Previous" | translate }}
</button>
<button mat-raised-button matStepperNext>
{{"labels.buttons.Next" | translate }}
<fa-icon icon="arrow-right" class="m-l-10"></fa-icon>
</button>
</div>
</form>
@@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FixedDepositAccountCurrencyStepComponent } from './fixed-deposit-account-currency-step.component';
describe('FixedDepositAccountCurrencyStepComponent', () => {
let component: FixedDepositAccountCurrencyStepComponent;
let fixture: ComponentFixture<FixedDepositAccountCurrencyStepComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FixedDepositAccountCurrencyStepComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(FixedDepositAccountCurrencyStepComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -1,53 +0,0 @@
/** Angular Imports */
import { Component, OnChanges, Input } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';
/**
* Fixed Deposit Account Currency Step
*/
@Component({
selector: 'mifosx-fixed-deposit-account-currency-step',
templateUrl: './fixed-deposit-account-currency-step.component.html',
styleUrls: ['./fixed-deposit-account-currency-step.component.scss']
})
export class FixedDepositAccountCurrencyStepComponent implements OnChanges {
/** Fixed deposits account template */
@Input() fixedDepositsAccountTemplate: any;
/** Fixed deposits account and product template */
@Input() fixedDepositsAccountProductTemplate: any;
/** Fixed Deposit Account Currency Form */
fixedDepositAccountCurrencyForm: UntypedFormGroup;
/** Currency Data */
currencyData: any;
/**
* @param {FormBuilder} formBuilder Form Builder
*/
constructor(private formBuilder: UntypedFormBuilder) {
this.createFixedDepositAccountCurrencyForm();
}
ngOnChanges() {
if (this.fixedDepositsAccountProductTemplate) {
this.fixedDepositAccountCurrencyForm.patchValue({
'currencyCode': this.fixedDepositsAccountProductTemplate.currency.code,
'decimalPlaces': this.fixedDepositsAccountProductTemplate.currency.decimalPlaces,
'currencyMultiple': this.fixedDepositsAccountProductTemplate.currency.inMultiplesOf
});
}
}
/**
* Creates fd currency form.
*/
createFixedDepositAccountCurrencyForm() {
this.fixedDepositAccountCurrencyForm = this.formBuilder.group({
'currencyCode': [{ value: '', disabled: true}],
'decimalPlaces': [{ value: '', disabled: true }],
'currencyMultiple': [{ value: '', disabled: true }]
});
}
}
@@ -111,6 +111,11 @@
<span fxFlex="60%">{{ fixedDepositAccountData.linkAccountId | find:fixedDepositsAccountProductTemplate.savingsAccounts:'id':'accountNo' }}</span>
</div>
<div fxFlexFill *ngIf="fixedDepositAccountData.maturityInstructionId">
<span fxFlex="40%">{{"labels.inputs.Maturity Instructions" | translate }}</span>
<span fxFlex="60%">{{ fixedDepositAccountData.maturityInstructionId | find:fixedDepositsAccountProductTemplate.maturityInstructionOptions:'id':'value' }}</span>
</div>
<div fxFlexFill>
<span fxFlex="40%">{{"labels.inputs.Apply Penal Interest (less)" | translate }}:</span>
<span fxFlex="60%">{{ fixedDepositsAccountProductTemplate.preClosurePenalApplicable ? 'Yes' : 'No' }}</span>
@@ -95,6 +95,29 @@
<mat-divider fxFlex="98%"></mat-divider>
<mat-form-field fxFlex="48%">
<mat-label>{{"labels.inputs.Maturity Instructions" | translate }}</mat-label>
<mat-select formControlName="maturityInstructionId">
<mat-option *ngFor="let maturityInstruction of maturityInstructionOptions" [value]="maturityInstruction.id">
{{ maturityInstruction.value }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="48%" *ngIf="fixedDepositAccountSettingsForm.contains('transferToSavingsId')" class="margin-b">
<mat-label>{{"labels.inputs.Transfer to savings account" | translate }}</mat-label>
<mat-select formControlName="transferToSavingsId" required>
<mat-option *ngFor="let account of savingsAccountsData" [value]="account.id">
{{ account.accountNo }}
</mat-option>
</mat-select>
<mat-error>
{{"labels.inputs.Transfer to savings account" | translate }} {{ "labels.commons.is" |translate}} <strong>{{ "labels.commons.required" | translate}}</strong>
</mat-error>
</mat-form-field>
<mat-divider fxFlex="98%"></mat-divider>
<h4 fxFlex="23%" class="mat-h4">{{"labels.heading.For Pre-mature closure" | translate }}</h4>
<mat-checkbox fxFlex="73%" labelPosition="before" formControlName="preClosurePenalApplicable" class="margin-v">
@@ -2,6 +2,7 @@
import { Component, OnInit, Input, OnChanges } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, UntypedFormControl, Validators } from '@angular/forms';
import { SettingsService } from 'app/settings/settings.service';
import { OptionData } from 'app/shared/models/option-data.model';
/**
* Fixed Deposits Account Settings Step
@@ -33,6 +34,8 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
/** Savings Accounts Data */
savingsAccountsData: any;
maturityInstructionOptions: OptionData;
/**
* @param {FormBuilder} formBuilder Form Builder
* @param {SettingsService} settingsService Settings Service
@@ -54,7 +57,8 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
'maxDepositTermTypeId': this.fixedDepositsAccountProductTemplate.maxDepositTermType ? this.fixedDepositsAccountProductTemplate.maxDepositTermType.id : '',
'preClosurePenalApplicable': this.fixedDepositsAccountProductTemplate.preClosurePenalApplicable,
'preClosurePenalInterest': this.fixedDepositsAccountProductTemplate.preClosurePenalInterest,
'preClosurePenalInterestOnTypeId': this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnType ? this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnType.id : ''
'preClosurePenalInterestOnTypeId': this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnType ? this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnType.id : '',
'maturityInstructionId': this.fixedDepositsAccountProductTemplate.maturityInstructionId
});
if (this.fixedDepositsAccountProductTemplate.withHoldTax) {
this.fixedDepositAccountSettingsForm.addControl('withHoldTax', new UntypedFormControl(false));
@@ -101,7 +105,8 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
'transferInterestToSavings': [false],
'preClosurePenalApplicable': [{ value: '', disabled: true }],
'preClosurePenalInterest': [{ value: '', disabled: true }],
'preClosurePenalInterestOnTypeId': [{ value: '', disabled: true }]
'preClosurePenalInterestOnTypeId': [{ value: '', disabled: true }],
'maturityInstructionId': ['']
});
}
@@ -117,6 +122,15 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
this.fixedDepositAccountSettingsForm.removeControl('linkAccountId');
}
});
this.fixedDepositAccountSettingsForm.get('maturityInstructionId').valueChanges.subscribe((value: number) => {
console.log(value);
if (value > 100) {
this.fixedDepositAccountSettingsForm.addControl('transferToSavingsId', new UntypedFormControl('', Validators.required));
this.fixedDepositAccountSettingsForm.get('transferToSavingsId').patchValue(this.fixedDepositsAccountTemplate.transferToSavingsId && this.fixedDepositsAccountTemplate.transferToSavingsId.id);
} else {
this.fixedDepositAccountSettingsForm.removeControl('transferToSavingsId');
}
});
}
/**
@@ -127,6 +141,7 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
this.periodFrequencyTypeData = this.fixedDepositsAccountProductTemplate.periodFrequencyTypeOptions;
this.savingsAccountsData = this.fixedDepositsAccountProductTemplate.savingsAccounts;
this.preClosurePenalInterestOnTypeData = this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnTypeOptions;
this.maturityInstructionOptions = this.fixedDepositsAccountProductTemplate.maturityInstructionOptions;
}
/**
@@ -40,6 +40,10 @@
<td>{{"labels.inputs.Tax Group" | translate }}</td>
<td>{{fixedDepositsAccountData.taxGroup.name}}</td>
</tr>
<tr *ngIf="fixedDepositsAccountData.onAccountClosure">
<td>{{"labels.inputs.Maturity Instructions" | translate }}</td>
<td>{{fixedDepositsAccountData.onAccountClosure.value}}</td>
</tr>
</tbody>
</table>
</div>
@@ -36,7 +36,6 @@ import { FixedDepositAccountChargesStepComponent } from './fixed-deposit-account
import { FixedDepositAccountSettingsStepComponent } from './fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component';
import { FixedDepositAccountInterestRateChartStepComponent } from './fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component';
import { FixedDepositAccountPreviewStepComponent } from './fixed-deposit-account-stepper/fixed-deposit-account-preview-step/fixed-deposit-account-preview-step.component';
import { FixedDepositAccountCurrencyStepComponent } from './fixed-deposit-account-stepper/fixed-deposit-account-currency-step/fixed-deposit-account-currency-step.component';
import { EditFixedDepositAccountComponent } from './edit-fixed-deposit-account/edit-fixed-deposit-account.component';
import { GeneralTabComponent } from './fixed-deposit-account-view/general-tab/general-tab.component';
@@ -75,7 +74,6 @@ import { GeneralTabComponent } from './fixed-deposit-account-view/general-tab/ge
FixedDepositAccountSettingsStepComponent,
FixedDepositAccountInterestRateChartStepComponent,
FixedDepositAccountPreviewStepComponent,
FixedDepositAccountCurrencyStepComponent,
EditFixedDepositAccountComponent,
GeneralTabComponent
],
+1
View File
@@ -1523,6 +1523,7 @@
"Maturity Amount": "Částka splatnosti",
"Maturity Date": "Datum splatnosti",
"Max Age": "Maximální věk",
"Maturity Instructions": "Pokyny pro splatnost",
"Maximum Deposit Term": "Maximální doba vkladu",
"Maximum Overdraft Amount Limit": "Maximální výše limitu přečerpání",
"Maximum Tranche count": "Maximální počet tranší",
+1
View File
@@ -1523,6 +1523,7 @@
"Maturity Amount": "Fälligkeitsbetrag",
"Maturity Date": "Fälligkeitstag",
"Max Age": "Maximales Alter",
"Maturity Instructions": "Reife Anweisungen",
"Maximum Deposit Term": "Maximale Einzahlungsdauer",
"Maximum Overdraft Amount Limit": "Maximaler Überziehungsbetrag",
"Maximum Tranche count": "Maximale Tranchenanzahl",
+1
View File
@@ -1521,6 +1521,7 @@
"Matures on": "Matures on",
"Maturity Amount": "Maturity Amount",
"Maturity Date": "Maturity Date",
"Maturity Instructions": "Maturity Instructions",
"Max Age": "Max Age",
"Maximum Deposit Term": "Maximum Deposit Term",
"Maximum Overdraft Amount Limit": "Maximum Overdraft Amount Limit",
+1
View File
@@ -1523,6 +1523,7 @@
"Maturity Amount": "Monto de vencimiento",
"Maturity Date": "Fecha de vencimiento",
"Max Age": "Edad máxima",
"Maturity Instructions": "Instrucciones al Vencimiento",
"Maximum Deposit Term": "Plazo máximo de depósito",
"Maximum Overdraft Amount Limit": "Límite máximo del monto de sobregiro",
"Maximum Tranche count": "Recuento máximo de tramos",
+1
View File
@@ -1523,6 +1523,7 @@
"Maturity Amount": "Montant à l'échéance",
"Maturity Date": "Date d'échéance",
"Max Age": "Âge maximum",
"Maturity Instructions": "Instructions de maturité",
"Maximum Deposit Term": "Durée de dépôt maximale",
"Maximum Overdraft Amount Limit": "Limite maximale du montant du découvert",
"Maximum Tranche count": "Nombre maximal de tranches",
+1
View File
@@ -1523,6 +1523,7 @@
"Maturity Amount": "Importo di scadenza",
"Maturity Date": "Data di scadenza",
"Max Age": "Età massima",
"Maturity Instructions": "Istruzioni di maturità",
"Maximum Deposit Term": "Durata massima del deposito",
"Maximum Overdraft Amount Limit": "Limite massimo dell'importo dello scoperto",
"Maximum Tranche count": "Conteggio massimo della tranche",
+1
View File
@@ -1523,6 +1523,7 @@
"Maturity Amount": "만기금액",
"Maturity Date": "만기일",
"Max Age": "최대 연령",
"Maturity Instructions": "성숙 지침",
"Maximum Deposit Term": "최대 예금 기간",
"Maximum Overdraft Amount Limit": "최대 초과인출 금액 한도",
"Maximum Tranche count": "최대 트랜치 수",
+1
View File
@@ -1523,6 +1523,7 @@
"Maturity Amount": "Termino suma",
"Maturity Date": "Galiojimo data",
"Max Age": "Maksimalus amžius",
"Maturity Instructions": "Brandos instrukcijos",
"Maximum Deposit Term": "Maksimalus indėlio terminas",
"Maximum Overdraft Amount Limit": "Maksimalus overdrafto sumos limitas",
"Maximum Tranche count": "Maksimalus dalių skaičius",
+1
View File
@@ -1523,6 +1523,7 @@
"Maturity Amount": "Termiņa summa",
"Maturity Date": "Derīguma termiņš",
"Max Age": "Maksimālais vecums",
"Maturity Instructions": "Brieduma instrukcijas",
"Maximum Deposit Term": "Maksimālais depozīta termiņš",
"Maximum Overdraft Amount Limit": "Maksimālais overdrafta summas limits",
"Maximum Tranche count": "Maksimālais daļu skaits",
+1
View File
@@ -1523,6 +1523,7 @@
"Maturity Amount": "परिपक्वता रकम",
"Maturity Date": "परिपक्वता मिति",
"Max Age": "अधिकतम उमेर",
"Maturity Instructions": "परिपक्वता निर्देशनहरू",
"Maximum Deposit Term": "अधिकतम जम्मा अवधि",
"Maximum Overdraft Amount Limit": "अधिकतम ओभरड्राफ्ट रकम सीमा",
"Maximum Tranche count": "अधिकतम किस्ता गणना",
+1
View File
@@ -1523,6 +1523,7 @@
"Maturity Amount": "Valor de vencimento",
"Maturity Date": "Data de Vencimento",
"Max Age": "Idade máxima",
"Maturity Instructions": "Instruções de vencimento",
"Maximum Deposit Term": "Prazo máximo de depósito",
"Maximum Overdraft Amount Limit": "Limite máximo do valor do cheque especial",
"Maximum Tranche count": "Contagem máxima de parcelas",
+1
View File
@@ -1523,6 +1523,7 @@
"Maturity Amount": "Kiasi cha Ukomavu",
"Maturity Date": "Tarehe ya Kukomaa",
"Max Age": "Umri wa Max",
"Maturity Instructions": "Maagizo ya ukomavu",
"Maximum Deposit Term": "Muda wa Juu wa Amana",
"Maximum Overdraft Amount Limit": "Kikomo cha juu cha Kiasi cha Overdraft",
"Maximum Tranche count": "Idadi ya juu ya Tranche",