From a0a713b5d31a4b4d8f39b6f1c0fb8dbd60f0f7c8 Mon Sep 17 00:00:00 2001 From: sriram-at-840620226347 Date: Tue, 26 Nov 2019 18:49:23 +0530 Subject: [PATCH] Address and Rental verification changes done --- .../pd-question-address.ts | 7 +++ .../pd-question-business-assets.ts | 52 ++++++++++++++++++- .../pd-question-financial-info.html | 9 +--- .../pd-question-current-loans.html | 10 ++-- .../pd-question-rental-dash.html | 11 +++- .../pd-question-rental-dash.ts | 19 +++++++ .../question-category/question-category.ts | 11 +++- 7 files changed, 103 insertions(+), 16 deletions(-) diff --git a/src/pages/pd-question/pd-question-address/pd-question-address.ts b/src/pages/pd-question/pd-question-address/pd-question-address.ts index 88339a80..ad95ba47 100755 --- a/src/pages/pd-question/pd-question-address/pd-question-address.ts +++ b/src/pages/pd-question/pd-question-address/pd-question-address.ts @@ -555,6 +555,7 @@ countRowsForTextarea(text){ } initAddress(AddressDetails){ + console.log('null Checking',AddressDetails); if(AddressDetails != null){ return this.fb.group({ @@ -566,6 +567,7 @@ countRowsForTextarea(text){ citySearch:[''], stateSearch:[''], pinSearch:[''], + pd_address_id: [AddressDetails.pd_address_id], pincode: [AddressDetails.pincode],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */ pincode_others: [AddressDetails.pincode_others, Validators.compose([Validators.minLength(6), Validators.maxLength(6)])], // locality: [AddressDetails.locality, Validators.compose([Validators.required])], @@ -589,6 +591,7 @@ countRowsForTextarea(text){ stateSearch:[''], pinSearch:[''], pincode: [''], + pd_address_id: [''], pincode_others: ['', Validators.compose([Validators.minLength(6), Validators.maxLength(6)])], // locality: ['', Validators.compose([Validators.required])], // locality_others: [''], @@ -626,6 +629,7 @@ return this.fb.group({ pinSearch:[''], alternative_city:[''], alternative_pincode:[''], + alternative_pd_address_id:[''], alternative_pincode_others:[''], reason_for_alternative_address:[''] }) @@ -637,6 +641,7 @@ else{ stateSearch:[''], citySearch:[''], pinSearch:[''], + alternative_pd_address_id:[''], alternative_city:[add_values.alternative_city], alternative_pincode:[add_values.alternative_pincode], alternative_pincode_others:[add_values.alternative_pincode_others], @@ -919,6 +924,7 @@ else{ 'state': datas.state, 'city': datas.city, 'pincode': datas.pincode, + 'pd_address_id': datas.pd_address_id, 'pincode_others': datas.pincode ? datas.pincode_others : '' } this.getCityAndPincodeDetails(datas.state, index, 1); @@ -1395,6 +1401,7 @@ else{ 'state': datas.fk_state, 'city': datas.fk_city, 'pincode':datas.pincode_id, + 'pd_address_id': datas.pd_address_id, 'pincode_others': datas.other_pincode, 'locality': '', 'locality_others': '', diff --git a/src/pages/pd-question/pd-question-business-group/pd-question-business-assets/pd-question-business-assets.ts b/src/pages/pd-question/pd-question-business-group/pd-question-business-assets/pd-question-business-assets.ts index 9635abfc..201a827e 100755 --- a/src/pages/pd-question/pd-question-business-group/pd-question-business-assets/pd-question-business-assets.ts +++ b/src/pages/pd-question/pd-question-business-group/pd-question-business-assets/pd-question-business-assets.ts @@ -75,6 +75,7 @@ export class PdQuestionBusinessAssetsPage { lender_short_name: any; product_abbr: any; pd_value_params:any; + CurrentAddressLabel=null; @ViewChild('childComp') child: PdGeneralImagesPage @@ -219,7 +220,56 @@ export class PdQuestionBusinessAssetsPage { if (initiated_address_check == false ) { this.addressList.push({ key_name: 'alternative_addresses', value: data['records'].alternative_addresses[0].alternative_address, description: 'Alternative Address' }); } - } + let addressarry= data['records'].addresses + if(initiated_address_check == false){ + addressarry = data['records'].alternative_addresses + } + addressarry.forEach((data, inx) => { + if(initiated_address_check == false){ + data.address=data.alternative_address + data.state=data.alternative_state + data.city=data.alternative_city + data.pincode=data.alternative_pincode + } + this.qustcat.getStateWiseCities(data.state).subscribe(res=>{ + if(res.dataStatus== true){ + console.log("state",res) + this.cityArr=res.records.cities + this.pinArr = res.records.pincode; + let selectedAddressType = this.m_address_type.filter(element => element.address_type_id == data.address_type)[0]; + let selectedState = this.m_state_for_address.filter(element => element.state_id == data.state)[0]; + let selectedCity = this.cityArr.filter(element => element.city_id == data.city)[0]; + let selectedPincode = this.pinArr.filter(element => element.pincode_id == data.pincode)[0]; + + console.log(selectedCity) + + if(selectedAddressType != '' && selectedAddressType != undefined){ + this.addressType = data.address_type != 1 ? selectedAddressType.address_type : data.address_type_others; + } + else{ + this.addressType='' + } + // let address = data.address + ' , ' + selectedCity.city_name + ','+selectedState.name +'-' + (data.pincode == 1 ? data.pincode_others : selectedPincode.pincode); + let address = data.address.replace(/\n/g,"") + ' , ' + selectedCity.city_name + ','+selectedState.name +'-' + (data.pincode == 1 ? data.pincode_others : selectedPincode.pincode); + + + + // let selectedAddressType = this.m_address_type.filter(element =>element.address_type_id == data.address_type)[0]; + // let address = data.address; + // let addressType = data.address_type != 1 ? selectedAddressType.address_type : data.address_type_others; + + this.placeholderName[inx] = 'Was any business activity seen at the '+ this.addressType+' during PD visit?'; + //console.log(this.placeholderName) + let addressLabel = " : "+address+' / '+ this.addressType ; + + this.CurrentAddressLabel = addressLabel; + const control = this._businessAssetsQuesFrom.controls['business_assets_for_address']; + control.controls[0]['controls'].address_label.setValue(this.CurrentAddressLabel); + } + }) + + }) + } if(flag == 2){ let dataOfAddress = data['records'].addresses.filter(item => item.isactive == 1); this.addressList.push({ key_name: 'initiate_address', value: data['records'].addresses[0].address, description: 'Initiated Address' }); diff --git a/src/pages/pd-question/pd-question-business-group/pd-question-financial-info/pd-question-financial-info.html b/src/pages/pd-question/pd-question-business-group/pd-question-financial-info/pd-question-financial-info.html index 45bd5afc..5b1c57ba 100755 --- a/src/pages/pd-question/pd-question-business-group/pd-question-financial-info/pd-question-financial-info.html +++ b/src/pages/pd-question/pd-question-business-group/pd-question-financial-info/pd-question-financial-info.html @@ -279,12 +279,7 @@ {{"₹"}} {{AV_netProfitAmtInwords[i]}} Only - - - - - {{"₹"}} {{AV_CCAnnualSalesAmtInwords[i]}} Only - +