From 218d9d3a1a591746be52e86bba4607c31ec448d6 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 18 Feb 2019 10:13:59 +0530 Subject: [PATCH] changes:ps --- .../edit-pd-applicant.component.html | 4 +- .../edit-pd-applicant.component.ts | 8 +- .../forms/address/address.component.html | 32 ++--- .../assets-info/assets-info.component.html | 48 ++++--- .../assets-info/assets-info.component.ts | 31 ++++- .../business-assets-info.component.html | 95 +++++++++++++- .../business-assets-info.component.ts | 120 +++++++++++++++++- .../business-info/business-info.component.ts | 30 ++--- .../family-details.component.html | 2 +- .../family-details.component.ts | 20 +-- .../financial-info.component.html | 8 +- .../financial-info.component.ts | 29 +++-- .../general-info/general-info.component.html | 2 +- .../general-info/general-info.component.ts | 15 ++- .../loan-details/loan-details.component.html | 2 +- .../loan-details/loan-details.component.ts | 86 ++++++++----- .../neighbour-hood.component.ts | 2 +- .../supplier-info.component.html | 11 +- .../supplier-info/supplier-info.component.ts | 28 ++++ 19 files changed, 444 insertions(+), 129 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.html index 2916be92c..183850d9c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.html @@ -88,7 +88,7 @@ Enter Valid Landline Number. - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts index 881ab4dd7..d0c7325b2 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts @@ -108,7 +108,7 @@ export class EditPdApplicantComponent implements OnInit { coapplicant_stdcode: [stdcode, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])], // landline: [landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8)])], coapplicant_landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])], - relationship: [listData.relation], + // relationship: [listData.relation], applicant_type: [listData.applicant_type, Validators.compose([Validators.required])], company_name: [listData.company_name], }); @@ -123,7 +123,7 @@ export class EditPdApplicantComponent implements OnInit { coapplicant_stdcode: [null, Validators.compose([Validators.minLength(3),Validators.maxLength(5)])], coapplicant_landline: [null,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])], //coapplicant_landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])], - relationship: [null], + // relationship: [null], applicant_type: [0], company_name: [null], }); @@ -176,7 +176,7 @@ export class EditPdApplicantComponent implements OnInit { "mobile_no":formValue.mobile_no, "landline":concat_landline1, "applicant_type":formValue.applicant_type, - "relation":formValue.relationship, + // "relation":formValue.relationship, "applicant_title_name": formValue.applicant_title_name, "isactive":1 }]; @@ -203,7 +203,7 @@ export class EditPdApplicantComponent implements OnInit { "pd_co_applicant_id": itemElement.fk_applicant_primary_id, "applicant_title_name":itemElement.applicant_title_name, "applicant_name":itemElement.coapplicantName, - "relation":itemElement.relationship, + // "relation":itemElement.relationship, "mobile_no":itemElement.coapplicant_mobile_no, "landline":concat_landline, "applicant_type":itemElement.applicant_type, diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html index 00dd790d5..aebc2fa44 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html @@ -22,17 +22,17 @@
-
+
- +
-
- +
+ {{m_addressType.address_type}} @@ -41,15 +41,15 @@
-
- +
+ Address Type Required
-
- +
+ {{m_locality.locality_name}} @@ -58,24 +58,24 @@
-
- +
+ Locality Required
-
- +
+ MixUse Required
-
- +
+ {{data.description}} @@ -84,8 +84,8 @@
-
- +
+ {{data.rating}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html index b6a7e682f..69448f507 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html @@ -40,12 +40,12 @@
- + {{ prop.name }} - +
@@ -57,11 +57,23 @@
- + + + {{ vehicle.vehicle_type_name }} + + + + + + - + + + + +
@@ -117,27 +129,27 @@
- + {{"₹"}} {{OtherPremiumPaidInwords[s]}} Only - + {{ freqn.name }} - +
- + {{"₹"}} {{OtherSumAssuredInwords[s]}} Only - + @@ -153,13 +165,13 @@
- + {{ ins_type.name }} - + @@ -167,7 +179,7 @@ - + @@ -178,7 +190,7 @@
- +
@@ -211,12 +223,12 @@
- + {{"₹"}} {{OtherAssetValueInwords[s]}} Only - + {{data.viewValue}} @@ -228,7 +240,7 @@
- + {{"₹"}} {{OtherAppxMarketAmtInwords[i]}} Only @@ -264,14 +276,14 @@ - + Age of Asset in Years - + Purchase Year diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts index 334ff9d15..87c6a6477 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts @@ -68,6 +68,8 @@ export class AssetsInfoComponent implements OnInit { public m_investmentType = []; public m_freqOfPurchase = []; + + public m_vehicle_type = []; private notifier: NotifierService; existCompanyList: any =[]; @@ -146,6 +148,7 @@ export class AssetsInfoComponent implements OnInit { this.getM_FreqOfPurchase(); //this.getM_Relation(); //this.getM_InsuranceType(); + this.getM_Vehicle_Type(); } // ====================== @@ -211,6 +214,13 @@ export class AssetsInfoComponent implements OnInit { ) } + getM_Vehicle_Type(){ + this.pdTrigerService.getAllMasterDatas('VEHICLETYPE').subscribe( + data => { + this.m_vehicle_type = data.records.filter(data => data.is_active == 1); + }) + } + // getM_InsuranceType() { // this.pdTrigerService.getAllMasterDatas('INSURANCETYPE').subscribe( // data => { @@ -427,7 +437,9 @@ export class AssetsInfoComponent implements OnInit { load_Four_Weeler() { return this._formBuilder.group({ - manufacturer_model_vehicle: [''] + manufacturer_model_vehicle: [''], + vehicle_type:[''], + other_vehicle_type:[''] }); } @@ -506,7 +518,9 @@ export class AssetsInfoComponent implements OnInit { load_Four_WeelerWithData(data) { return this._formBuilder.group({ - manufacturer_model_vehicle: [data.manufacturer_model_vehicle] + manufacturer_model_vehicle: [data.manufacturer_model_vehicle], + vehicle_type:[''], + other_vehicle_type:[''] }); } @@ -621,7 +635,9 @@ export class AssetsInfoComponent implements OnInit { case '3': { let array_data : any; data.forEach((datas,i) => { - array_data = { 'manufacturer_model_vehicle': datas.manufacturer_model_vehicle }; + array_data = { 'manufacturer_model_vehicle': datas.manufacturer_model_vehicle, + 'vehicle_type':datas.vehicle_type, + 'other_vehicle_type':datas.other_vehicle_type}; }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; control.push(this.load_Four_WeelerWithData(array_data)); @@ -842,9 +858,14 @@ export class AssetsInfoComponent implements OnInit { : item.controls.other_owner.clearValidators(); item.controls.other_owner.updateValueAndValidity(); } - + if(flag == 5){ + value==1 + ? item.controls.other_vehicle_type.setValidators([Validators.required]) + : item.controls.other_vehicle_type.clearValidators(); + item.controls.other_vehicle_type.updateValueAndValidity(); +} - } +} /** Amount InWords */ inWords(e,i,flag){ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html index c63662f9f..203ffd89e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html @@ -65,6 +65,85 @@
+ +
+
+
+
+ + + + Owned + Rented + + + + + + {{"₹"}} {{RentAmtInwords2[i]}} Only + Monthly Rent Amount Required + + + +
+ + + + + + {{"₹"}} {{appxMarketAmtInwords2[i]}} Only + + + + + + + {{val.name}} + + + + Asset Owned by Required + + + + + + + + + + + + + Approx Vintage + + + + + + Purchase Year + + + +
+ + + +
+ + + Yes + No + + +
+
+
+
+
+
Owned Rented diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts index de3da536b..025271008 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts @@ -34,13 +34,16 @@ export class BusinessAssetsInfoComponent implements OnInit { {'value': "no",'viewValue': "No"}, ] appxMarketAmtInwords : any = []; + appxMarketAmtInwords2:any=[]; // emiAmtInwords : any = []; // PremiumPaidInwords : any = []; // SumAssuredInwords: any = []; // AmtInvestInwords: any = []; AssetValueInwords: any = []; + // B_emiAmtInwords: any = []; RentAmtInwords:any=[]; + RentAmtInwords2:any=[]; public m_propertyType = []; PropertyOwnedType : any = []; // public m_investmentType = []; @@ -109,7 +112,7 @@ export class BusinessAssetsInfoComponent implements OnInit { this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ if(data.dataStatus){ - this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true && val.company_order_id==this.company_id); + this.existCompanyList = data.records.filter(val =>val.is_active===true); } let modifyCompanyList : any=[]; @@ -143,7 +146,7 @@ export class BusinessAssetsInfoComponent implements OnInit { this.pdTrigerService.retriveForm(params).subscribe(data => { if(data.status == 200) { - console.log(data.records); + // console.log(data.records); this.addressLabel = ''; @@ -266,11 +269,19 @@ export class BusinessAssetsInfoComponent implements OnInit { business_address_availability:[value.business_address_availability], business_is_pd_visited:[value.business_is_pd_visited], business_pd_visited_remark:[value.business_pd_visited_remark], + business_assets_for_address: this._formBuilder.array([]), // business_activity:[value.business_activity], // business_premises_additional_units: this._formBuilder.array([]), business_assets_details : this._formBuilder.array([]), business_assets_form_remark:[value.business_assets_form_remark || null] }); + if(value.business_address_availability == 'yes'){ + this.addBusinessAssetsForAddress(value.business_assets_for_address); + } + else{ + const control = this._businessAssetsQuesFrom.controls['business_assets_for_address']; + control.push(this.createBusinessAssetsForAddress()); + } // if(value.business_activity == 'yes'){ // this.addBusinessUnitsWithData(value.business_premises_additional_units); // } @@ -293,6 +304,8 @@ export class BusinessAssetsInfoComponent implements OnInit { // business_activity:[''], business_is_pd_visited:[''], business_pd_visited_remark:[''], + business_assets_for_address: this._formBuilder.array([ + this.createBusinessAssetsForAddress() ]), // business_premises_additional_units: this._formBuilder.array([ // this.createUnits() // ]), @@ -334,6 +347,20 @@ export class BusinessAssetsInfoComponent implements OnInit { }); } + createBusinessAssetsForAddress(): FormGroup { + return this._formBuilder.group({ + business_approximate_market_value: [''], + business_ownership_type:[''], + business_monthly_rented_amt:[''], + business_name_of_the_owner: [''], + business_name_of_the_other_owner: [''], + business_vintage: [''], + business_purchase_year: ['',Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])], + business_emi:[''] + }); + } + + selectedPropertyOwnedType(e,s,i){ // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(i).get('business_details') as FormArray ; @@ -409,6 +436,7 @@ export class BusinessAssetsInfoComponent implements OnInit { return this._formBuilder.group({ property_type: [''], other_property_type: [''], + address_of_the_property:[''] }); } @@ -477,6 +505,7 @@ export class BusinessAssetsInfoComponent implements OnInit { return this._formBuilder.group({ property_type: [data.property_type], other_property_type: [data.other_property_type], + address_of_the_property:[data.address_of_the_property], //property_type:[''] }); } @@ -553,6 +582,19 @@ export class BusinessAssetsInfoComponent implements OnInit { return formGroup; } + createBusinessAssetsForAddressWithData(data): FormGroup { + return this._formBuilder.group({ + business_approximate_market_value: [data.business_approximate_market_value], + business_ownership_type:[data.business_ownership_type], + business_monthly_rented_amt:[data.business_monthly_rented_amt], + business_name_of_the_owner: [data.business_name_of_the_owner], + business_name_of_the_other_owner: [data.business_name_of_the_other_owner], + business_vintage: [data.business_vintage], + business_purchase_year: [data.business_purchase_year,Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])], + business_emi:[data.business_emi] + }); + } + initBusinessDetailsWithdata(data) { let formGroup= this._formBuilder.group({ @@ -573,6 +615,35 @@ export class BusinessAssetsInfoComponent implements OnInit { } loadDetails: boolean; + addBusinessAssetsForAddress(data){ + var result = Object.keys(data).map(function (key) { + return data[key]; + }); + if (result.length > 0) { + result.forEach((datas,index) => { + this.RentAmtInwords2[index] = this.pdTrigerService.convertNumberToWords(datas.business_monthly_rented_amt); + this.appxMarketAmtInwords2[index] = this.pdTrigerService.convertNumberToWords(datas.business_approximate_market_value); + }); + + for (let val of result) { + let vals = { + business_approximate_market_value: val.business_approximate_market_value, + business_ownership_type:val.business_ownership_type, + business_monthly_rented_amt:val.business_monthly_rented_amt, + business_name_of_the_owner: val.business_name_of_the_owner, + business_name_of_the_other_owner: val.business_name_of_the_other_owner, + business_vintage: val.business_vintage, + business_purchase_year: val.business_purchase_year, + business_emi:val.business_emi + }; + const control = this._businessAssetsQuesFrom.controls['business_assets_for_address']; + control.push(this.createBusinessAssetsForAddressWithData(vals)); + } + }else{ + const control = this._businessAssetsQuesFrom.controls['business_assets_for_address']; + control.push(this.createBusinessAssetsForAddress()); + } + } // addBusinessUnitsWithData(data){ // var result = Object.keys(data).map(function (key) { @@ -643,7 +714,7 @@ export class BusinessAssetsInfoComponent implements OnInit { case '2': { let business_property_datas : any; data.forEach((datas,i) => { - business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type }; + business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type,'address_of_the_property':datas.address_of_the_property }; // this.selectedPropertyOwnedType(datas.properties_ownership_type,i,val); }); const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; @@ -774,6 +845,16 @@ export class BusinessAssetsInfoComponent implements OnInit { } + checkOthers2(values){ + if(values!=null) { + return values.id==0 ? true : false; + } + else { + return false; + } + + } + // calculate vintage and purchase {} calculateVintagePurchase(value: any, controlKey: any,type: number){ if(type==1){ @@ -785,6 +866,15 @@ export class BusinessAssetsInfoComponent implements OnInit { value!='' && value<=this.currentYear ? control.controls[controlKey].controls['business_purchase_year'].setValue(value) : control.controls[controlKey].controls['business_purchase_year'].setValue(''); value!='' && value<=this.currentYear ? control.controls[controlKey].controls['business_vintage'].setValue(parseInt(this.currentYear)-parseInt(value)) : control.controls[controlKey].controls['business_vintage'].setValue('') } + if(type==3){ + let control: any = this._businessAssetsQuesFrom.controls['business_assets_for_address']; + control.controls[controlKey].controls['business_purchase_year'].setValue(value!='' ? parseInt(this.currentYear)-parseInt(value) : ''); + } + else if(type==4) { + let control: any = this._businessAssetsQuesFrom.controls['business_assets_for_address']; + value!='' && value<=this.currentYear ? control.controls[controlKey].controls['business_purchase_year'].setValue(value) : control.controls[controlKey].controls['business_purchase_year'].setValue(''); + value!='' && value<=this.currentYear ? control.controls[controlKey].controls['business_vintage'].setValue(parseInt(this.currentYear)-parseInt(value)) : control.controls[controlKey].controls['business_vintage'].setValue('') + } } /** To Save/Edited Popup Data */ @@ -959,6 +1049,24 @@ export class BusinessAssetsInfoComponent implements OnInit { : item.controls.other_property_type.clearValidators(); item.controls.other_property_type.updateValueAndValidity(); } + if(flag == 7){ + if(value == 'owned'){ + item.controls.business_monthly_rented_amt.clearValidators(); + item.controls.business_name_of_the_owner.setValidators([Validators.required]); + } + else{ + item.controls.business_monthly_rented_amt.setValidators([Validators.required]); + item.controls.business_name_of_the_owner.clearValidators(); + } + item.controls.business_monthly_rented_amt.updateValueAndValidity(); + item.controls.business_name_of_the_owner.updateValueAndValidity(); +} +if(flag == 8){ + value==0 + ? item.controls.business_name_of_the_other_owner.setValidators([Validators.required]) + : item.controls.business_name_of_the_other_owner.clearValidators(); + item.controls.business_name_of_the_other_owner.updateValueAndValidity(); +} } @@ -1003,6 +1111,12 @@ export class BusinessAssetsInfoComponent implements OnInit { case 8: this.RentAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); break; + case 9: + this.RentAmtInwords2[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 10: + this.appxMarketAmtInwords2[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; default: break; } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts index 6ac3f43a5..a73394d97 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts @@ -647,17 +647,17 @@ export class BusinessInfoComponent implements OnInit { // businees activity type change event changeBusinessActivity(event: any){ - console.log('changeBusinessActivity'); + // console.log('changeBusinessActivity'); if(event.value.exist_status==true && event.value.type_of_activity_id==2){ - console.log('changeBusinessActivity 1'); + // console.log('changeBusinessActivity 1'); this.ManufacturingChecked = event.value.exist_status; let manufacturingControl = this.businessForm.controls['manufacturing_activity_details']; manufacturingControl.controls = []; manufacturingControl.setValue([]); } else if(event.value.exist_status==false && event.value.type_of_activity_id==2){ - console.log('changeBusinessActivity 2'); + // console.log('changeBusinessActivity 2'); this.ManufacturingChecked = event.value.exist_status; let manufacturingControl = this.businessForm.controls['manufacturing_activity_details']; manufacturingControl.push(this.createActivity()); @@ -665,40 +665,40 @@ export class BusinessInfoComponent implements OnInit { } if(event.value.exist_status==true && event.value.type_of_activity_id==3){ - console.log('changeBusinessActivity 3'); + // console.log('changeBusinessActivity 3'); this.RetailedChecked = event.value.exist_status; let retailControl = this.businessForm.controls['retail_trading_activity_details']; retailControl.controls = []; retailControl.setValue([]); } else if(event.value.exist_status==false && event.value.type_of_activity_id==3){ - console.log('changeBusinessActivity 4'); + // console.log('changeBusinessActivity 4'); this.RetailedChecked = event.value.exist_status; let retailControl = this.businessForm.controls['retail_trading_activity_details']; retailControl.push(this.createActivity()); } if(event.value.exist_status==true && event.value.type_of_activity_id==4){ - console.log('changeBusinessActivity 5'); + // console.log('changeBusinessActivity 5'); this.WholeSalesChecked = event.value.exist_status; let wholesaleControl = this.businessForm.controls['wholesale_trading_activity_details']; wholesaleControl.controls = []; wholesaleControl.setValue([]); } else if(event.value.exist_status==false && event.value.type_of_activity_id==4){ - console.log('changeBusinessActivity 6'); + // console.log('changeBusinessActivity 6'); this.WholeSalesChecked = event.value.exist_status; let wholesaleControl = this.businessForm.controls['wholesale_trading_activity_details']; wholesaleControl.push(this.createActivity()); } if(event.value.exist_status==true && event.value.type_of_activity_id==5){ - console.log('changeBusinessActivity 7'); + // console.log('changeBusinessActivity 7'); this.ServiceChecked = event.value.exist_status; let serviceControl = this.businessForm.controls['service_provider_activity_details']; serviceControl.controls = []; serviceControl.setValue([]); } else if(event.value.exist_status==false && event.value.type_of_activity_id==5){ - console.log('changeBusinessActivity 8'); + // console.log('changeBusinessActivity 8'); this.ServiceChecked = event.value.exist_status; let serviceControl = this.businessForm.controls['service_provider_activity_details']; serviceControl.push(this.createServiceActivity()); @@ -1778,10 +1778,10 @@ CheckExport(value,stringFlag,index){ // console.log(datas[index].controls.exist_status.value); // }); - console.log('CheckExport'); - console.log(value,stringFlag,index); + // console.log('CheckExport'); + // console.log(value,stringFlag,index); - console.log(this.ManufacturingChecked , this.RetailedChecked , this.WholeSalesChecked , this.ServiceChecked); + // console.log(this.ManufacturingChecked , this.RetailedChecked , this.WholeSalesChecked , this.ServiceChecked); if(!this.ManufacturingChecked){ if(stringFlag == 'MActivity' && value != "Within India"){ @@ -1833,7 +1833,7 @@ CheckExport(value,stringFlag,index){ } let SumOfManufacturingCounter = this.ManufacturingCounterArray.reduce((sum, val) => sum + +val, 0); - console.log(SumOfManufacturingCounter,this.ManufacturingCounterArray); + // console.log(SumOfManufacturingCounter,this.ManufacturingCounterArray); let SumOfRetailCounter = this.RetailCounterArray.reduce((sum, val) => sum + +val, 0); // console.log(SumOfRetailCounter , this.RetailCounterArray); let SumOfWholeSaleCounter = this.WholeSaleCounterArray.reduce((sum, val) => sum + +val, 0); @@ -1845,8 +1845,8 @@ CheckExport(value,stringFlag,index){ this.ExportFlag = overallCounter > 0 ? true : false ; - console.log('overallCounter , SumOfManufacturingCounter , SumOfRetailCounter , SumOfWholeSaleCounter , SumOfServiceCounter ' , overallCounter , SumOfManufacturingCounter , SumOfRetailCounter , SumOfWholeSaleCounter , SumOfServiceCounter); - console.log('Current Flag Status : ',this.ExportFlag ); + // console.log('overallCounter , SumOfManufacturingCounter , SumOfRetailCounter , SumOfWholeSaleCounter , SumOfServiceCounter ' , overallCounter , SumOfManufacturingCounter , SumOfRetailCounter , SumOfWholeSaleCounter , SumOfServiceCounter); + // console.log('Current Flag Status : ',this.ExportFlag ); } inWords(e,flag){ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html index e1e591433..4487221b8 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html @@ -382,7 +382,7 @@ - {{earnings.type}} + {{earnings.type}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts index eb2241b53..c244f40b4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts @@ -369,13 +369,13 @@ export class FamilyDetailsComponent implements OnInit { this._pd.getFamilyDetails(this.pdid).subscribe(data=>{ console.clear(); - // console.log('data',data); + console.log('getFamilyDetails data',data); if(data.dataStatus == true){ let Temparr : any = []; - // console.log('from_business_form',data.record.from_business_form); - // console.log('from_general_form',data.record.from_general_form); + console.log('from_business_form',data.record.from_business_form); + console.log('from_general_form',data.record.from_general_form); if(data.record.from_general_form.length > 0){ let familyMembersGeneralForm = Object.keys(data.record.from_general_form).map(function (key) { @@ -672,8 +672,11 @@ export class FamilyDetailsComponent implements OnInit { let arraydata : any; let data = this.apiFamilyMembers.filter(item => item.relation_to == e); - // console.log('this.apiFamilyMembers',this.apiFamilyMembers); - // console.log('selectedPerson data',data); + + console.log('this.apiFamilyMembers',this.apiFamilyMembers); + console.log('selectedPerson data',data); + // data_gets_from:'GeneralForm' + // data_gets_from:'BusinessForm' if(data.length > 0){ // console.log(control.length); @@ -690,7 +693,8 @@ export class FamilyDetailsComponent implements OnInit { data.forEach((val,inx) => { - + console.log('for loop',val.data_gets_from); + // family_member_earning_status if(val.age){ this.isReadOnly[inx] = true; }else{ @@ -700,10 +704,10 @@ export class FamilyDetailsComponent implements OnInit { 'family_member_name' : val.name, 'family_member_relationship' : val.relationship, 'family_member_age' : val.age, - 'family_member_earning_status': '', + 'family_member_earning_status': val.data_gets_from == 'BusinessForm' ? '1' :'', 'earning_segment': '', 'earning_gross_income_per_month': '', - 'earning_name_of_the_employer_or_business': '', + 'earning_name_of_the_employer_or_business':'', 'earning_number_of_years_in_employment_or_business': '', 'earning_if_others_segment':'', 'non_earning_occupation': '', diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html index 90f17a2b4..2e5bf5841 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html @@ -252,7 +252,7 @@
- + {{"₹"}} {{AV_marginProfitAmtInwords[i]}} Only
@@ -266,7 +266,7 @@ {{"₹"}} {{AV_netProfitAmtToInwords[i]}} Only - + @@ -291,7 +291,7 @@ - + {{"₹"}} {{AV_marginLossAmtInwords[i]}} Only
@@ -305,7 +305,7 @@ {{"₹"}} {{AV_netLossAmtToInwords[i]}} Only - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts index c6abcfc41..10a9e7a0c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts @@ -862,7 +862,7 @@ export class FinancialInfoComponent implements OnInit { childArray.controls.financial_margin_of_profit.setValue(''); } else{ - loss_amt = loss_amt != 0 ? loss_amt * (-1) : loss_amt; + loss_amt = val.financial_net_loss != 0 ? val.financial_net_loss * (-1) : val.financial_net_loss; prev_loss_amt = prev_loss_amt != 0 ? prev_loss_amt * (-1) : prev_loss_amt ; let variation = (((profit_amt != '' ? profit_amt : loss_amt ) - (prev_profit_amt != '' ? prev_profit_amt : prev_loss_amt ))/ (prev_profit_amt != '' ? Math.abs(prev_profit_amt) : Math.abs(prev_loss_amt))) * 100; @@ -894,7 +894,7 @@ export class FinancialInfoComponent implements OnInit { childArray.controls.financial_variation.setValue(''); } else{ - profit_margin = (profit_amt / annual_sale) * 100; + profit_margin = (val.financial_net_profit / val.financial_annual_sale) * 100; childArray.controls.financial_margin_of_profit.setValue(profit_margin!= Infinity ? !(Number.isNaN(profit_margin)) ? profit_margin.toFixed(2):0:0); } @@ -919,14 +919,23 @@ export class FinancialInfoComponent implements OnInit { childArray.controls.financial_variation.setValue(''); } else{ - loss_margin = (loss_amt/annual_sale) * 100 * (-1); + // console.log('loss_amt = val.financial_net_loss;',val.financial_net_loss); + // console.log('loss_amt',loss_amt); + // console.log('loss_amt/annual_sale',loss_amt/annual_sale); + // console.log('(loss_amt/annual_sale) * 100',(loss_amt/annual_sale) * 100); + // console.log('(loss_amt/annual_sale) * 100 * (-1)',(loss_amt/annual_sale) * 100 * (-1)); + + loss_margin = (val.financial_net_loss/val.financial_annual_sale) * 100 * (-1); + + // console.log('loss_margin',loss_margin); + childArray.controls.financial_margin_of_loss.setValue(loss_margin != Infinity ? !(Number.isNaN(loss_margin)) ? loss_margin.toFixed(2) : 0 : 0); } } } - prev_profit_margin[index] = val.financial_margin_of_profit != '' ? val.financial_margin_of_profit : 0; + prev_profit_margin[index] = val.financial_margin_of_profit != '' ? val.financial_margin_of_profit: 0; prev_loss_margin[index] = val.financial_margin_of_loss !='' ? val.financial_margin_of_loss : 0 ; // if(index != 0 ){ @@ -949,18 +958,20 @@ export class FinancialInfoComponent implements OnInit { loss_margin = loss_margin !== undefined ? loss_margin : 0; - let temp_prev_loss_margin = prev_loss_margin[index-1] !== undefined ? prev_loss_margin[index-1] : 0 ; + profit_margin = profit_margin !== undefined ? profit_margin:0; + let temp_prev_loss_margin = prev_loss_margin[index-1] !== undefined ? prev_loss_margin[index-1] : 0 ; let temp_prev_profit_margin = prev_profit_margin[index-1] !== undefined ? prev_profit_margin[index-1] : 0 ; - profit_margin = profit_margin !== undefined ? profit_margin:0; - + if(annual_sale != ''){ + let variation_percent : any ; - variation_percent = (((profit_margin != '' ? profit_margin : loss_margin ) - (temp_prev_profit_margin != 0 ? temp_prev_profit_margin : temp_prev_loss_margin ))/ (temp_prev_profit_margin != 0 ? Math.abs(temp_prev_profit_margin) : Math.abs(temp_prev_loss_margin))) * 100; - let final_percent = variation_percent != Infinity ? !(Number.isNaN(variation_percent)) ? variation_percent.toFixed(2) :0: 0; + variation_percent = (((profit_margin != '' ? profit_margin : loss_margin ) - (temp_prev_profit_margin != 0 ? temp_prev_profit_margin : temp_prev_loss_margin) / (temp_prev_profit_margin != 0 ? Math.abs(temp_prev_profit_margin) : Math.abs(temp_prev_loss_margin))) * 100); + let final_percent = variation_percent != Infinity ? !(Number.isNaN(variation_percent)) ? variation_percent != -Infinity ? variation_percent.toFixed(2) : 0 : 0 : 0 ; childArray.controls.financial_profit_to_sale_variation.setValue(final_percent); + } } /**************************** Calculating Sales's Profit Variation - ENDS HERE **************************************************************/ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html index 1d11aaf1b..c0de40503 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html @@ -223,7 +223,7 @@ Select - {{comrelShip.name + ' of' | titlecase}} + {{comrelShip.name | titlecase}} Not Applicable diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts index d0858d633..697d6b860 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts @@ -151,6 +151,7 @@ export class GeneralInfoComponent implements OnInit { let exist_personsWithRelationships:any; let exist_companyWithRelationships:any; this._pd.retriveForm(params).subscribe(data => { + console.log('data',data); if(data.dataStatus) { this._generalForm.controls['general_remark'].setValue(data.records.general_remark ? data.records.general_remark : ''); @@ -158,7 +159,7 @@ export class GeneralInfoComponent implements OnInit { exist_individuals=Object.keys(data.records.individuals).map(function(key) { return data.records.individuals[key]; }); - + console.log('exist_individuals',exist_individuals); if(exist_individuals.length>0){ exist_individuals.forEach(element => { individualsControl.push(this.createIndividulas(element)) @@ -234,6 +235,7 @@ export class GeneralInfoComponent implements OnInit { } else { this.pd_applicants_details.forEach((element,key) => { + console.log('element element',element); element.is_applicant=true; element.is_person_met=false; element.is_new=false; @@ -447,6 +449,7 @@ export class GeneralInfoComponent implements OnInit { .subscribe(dataresult => { if(dataresult.data.length>0){ dataresult.data.forEach((element,index) => { + console.log('element',element); let individualsControl = this._generalForm.controls['individuals']; element.pd_co_applicant_id = this.count; this.count = this.count+1; @@ -475,6 +478,11 @@ export class GeneralInfoComponent implements OnInit { removeIndividuals(findex,details){ let control = this._generalForm.controls['individuals']; + let individualsControl : any = control.controls[findex]; + // individualsControl.controls.is_applicant.setValue(false); + + // console.log(control.controls[findex].value.is_active); + // .controls.is_active.setValue(false); // console.log('control',control.dirty); // console.log('control',control.dirty); // control.markAsDirty({onlySelf:true}); @@ -482,12 +490,15 @@ export class GeneralInfoComponent implements OnInit { control.removeAt(findex); let controls = this._generalForm.controls['persons_with_relationships']; + // console.log('control',control); let name = details.value.applicant_name; let index1 = controls.value.map(data => data.applicant_name).indexOf(name); + // let personsWithRelationshipsControl : any = control.controls[index1]; + // personsWithRelationshipsControl.controls.is_applicant.setValue(false); // control.markAsDirty({onlySelf:true}); // console.log('control',); - controls.removeAt(index1); + controls.removeAt(index1); } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html index ff46bccd8..99c3c1eb7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html @@ -86,7 +86,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts index d17fd15d9..36ce2880e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts @@ -49,6 +49,7 @@ export class LoanDetailsComponent implements OnInit { isOtherSource: boolean = false; isPLSource: boolean = false; mortageCheck : boolean = true; + isContribution: boolean = false; OtherOwnerFlag : boolean; endUserList: any = []; @@ -106,6 +107,10 @@ export class LoanDetailsComponent implements OnInit { this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; + + if(this.productAbbr == 'PL' || this.productAbbr == 'BL' || this.productAbbr == 'LAP'){ + this.isContribution = true; + } } public viewerOptions: any = { navbar: false, @@ -159,7 +164,9 @@ export class LoanDetailsComponent implements OnInit { // this.listOfLanguagues.splice(this.listOfLanguagues.indexOf(languague), 1); } - this.mergeCompanyApplicant.push({groupName:'OTHERS',groupValues:[{id:0,name:'Not Yet Finalised',group_id:2}]}) + if(this.productAbbr != 'LAP'){ + this.mergeCompanyApplicant.push({groupName:'OTHERS',groupValues:[{id:0,name:'Not Yet Finalised',group_id:2}]}) + } }) @@ -232,34 +239,42 @@ export class LoanDetailsComponent implements OnInit { if (value.records.other_bt_lender) { this.loanDetailsForm.controls['other_bt_lender'].setValue(value.records.other_bt_lender); } - if(value.records.is_transfer != 'yes'){ - - let source = Object.keys(value.records.source_group).map(function(key) { - return value.records.source_group[key]; - }); - - - let dbsourcelist : any = []; - source.forEach(val => { - dbsourcelist.push(val.sources); - }); - - this.loanDetailsForm.controls['own_contribution'].setValue(value.records.own_contribution); - if(value.records.own_contribution){ this.ownContributionInWords = this._pd.convertNumberToWords(value.records.own_contribution); } - - this.loanDetailsForm.controls['source'].setValue(dbsourcelist); - this.sourceChange(dbsourcelist); - - if(value.records.other_source) { - // this.isOtherSource = true; - this.loanDetailsForm.controls['other_source'].setValue(value.records.other_source); - } - - // if(value.records.personal_loan_source) { - // // this.isPLSource = true; - // this.loanDetailsForm.controls['personal_loan_source'].setValue(value.records.personal_loan_source); - // } + if((this.isContribution == true) && (value.records.is_transfer != 'yes')){ + this.loanDetailsForm.controls['own_contribution'].setValue(''); + this.loanDetailsForm.controls['other_source'].setValue(''); + this.loanDetailsForm.controls['source'].setValue(''); } + else{ + if(this.isContribution == false && value.records.is_transfer != 'yes'){ + + let source = Object.keys(value.records.source_group).map(function(key) { + return value.records.source_group[key]; + }); + + + let dbsourcelist : any = []; + source.forEach(val => { + dbsourcelist.push(val.sources); + }); + + this.loanDetailsForm.controls['own_contribution'].setValue(value.records.own_contribution); + if(value.records.own_contribution){ this.ownContributionInWords = this._pd.convertNumberToWords(value.records.own_contribution); } + + this.loanDetailsForm.controls['source'].setValue(dbsourcelist); + this.sourceChange(dbsourcelist); + + if(value.records.other_source) { + // this.isOtherSource = true; + this.loanDetailsForm.controls['other_source'].setValue(value.records.other_source); + } + + // if(value.records.personal_loan_source) { + // // this.isPLSource = true; + // this.loanDetailsForm.controls['personal_loan_source'].setValue(value.records.personal_loan_source); + // } + } + } + // if (value.records.lender_name_type) { // this.loanDetailsForm.controls['lender_name_type'].setValue(value.records.lender_name_type); @@ -306,6 +321,7 @@ export class LoanDetailsComponent implements OnInit { if(this.productAbbr == 'BL' || this.productAbbr == 'PL' || this.productAbbr == 'LL'){ this.mortageCardAccess = false; + this.loanDetailsForm.controls['owner_name'].setValue(''); this.loanDetailsForm.controls['owner_name'].clearValidators(); this.loanDetailsForm.controls['owner_name'].updateValueAndValidity(); @@ -607,12 +623,19 @@ getM_sourceofamount() { records.is_transfer = this.loanDetailsForm.controls['is_transfer'].value; // records.is_topup = this.loanDetailsForm.controls['is_topup'].value; - + // if((this.productAbbr != 'PL' || this.productAbbr != 'BL' || this.productAbbr != 'LAP') && (value.records.is_transfer != 'yes')){ if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') { records.balance_transfer_amount = this.loanDetailsForm.controls['balance_transfer_amount'].value; } - else if(this.loanDetailsForm.controls['is_transfer'].value == 'no') { - records.own_contribution = this.loanDetailsForm.controls['own_contribution'].value; + else if(this.loanDetailsForm.controls['is_transfer'].value == 'no'){ + if(this.isContribution){ + records.own_contribution = ''; + records.source_group = '' ; + records.other_source = ''; + } + else{ + + records.own_contribution = this.loanDetailsForm.controls['own_contribution'].value; // records.source = this.loanDetailsForm.controls['source'].value; // if (this.loanDetailsForm.controls['source'].value == 'other') { // records.lender_name_type = this.loanDetailsForm.controls['lender_name_type'].value; @@ -629,6 +652,7 @@ getM_sourceofamount() { } + } // if (this.loanDetailsForm.controls['is_topup'].value == 'yes') { records.topup_amount = this.loanDetailsForm.controls['topup_amount'].value; // } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts index 425b15ecc..1b221c05c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts @@ -251,7 +251,7 @@ export class NeighbourHoodComponent implements OnInit { "do_know":element.do_know, "did_not_know_the_business_operation":element.did_not_know_the_business_operation, "how_long_do_know_in_year":element.how_long_do_know_in_year, - "how_long_do_know_month":element.how_long_do_know_month, + "how_long_do_know_in_month":element.how_long_do_know_in_month, "is_applicant_owner":element.is_applicant_owner, "organisation_owner":element.organisation_owner, "other_organisation_owner":element.other_organisation_owner, diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html index 43abdced6..9efa4a538 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html @@ -80,8 +80,8 @@ - Payment received in Cash. - Payment received through Banking channels. + Payment made in Cash. + Payment made through Banking channels. @@ -130,8 +130,13 @@
Trading Product #{{l+1}}
- + + + + {{ pm.name }} + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts index 80c7fb904..0c1496450 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts @@ -41,6 +41,10 @@ export class SupplierInfoComponent implements OnInit { //@Input() pdid: number; pdid: string; form_id: number; + + public m_manufacturingProducts = []; + public m_tradingProducts = []; + company_id: string; public _supplierQuesFrom: FormGroup; public submitted = false; @@ -49,6 +53,7 @@ export class SupplierInfoComponent implements OnInit { private notifier: NotifierService; titleList: any=[]; companyRelationShipList: any=[]; + constructor( notifier: NotifierService, private _formBuilder: FormBuilder, @@ -110,6 +115,29 @@ export class SupplierInfoComponent implements OnInit { // }; let datas = data.records; this.initFormLoadDetails(datas.type_of_activity); + this.m_manufacturingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 2 ){return data}}).map(data=> [...data.prodcuts]); + // this.m_tradingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 3){return data}}).map(data=> [...data.prodcuts]); + + let api = Object.keys(datas.type_of_activity).map(function (key) { + return datas.type_of_activity[key]; + }); + if(api.length > 0){ + api.forEach(val => { + if (val.type_of_activity_id == 3) { + if(val.prodcuts){ + this.m_tradingProducts.push(val.prodcuts); + } + } + + if (val.type_of_activity_id == 4) { + if(val.prodcuts){ + this.m_tradingProducts.push(val.prodcuts); + } + } + }); + } + this.m_tradingProducts = [].concat.apply([], this.m_tradingProducts); + }else { this.notifier.notify('warning', 'No Category Records Found.!'); this.noRecordsFound = false;