+1
-1
@@ -54,7 +54,7 @@
|
||||
<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 | date) || 'Unassigned'}}
|
||||
{{(charge.dueDate | date) || 'Unassigned*'}}
|
||||
</span>
|
||||
<span *ngIf="charge.chargeTimeType.value === 'Monthly Fee' || charge.chargeTimeType.value === 'Annual Fee'">
|
||||
{{charge.feeOnMonthDay ? ([2000].concat(charge.feeOnMonthDay) | date: 'dd MMMM') : 'Unassigned'}}
|
||||
|
||||
+21
-6
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Component, OnInit, Input, OnChanges } from '@angular/core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { MatDialog } from '@angular/material';
|
||||
|
||||
@@ -20,7 +20,7 @@ import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
||||
templateUrl: './fixed-deposit-account-charges-step.component.html',
|
||||
styleUrls: ['./fixed-deposit-account-charges-step.component.scss']
|
||||
})
|
||||
export class FixedDepositAccountChargesStepComponent implements OnInit {
|
||||
export class FixedDepositAccountChargesStepComponent implements OnInit, OnChanges {
|
||||
|
||||
/** Fixed deposits account template */
|
||||
@Input() fixedDepositsAccountTemplate: any;
|
||||
@@ -34,9 +34,11 @@ export class FixedDepositAccountChargesStepComponent implements OnInit {
|
||||
/** Charges Data */
|
||||
chargeData: any;
|
||||
/** Charges Data Source */
|
||||
chargesDataSource: {}[];
|
||||
chargesDataSource: {}[] = [];
|
||||
/** Charges table columns */
|
||||
displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'repaymentsEvery', 'action'];
|
||||
/** For Edit Fixed Deposits Account Form */
|
||||
isChargesPatched = false;
|
||||
/** Component is pristine if there has been no changes by user interaction */
|
||||
pristine = true;
|
||||
|
||||
@@ -48,17 +50,29 @@ export class FixedDepositAccountChargesStepComponent implements OnInit {
|
||||
private datePipe: DatePipe) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.chargeData = this.fixedDepositsAccountTemplate.chargeOptions;
|
||||
this.chargesDataSource = [];
|
||||
this.currencyCode.valueChanges.subscribe(() => this.chargesDataSource = []);
|
||||
this.currencyCode.valueChanges.subscribe(() => {
|
||||
if (!this.isChargesPatched && this.fixedDepositsAccountTemplate.charges) {
|
||||
this.chargesDataSource = this.fixedDepositsAccountTemplate.charges.map((charge: any) => ({...charge, id: charge.chargeId})) || [];
|
||||
this.isChargesPatched = true;
|
||||
} else {
|
||||
this.chargesDataSource = [];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
if (this.fixedDepositsAccountProductTemplate) {
|
||||
this.chargeData = this.fixedDepositsAccountProductTemplate.chargeOptions;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a charge
|
||||
*/
|
||||
addCharge(charge: any) {
|
||||
this.chargesDataSource = this.chargesDataSource.concat([charge.value]);
|
||||
charge.value = '';
|
||||
this.pristine = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -169,6 +183,7 @@ export class FixedDepositAccountChargesStepComponent implements OnInit {
|
||||
deleteCharge(charge: any) {
|
||||
this.chargesDataSource.splice(this.chargesDataSource.indexOf(charge), 1);
|
||||
this.chargesDataSource = this.chargesDataSource.concat([]);
|
||||
this.pristine = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+14
-1
@@ -26,6 +26,8 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit {
|
||||
productData: any;
|
||||
/** Field Officer Data */
|
||||
fieldOfficerData: any;
|
||||
/** For edit savings form */
|
||||
isFieldOfficerPatched = false;
|
||||
/** Fixed Deposits Account Details Form */
|
||||
fixedDepositAccountDetailsForm: FormGroup;
|
||||
|
||||
@@ -46,6 +48,12 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit {
|
||||
this.buildDependencies();
|
||||
if (this.fixedDepositsAccountTemplate) {
|
||||
this.productData = this.fixedDepositsAccountTemplate.productOptions;
|
||||
if (this.fixedDepositsAccountTemplate.depositProductId) {
|
||||
this.fixedDepositAccountDetailsForm.patchValue({
|
||||
'productId': this.fixedDepositsAccountTemplate.depositProductId,
|
||||
'submittedOnDate': this.fixedDepositsAccountTemplate.timeline.submittedOnDate && new Date(this.fixedDepositsAccountTemplate.timeline.submittedOnDate)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +77,12 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit {
|
||||
this.fixedDepositsService.getFixedDepositsAccountTemplate(clientId, productId).subscribe((response: any) => {
|
||||
this.fixedDepositsAccountProductTemplate.emit(response);
|
||||
this.fieldOfficerData = response.fieldOfficerOptions;
|
||||
this.fixedDepositAccountDetailsForm.get('fieldOfficerId').patchValue('');
|
||||
if (!this.isFieldOfficerPatched && this.fixedDepositsAccountTemplate.fieldOfficerId) {
|
||||
this.fixedDepositAccountDetailsForm.get('fieldOfficerId').patchValue(this.fixedDepositsAccountTemplate.fieldOfficerId);
|
||||
this.isFieldOfficerPatched = true;
|
||||
} else {
|
||||
this.fixedDepositAccountDetailsForm.get('fieldOfficerId').patchValue('');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
+15
-11
@@ -19,20 +19,10 @@
|
||||
<span fxFlex="60%">{{ (fixedDepositAccountData.fieldOfficerId | find:fixedDepositsAccountProductTemplate.fieldOfficerOptions:'id':'displayName') || 'Unassigned' }}</span>
|
||||
</div>
|
||||
|
||||
<h3 class="mat-h3" fxFlexFill>Terms</h3>
|
||||
<h3 class="mat-h3" fxFlexFill>Currency</h3>
|
||||
|
||||
<mat-divider fxFlexFill></mat-divider>
|
||||
|
||||
<div fxFlexFill>
|
||||
<span fxFlex="40%">Fixed Deposit Amount:</span>
|
||||
<span fxFlex="60%">{{ fixedDepositAccountData.depositAmount }}</span>
|
||||
</div>
|
||||
|
||||
<div fxFlexFill>
|
||||
<span fxFlex="40%">Deposit Period:</span>
|
||||
<span fxFlex="60%">{{ fixedDepositAccountData.depositPeriod + ' ' + (fixedDepositAccountData.depositPeriodFrequencyId | find:fixedDepositsAccountProductTemplate.periodFrequencyTypeOptions:'id':'value') }}</span>
|
||||
</div>
|
||||
|
||||
<div fxFlexFill>
|
||||
<span fxFlex="40%">Currency</span>
|
||||
<span fxFlex="60%">{{ fixedDepositsAccountProductTemplate.currency.code }}</span>
|
||||
@@ -48,6 +38,20 @@
|
||||
<span fxFlex="60%">{{ fixedDepositsAccountProductTemplate.currency.decimalPlaces }}</span>
|
||||
</div>
|
||||
|
||||
<h3 class="mat-h3" fxFlexFill>Terms</h3>
|
||||
|
||||
<mat-divider fxFlexFill></mat-divider>
|
||||
|
||||
<div fxFlexFill>
|
||||
<span fxFlex="40%">Fixed Deposit Amount:</span>
|
||||
<span fxFlex="60%">{{ fixedDepositAccountData.depositAmount }}</span>
|
||||
</div>
|
||||
|
||||
<div fxFlexFill>
|
||||
<span fxFlex="40%">Deposit Period:</span>
|
||||
<span fxFlex="60%">{{ fixedDepositAccountData.depositPeriod + ' ' + (fixedDepositAccountData.depositPeriodFrequencyId | find:fixedDepositsAccountProductTemplate.periodFrequencyTypeOptions:'id':'value') }}</span>
|
||||
</div>
|
||||
|
||||
<div fxFlexFill>
|
||||
<span fxFlex="40%">Interest Compounding Period:</span>
|
||||
<span fxFlex="60%">{{ fixedDepositAccountData.interestCompoundingPeriodType | find:fixedDepositsAccountProductTemplate.interestCompoundingPeriodTypeOptions:'id':'value' }}</span>
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@
|
||||
Is Withhold Tax Applicable?
|
||||
</mat-checkbox>
|
||||
|
||||
<mat-form-field fxFlex="48%" *ngIf="fixedDepositAccountSettingsForm.value.withHoldTax" class="p-b-25">
|
||||
<mat-form-field fxFlex="48%" *ngIf="fixedDepositAccountSettingsForm.controls.taxGroupId" class="p-b-25">
|
||||
<mat-label>Tax Group</mat-label>
|
||||
<input matInput formControlName="taxGroupId">
|
||||
</mat-form-field>
|
||||
|
||||
+11
-1
@@ -63,6 +63,7 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
|
||||
this.fixedDepositAccountSettingsForm.removeControl('taxGroupId');
|
||||
}
|
||||
});
|
||||
this.fixedDepositAccountSettingsForm.get('withHoldTax').patchValue(this.fixedDepositsAccountTemplate.withHoldTax);
|
||||
} else {
|
||||
this.fixedDepositAccountSettingsForm.removeControl('withHoldTax');
|
||||
}
|
||||
@@ -70,7 +71,15 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() { }
|
||||
ngOnInit() {
|
||||
if (this.fixedDepositsAccountTemplate) {
|
||||
this.fixedDepositAccountSettingsForm.patchValue({
|
||||
'lockinPeriodFrequency': this.fixedDepositsAccountTemplate.lockinPeriodFrequency,
|
||||
'lockinPeriodFrequencyType': this.fixedDepositsAccountTemplate.lockinPeriodFrequencyType && this.fixedDepositsAccountTemplate.lockinPeriodFrequencyType.id,
|
||||
'transferInterestToSavings': this.fixedDepositsAccountTemplate.transferInterestToSavings
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates fixed deposits account terms form.
|
||||
@@ -99,6 +108,7 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
|
||||
this.fixedDepositAccountSettingsForm.get('transferInterestToSavings').valueChanges.subscribe((value: boolean) => {
|
||||
if (value) {
|
||||
this.fixedDepositAccountSettingsForm.addControl('linkAccountId', new FormControl('', Validators.required));
|
||||
this.fixedDepositAccountSettingsForm.get('linkAccountId').patchValue(this.fixedDepositsAccountTemplate.linkedAccount && this.fixedDepositsAccountTemplate.linkedAccount.id);
|
||||
} else {
|
||||
this.fixedDepositAccountSettingsForm.removeControl('linkAccountId');
|
||||
}
|
||||
|
||||
+13
-1
@@ -47,7 +47,19 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() { }
|
||||
ngOnInit() {
|
||||
if (this.fixedDepositsAccountTemplate) {
|
||||
this.fixedDepositAccountTermsForm.patchValue({
|
||||
'interestCompoundingPeriodType': this.fixedDepositsAccountTemplate.interestCompoundingPeriodType.id,
|
||||
'interestPostingPeriodType': this.fixedDepositsAccountTemplate.interestPostingPeriodType.id,
|
||||
'interestCalculationType': this.fixedDepositsAccountTemplate.interestCalculationType.id,
|
||||
'interestCalculationDaysInYearType': this.fixedDepositsAccountTemplate.interestCalculationDaysInYearType.id,
|
||||
'depositAmount': this.fixedDepositsAccountTemplate.depositAmount,
|
||||
'depositPeriod': this.fixedDepositsAccountTemplate.depositPeriod,
|
||||
'depositPeriodFrequencyId': this.fixedDepositsAccountTemplate.depositPeriodFrequency.id,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates fixed deposits account terms form.
|
||||
|
||||
Reference in New Issue
Block a user