Fairoj : Family details issue fixes

This commit is contained in:
venbatechnologies@gmail.com 2021-03-08 19:58:38 +05:30
parent 3894a7d0fa
commit f80a6e0e0e
3 changed files with 24 additions and 13 deletions

View File

@ -126,7 +126,7 @@
<input matInput placeholder="Specify Ownership" formControlName="ownershipOther"> <input matInput placeholder="Specify Ownership" formControlName="ownershipOther">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="sup.get('residence_ownership').value == 1" style="width:43%;"> <mat-form-field *ngIf="sup.get('residence_ownership').value == 3" style="width:43%;margin-bottom: 1%;">
<input matInput placeholder=" Monthly Rent Amount" formControlName="rent" <input matInput placeholder=" Monthly Rent Amount" formControlName="rent"
OnlyNumber type="text"> OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('rent').value != ''">{{"&#8377;"}} {{sup.get('rent').value | numberToWords}} Only</mat-hint> <mat-hint align="start" style="font-size:90%" *ngIf="sup.get('rent').value != ''">{{"&#8377;"}} {{sup.get('rent').value | numberToWords}} Only</mat-hint>
@ -283,7 +283,7 @@
</mat-card-actions> </mat-card-actions>
</div> </div>
<div *ngIf="lender_short_name === 'CLIX' || lender_short_name === 'MWISE' || lender_short_name === 'UDAAN' || lender_short_name !== 'CFPL' && prod_catagory != 'LFMP'"> <div *ngIf="lender_short_name === 'CLIX' || lender_short_name === 'MWISE' || lender_short_name === 'UDAAN' || lender_short_name === 'CFPL' && prod_catagory != 'LFMP'">
<mat-card> <mat-card>
<mat-card-header> <mat-card-header>
<mat-card-title> <mat-card-title>

View File

@ -587,19 +587,28 @@ export class FamilyDetailsComponent implements OnInit {
let familyDetailsFormGrp : FormGroup = familyFormArray.controls[cnt1] as FormGroup; let familyDetailsFormGrp : FormGroup = familyFormArray.controls[cnt1] as FormGroup;
let familyMembersFormArr : FormArray = familyDetailsFormGrp.controls.family_members_details as FormArray; let familyMembersFormArr : FormArray = familyDetailsFormGrp.controls.family_members_details as FormArray;
familyDetailsFormGrp.controls.residence_ownership.value == 1 if (familyDetailsFormGrp.controls.residence_ownership.value == 1) {
? familyDetailsFormGrp.controls.ownershipOther.setValidators([Validators.required]) familyDetailsFormGrp.controls.ownershipOther.setValidators([Validators.required])
: familyDetailsFormGrp.controls.ownershipOther.setValue(''); }
familyDetailsFormGrp.controls.ownershipOther.updateValueAndValidity(); else {
familyDetailsFormGrp.controls.ownershipOther.setValue(''); familyDetailsFormGrp.controls.ownershipOther.clearValidators()
}
familyDetailsFormGrp.controls.ownershipOther.updateValueAndValidity();
familyDetailsFormGrp.controls.residence_ownership.value == 3 if (familyDetailsFormGrp.controls.residence_ownership.value == 3) {
? familyDetailsFormGrp.controls.rent.setValidators([Validators.required]) familyDetailsFormGrp.controls.rent.setValidators([Validators.required])
: familyDetailsFormGrp.controls.rent.setValue(''); }
else {
familyDetailsFormGrp.controls.rent.setValue(''); familyDetailsFormGrp.controls.rent.clearValidators()
}
familyDetailsFormGrp.controls.rent.updateValueAndValidity(); familyDetailsFormGrp.controls.rent.updateValueAndValidity();
familyDetailsFormGrp.controls.residence_pin.value == 1 if (familyDetailsFormGrp.controls.residence_pin.value == 1) {
? familyDetailsFormGrp.controls.residence_other_pincode.setValidators([Validators.required]) familyDetailsFormGrp.controls.residence_other_pincode.setValidators([Validators.required])
: familyDetailsFormGrp.controls.residence_other_pincode.setValue(''); }
else {
familyDetailsFormGrp.controls.residence_other_pincode.setValue(''); familyDetailsFormGrp.controls.residence_other_pincode.clearValidators()
}
familyDetailsFormGrp.controls.residence_other_pincode.updateValueAndValidity(); familyDetailsFormGrp.controls.residence_other_pincode.updateValueAndValidity();
let FMArrayLength: any = familyMembersFormArr.controls.length; let FMArrayLength: any = familyMembersFormArr.controls.length;

View File

@ -5,7 +5,9 @@ import { Pipe, PipeTransform } from '@angular/core';
}) })
export class NumberToWordsPipe implements PipeTransform { export class NumberToWordsPipe implements PipeTransform {
transform(price: any): any{ transform(price: any): any{
if(price == null || price == undefined || price == '') {
return;
}
price = price.toString(); price = price.toString();
let atemp = price.split("."); let atemp = price.split(".");
let amount = atemp[0]; let amount = atemp[0];