Fix Collaterals on Loan: It is optional
This commit is contained in:
@@ -95,8 +95,7 @@ export class CreateLoansAccountComponent implements OnInit {
|
|||||||
get loansAccountFormValid() {
|
get loansAccountFormValid() {
|
||||||
return (
|
return (
|
||||||
this.loansAccountDetailsForm.valid &&
|
this.loansAccountDetailsForm.valid &&
|
||||||
this.loansAccountTermsForm.valid &&
|
this.loansAccountTermsForm.valid
|
||||||
this.loansAccountChargesStep.loansAccountCharges.isValid
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -174,7 +174,7 @@
|
|||||||
<fa-icon icon="arrow-left"></fa-icon>
|
<fa-icon icon="arrow-left"></fa-icon>
|
||||||
Previous
|
Previous
|
||||||
</button>
|
</button>
|
||||||
<button mat-raised-button matStepperNext [disabled]="!isCollateralSufficient">
|
<button mat-raised-button matStepperNext [disabled]="!loansAccountFormValid">
|
||||||
Next
|
Next
|
||||||
<fa-icon icon="arrow-right"></fa-icon>
|
<fa-icon icon="arrow-right"></fa-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
+3
-4
@@ -69,7 +69,7 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
if ( this.loansAccountTemplate.charges) {
|
if (this.loansAccountTemplate.charges) {
|
||||||
this.chargesDataSource = this.loansAccountTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || [];
|
this.chargesDataSource = this.loansAccountTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -231,7 +231,7 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges {
|
|||||||
|
|
||||||
this.totalCollateralValue += collateralData.type.pctToBase * collateralData.type.basePrice * collateralData.value / 100;
|
this.totalCollateralValue += collateralData.type.pctToBase * collateralData.type.basePrice * collateralData.value / 100;
|
||||||
this.collateralDataSource = this.collateralDataSource.concat(collateralData);
|
this.collateralDataSource = this.collateralDataSource.concat(collateralData);
|
||||||
this.collateralOptions = this.collateralOptions.filter( (user: any) => user.collateralId !== response.data.value.collateral.collateralId);
|
this.collateralOptions = this.collateralOptions.filter((user: any) => user.collateralId !== response.data.value.collateral.collateralId);
|
||||||
if (this.loanPrincipal < this.totalCollateralValue) {
|
if (this.loanPrincipal < this.totalCollateralValue) {
|
||||||
this.isCollateralSufficient = true;
|
this.isCollateralSufficient = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -270,8 +270,7 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges {
|
|||||||
get loansAccountCharges() {
|
get loansAccountCharges() {
|
||||||
return {
|
return {
|
||||||
charges: this.chargesDataSource,
|
charges: this.chargesDataSource,
|
||||||
collateral: this.collateralDataSource,
|
collateral: this.collateralDataSource
|
||||||
isValid: this.isCollateralSufficient
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user