From b7617d9aa0329f240dd06eb7e3fea458afa8b08e Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Thu, 7 Mar 2019 10:23:58 +0530 Subject: [PATCH] segment issues fixed : ps --- .../list-pd/add-pd/add-pd.component.ts | 5 +- .../edit-pd-master.component.ts | 3 +- .../employment-info.component.html | 27 +++++++++-- .../employment-info.component.ts | 48 +++++++++++++++++++ .../financial-info.component.html | 32 ++++++------- .../other-income/other-income.component.html | 2 +- .../other-income/other-income.component.ts | 2 +- 7 files changed, 93 insertions(+), 26 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index ac9f34561..b49203d34 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -165,11 +165,12 @@ export class AddPdComponent implements OnInit, OnDestroy { //get sub product list based on prokduct id getSubproductList(productID: string) { + console.log('productID',productID); this.subProductList = this.productList.filter(item => item.product_id == productID); this.subProductList = this.subProductList[0].subproducts; this.subProductList = this.subProductList.filter(item => item.is_others == 0); - this.customerSegmentList = (productID != '4') ? (this.customerSegmentAllList, this._PDtriggerForm.controls['fk_subproduct_id'].setValue('')) - : (this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')), this._PDtriggerForm.controls['fk_subproduct_id'].setValue('')); + this.customerSegmentList = (productID != '4')?this.customerSegmentAllList:this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')); + if(productID != '4'){this._PDtriggerForm.controls['fk_subproduct_id'].setValue('')} } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts index 315ad5f30..776528167 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts @@ -230,6 +230,7 @@ export class EditPdMasterComponent implements OnInit { this.subProductList= this.productList.filter(item => item.product_id == productID); this.subProductList=this.subProductList[0].subproducts; this.customerSegmentList=(productID != '4')?this.customerSegmentAllList:this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')); + // this.customerSegmentList = (productID != '4')?this.customerSegmentAllList:(this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')),this._EditPDtriggerForm.controls['fk_subproduct_id'].setValue('')); } @@ -442,7 +443,7 @@ export class EditPdMasterComponent implements OnInit { "pd_contact_mobileno": my_array.pd_contact_mobileno, "pd_contact_landline": concat_landline, "fk_product_id": my_array.fk_product_id, - "fk_subproduct_id": my_array.fk_subproduct_id, + "fk_subproduct_id": my_array.fk_product_id != '4' ? my_array.fk_subproduct_id : '', "fk_pd_type": my_array.fk_pd_type, "fk_customer_segment": my_array.fk_customer_segment, "loan_amount": my_array.loan_amount, diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html index bf5383f5d..3ca864c5b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html @@ -18,17 +18,21 @@ - + + + Select + {{ cl.company_name }} +

- + - +
@@ -42,10 +46,23 @@
- + + + Select + + {{person.applicant_name | titlecase}} + + +
@@ -83,7 +100,7 @@
- + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.ts index 8b799ce04..c7d4c40e7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.ts @@ -43,6 +43,11 @@ export class EmploymentInfoComponent implements OnInit { private notifier: NotifierService; public pd_cus_segment:string; public frequency_data:any[]; + public company_list:any[]; + public person_met_list:any[]; + public company_related_applicants_list:any[]; + public company_relationship_list:any[]; + public filtered_company_relationship_list:any[]; constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, @@ -78,11 +83,26 @@ export class EmploymentInfoComponent implements OnInit { } }; ngOnInit() { + console.log('clear'); + console.clear(); this.pd_cus_segment=this.pd_all_details.pdmaster_details.customer_segment_abbr.toUpperCase(); this.initemploymentForm(); let params: any = {}; params.pd_id = this.pdid; params.pd_form_id = this.form_id; + console.log('abcd'); + let param: any = {}; + param.pd_id = this.pdid; + param.pd_form_id = '18'; + this._pd.retriveForm(param).subscribe(data => { + if(data.dataStatus) { + console.log(data.records); + this.company_list = data.records.companies.filter(com=>com.is_active == true ); + this.person_met_list = data.records.individuals.filter(app=>app.is_person_met == true && app.is_active == true); + this.company_related_applicants_list = data.records.company_with_relationships; + } + }); + this._pd.retriveForm(params).subscribe(value => { if (value.status == 200) { this.employmentForm.controls['employer_name'].setValue(value.records.employer_name); @@ -120,7 +140,17 @@ export class EmploymentInfoComponent implements OnInit { this.frequency_data = this.frequency_data.filter(freq=>freq.isactive == 1 ); } }); + + this._pd.getAllMasterDatas('COMPANYRELATIONSHIPS').subscribe( + data => { + if (data.status == 200) { + this.company_relationship_list = data.records.filter(item => item.isactive == 1); + this.company_relationship_list = data.records.filter(item => item.name != 'Others'); + this.company_relationship_list.push({'company_relationship_id':0,'name':'Not Applicable'}); + } + }); } + public initemploymentForm(): void { this.employmentForm = this.fb.group({ employer_name: ['', Validators.compose([Validators.required])], @@ -141,10 +171,28 @@ export class EmploymentInfoComponent implements OnInit { bonus_type: [''], bonus_type_other: [''], any_delays: ['', Validators.compose([Validators.required])], + // employment_details: this.fb.array([]), employment_remarks: ['', Validators.compose([Validators.required])], }); } + filtercompanyrelationship(companyid,applicantid){ + var array = companyid.split("-"); + // console.log(array[0]); + // console.log('companyid',companyid); + // console.log('applicantid',applicantid); + let data = this.company_related_applicants_list.filter(freq=>freq.relation_to_company == array[0] &&freq.applicant_name == applicantid); + + if(data.length>0){ + + this.filtered_company_relationship_list = this.company_relationship_list.filter(freq=>freq.company_relationship_id == data[0].company_relationship ); + this.employmentForm.controls['designation_person_met'].setValue(this.filtered_company_relationship_list[0]['name'] +' '+array[1]); + } + else{ + this.employmentForm.controls['designation_person_met'].setValue(''); + } + } + ConvertMonthintoYear(e){ let how_long_year = this.employmentForm.controls.how_long_year.value; 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 2c34b0525..0841a8fe4 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 @@ -99,7 +99,7 @@
- + Net Profit @@ -277,17 +277,17 @@
@@ -302,14 +302,14 @@
{{"₹"}} {{AV_netProfitAmtFrmInwords[i]}} Only {{"₹"}} {{AV_netProfitAmtToInwords[i]}} Only @@ -320,7 +320,7 @@ {{"₹"}} {{AV_netProfitAmtInwords[i]}} Only @@ -330,16 +330,16 @@ + OnlyNumber type="text" (change)="calculateMarginLoss( i, details);"> + OnlyNumber type="text" (change)="calculateMarginLoss( i, details);"> @@ -352,14 +352,14 @@
{{"₹"}} {{AV_netLossAmtFrmInwords[i]}} Only {{"₹"}} {{AV_netLossAmtToInwords[i]}} Only @@ -370,7 +370,7 @@ + formControlName="estimate_net_loss" OnlyNumber type="text" readonly> {{"₹"}} {{AV_netLossAmtInwords[i]}} Only @@ -400,15 +400,15 @@ + formControlName="receive_the_money_in_days" OnlyNumber type="text"> + formControlName="pay_the_money_in_days" OnlyNumber type="text"> + formControlName="unsold_stock_lies_in_days" OnlyNumber type="text"> diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html index e6e369c8d..0e39034b8 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html @@ -59,7 +59,7 @@ - + Rental Info Details diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts index d691796aa..46af33780 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts @@ -243,7 +243,7 @@ public viewerOptions: any = { } Toview(){ - alert('Rental Info '); + // alert('Rental Info '); // const dialogRef = this.dialog.open(RentalInfoComponent, { // data: {} // });