Fix Collaterals on Loan: It is optional
This commit is contained in:
@@ -95,8 +95,7 @@ export class CreateLoansAccountComponent implements OnInit {
|
||||
get loansAccountFormValid() {
|
||||
return (
|
||||
this.loansAccountDetailsForm.valid &&
|
||||
this.loansAccountTermsForm.valid &&
|
||||
this.loansAccountChargesStep.loansAccountCharges.isValid
|
||||
this.loansAccountTermsForm.valid
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@
|
||||
<fa-icon icon="arrow-left"></fa-icon>
|
||||
Previous
|
||||
</button>
|
||||
<button mat-raised-button matStepperNext [disabled]="!isCollateralSufficient">
|
||||
<button mat-raised-button matStepperNext [disabled]="!loansAccountFormValid">
|
||||
Next
|
||||
<fa-icon icon="arrow-right"></fa-icon>
|
||||
</button>
|
||||
|
||||
+3
-4
@@ -69,7 +69,7 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if ( this.loansAccountTemplate.charges) {
|
||||
if (this.loansAccountTemplate.charges) {
|
||||
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.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) {
|
||||
this.isCollateralSufficient = true;
|
||||
} else {
|
||||
@@ -270,8 +270,7 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges {
|
||||
get loansAccountCharges() {
|
||||
return {
|
||||
charges: this.chargesDataSource,
|
||||
collateral: this.collateralDataSource,
|
||||
isValid: this.isCollateralSufficient
|
||||
collateral: this.collateralDataSource
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user