WEB-248: Fix Recurrent Deposit
This commit is contained in:
committed by
Tedyyy-Albur
parent
f429e991e7
commit
a53a775ae1
+18
@@ -48,6 +48,24 @@
|
|||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field *ngIf="closeRecurringDepositForm.contains('toSavingsAccountId')">
|
||||||
|
<mat-label>{{ 'labels.inputs.Transfer to Savings' | translate }}</mat-label>
|
||||||
|
<mat-select required formControlName="toSavingsAccountId">
|
||||||
|
<mat-option *ngFor="let account of savingsAccountsData" [value]="account.id">
|
||||||
|
{{ account.accountNo }}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
<mat-error *ngIf="closeRecurringDepositForm.controls.toSavingsAccountId.hasError('required')">
|
||||||
|
{{ 'labels.inputs.Transfer to savings account' | translate }} {{ 'labels.commons.is' | translate }}
|
||||||
|
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||||
|
</mat-error>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field *ngIf="closeRecurringDepositForm.contains('transferDescription')">
|
||||||
|
<mat-label>{{ 'labels.inputs.Transfer Description' | translate }}</mat-label>
|
||||||
|
<input matInput formControlName="transferDescription" />
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-label>{{ 'labels.inputs.Payment Type Id' | translate }}</mat-label>
|
<mat-label>{{ 'labels.inputs.Payment Type Id' | translate }}</mat-label>
|
||||||
<mat-select formControlName="paymentTypeId" required>
|
<mat-select formControlName="paymentTypeId" required>
|
||||||
|
|||||||
+26
-2
@@ -1,6 +1,12 @@
|
|||||||
/** Angular Imports */
|
/** Angular Imports */
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { UntypedFormGroup, UntypedFormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
|
import {
|
||||||
|
UntypedFormGroup,
|
||||||
|
UntypedFormBuilder,
|
||||||
|
Validators,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
UntypedFormControl
|
||||||
|
} from '@angular/forms';
|
||||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
@@ -35,6 +41,8 @@ export class CloseRecurringDepositsAccountComponent implements OnInit {
|
|||||||
accountId: string;
|
accountId: string;
|
||||||
/** Show payment details */
|
/** Show payment details */
|
||||||
showPaymentDetails = false;
|
showPaymentDetails = false;
|
||||||
|
/** Savings Account Data */
|
||||||
|
savingsAccountsData: any;
|
||||||
/** Minimum Date allowed. */
|
/** Minimum Date allowed. */
|
||||||
minDate = new Date(2000, 0, 1);
|
minDate = new Date(2000, 0, 1);
|
||||||
/** Maximum Date allowed. */
|
/** Maximum Date allowed. */
|
||||||
@@ -59,6 +67,7 @@ export class CloseRecurringDepositsAccountComponent implements OnInit {
|
|||||||
private settingsService: SettingsService
|
private settingsService: SettingsService
|
||||||
) {
|
) {
|
||||||
this.route.data.subscribe((data: { recurringDepositsAccountActionData: any }) => {
|
this.route.data.subscribe((data: { recurringDepositsAccountActionData: any }) => {
|
||||||
|
this.savingsAccountsData = data.recurringDepositsAccountActionData.savingsAccounts;
|
||||||
this.maturityAmount = data.recurringDepositsAccountActionData.maturityAmount;
|
this.maturityAmount = data.recurringDepositsAccountActionData.maturityAmount;
|
||||||
this.onAccountClosureOptions = data.recurringDepositsAccountActionData.onAccountClosureOptions;
|
this.onAccountClosureOptions = data.recurringDepositsAccountActionData.onAccountClosureOptions;
|
||||||
this.paymentTypes = data.recurringDepositsAccountActionData.paymentTypeOptions;
|
this.paymentTypes = data.recurringDepositsAccountActionData.paymentTypeOptions;
|
||||||
@@ -74,6 +83,7 @@ export class CloseRecurringDepositsAccountComponent implements OnInit {
|
|||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.maxDate = this.settingsService.businessDate;
|
this.maxDate = this.settingsService.businessDate;
|
||||||
this.createcloseRecurringDepositForm();
|
this.createcloseRecurringDepositForm();
|
||||||
|
this.addTransferDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -95,7 +105,7 @@ export class CloseRecurringDepositsAccountComponent implements OnInit {
|
|||||||
Validators.required
|
Validators.required
|
||||||
],
|
],
|
||||||
accountNumber: '',
|
accountNumber: '',
|
||||||
chequeNumber: '',
|
checkNumber: '',
|
||||||
routingCode: '',
|
routingCode: '',
|
||||||
receiptNumber: '',
|
receiptNumber: '',
|
||||||
bankNumber: '',
|
bankNumber: '',
|
||||||
@@ -109,6 +119,20 @@ export class CloseRecurringDepositsAccountComponent implements OnInit {
|
|||||||
toggleDisplay() {
|
toggleDisplay() {
|
||||||
this.showPaymentDetails = !this.showPaymentDetails;
|
this.showPaymentDetails = !this.showPaymentDetails;
|
||||||
}
|
}
|
||||||
|
addTransferDetails() {
|
||||||
|
this.closeRecurringDepositForm.get('onAccountClosureId').valueChanges.subscribe((id: any) => {
|
||||||
|
if (id === 200) {
|
||||||
|
this.closeRecurringDepositForm.addControl(
|
||||||
|
'toSavingsAccountId',
|
||||||
|
new UntypedFormControl('', Validators.required)
|
||||||
|
);
|
||||||
|
this.closeRecurringDepositForm.addControl('transferDescription', new UntypedFormControl(''));
|
||||||
|
} else {
|
||||||
|
this.closeRecurringDepositForm.removeControl('toSavingsAccountId');
|
||||||
|
this.closeRecurringDepositForm.removeControl('transferDescription');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Submits the close recurring deposit form
|
* Submits the close recurring deposit form
|
||||||
|
|||||||
Reference in New Issue
Block a user