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 8b262d4df..69fba04bc 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 @@ -225,14 +225,17 @@ export class EditPdMasterComponent implements OnInit { //get sub product list based on prokduct id getSubproductList(productID:string){ + this.customerSegmentList=this.customerSegmentAllList; + console.log('this.customerSegmentAllList',this.customerSegmentAllList); if(productID != '4'){ + console.log('if',this.customerSegmentList); this.subProductList= this.productList.filter(item => item.product_id == productID); this.subProductList=this.subProductList[0].subproducts; - this.customerSegmentList=this.customerSegmentAllList; } - else if(productID == '4'){ + if(productID == '4'){ let filtered = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')); this.customerSegmentList = filtered; + console.log('else',this.customerSegmentList); } } 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 25299b839..dda62f45a 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 @@ -3,7 +3,7 @@

- {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
+ {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
{{pageTitle}}
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 b09397b92..86650db26 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 @@ -2,7 +2,7 @@

- {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
+ {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
{{pageTitle}}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html index c48fae6ce..585038ad5 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html @@ -70,7 +70,7 @@

- {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
+ {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
{{pageTitle}}
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 6d7073527..0001c94c7 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 @@ -1,7 +1,7 @@

- {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
+ {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
{{pageTitle}}
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 e81c87134..a9fb6d8ea 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 @@ -295,7 +295,7 @@
Remarks - +
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 a1f2c4885..268ffdcfe 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 @@ -188,7 +188,7 @@ export class EmploymentInfoComponent implements OnInit { bonus_type_other: [''], any_delays: ['', Validators.compose([Validators.required])], // employment_details: this.fb.array([]), - employment_remarks: ['', Validators.compose([Validators.required])], + employment_remarks: [''], }); } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html index ace8290ba..05287358a 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html @@ -4,7 +4,7 @@
- {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
+ {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
{{pageTitle}}
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 0e39034b8..8319903d8 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 @@ -2,7 +2,7 @@

- {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
+ {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
{{pageTitle}}
@@ -63,16 +63,24 @@ - Select {{person.applicant_name}} Others + --> + + + + {{val.name}} + + - + 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 fc82ba2af..fdf9aaf7c 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 @@ -24,7 +24,7 @@ import { import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; import {ActivatedRoute, Router} from '@angular/router'; -import { RentalInfoComponent} from './../rental-info/rental-info.component'; +import { RentalVerificationComponent } from './../rental-verification/rental-verification.component'; @Component({ selector: 'app-other-income', @@ -53,6 +53,9 @@ export class OtherIncomeComponent implements OnInit { amtInwords : any = []; applicants : any = []; incomeEarnedBy : any = []; + existCompanyList: any =[]; + mergeCompanyApplicant: any=[]; + isIncomeEarnedBy: any=[]; // stringArr = []; constructor(notifier: NotifierService, @@ -65,13 +68,15 @@ export class OtherIncomeComponent implements OnInit { @Inject(MAT_DIALOG_DATA) public pd_all_details: any) { this.pdid = this.pd_all_details.pdmaster_details.pd_id; - this.applicants = this.pd_all_details.pdapplicants_detials; this.form_id = 9; this.notifier = notifier; this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant; - 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; + 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; + this.applicants = this.pd_all_details.pdapplicants_detials; + this.applicants = this.applicants.filter(val=>val.applicant_type==0 || val.applicant_type==1); + this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'}); } public viewerOptions: any = { @@ -94,7 +99,30 @@ public viewerOptions: any = { } }; ngOnInit() { - + this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ + if (data.dataStatus) { + this.existCompanyList = data.records.filter(val => val.is_active === true); + } + + // get company list + let modifyCompanyList: any = []; + if (this.existCompanyList.length > 0) { + modifyCompanyList = this.existCompanyList.map(element => { + return { id: element.company_order_id.toString(), name: element.company_name, group_id: 1 }; + }); + this.mergeCompanyApplicant.push({ groupName: 'COMPANIES', groupValues: modifyCompanyList }) + } + // get applicant list + let modifyApplicantList: any=[]; + if(this.applicants.length > 0){ + modifyApplicantList = this.applicants.map(element => { + return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2}; + }); + this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList}) + + } + + }) this.getFrequency(); this.getSourceOtherIncome(); this.initOtherincomeForm(); @@ -124,7 +152,21 @@ public viewerOptions: any = { if (result.length > 0) { result.forEach((val,index) => { this.amtInwords[index] = this._pd.convertNumberToWords(val.amount); + // this.getOtherIncomeEarnedBy(val.income_earned_by,index); control.push(this.createDetail()); + let Avaliablity = 1; + if(val.income_earned_by.length>0){ + val.income_earned_by.forEach(option => { + if(option.id == 0 && option.group_id == 2){ + Avaliablity = option.id; + } + }); + } + if(Avaliablity == 0){ + this.isIncomeEarnedBy[index] = true; + }else if(Avaliablity == 1){ + this.isIncomeEarnedBy[index] = false; + } }); this.otherIncomeForm.controls['income_details'].setValue(result); } else { @@ -183,9 +225,18 @@ public viewerOptions: any = { data.records.forEach(val => { if (val.isactive == 1) { - this.sourceData.push(val); + this.sourceData.push(val); } - }) + }) + if(this.customer_segment_abbr == 'SE-RI'){ + let inx = this.sourceData.map(data => data.name).indexOf("Rental Income") + /** -X- Please NOTE THIS : + * inx is '-1' -> this will remove the last item from array + * so that If Condition is given. */ + if (inx !== -1) { + this.sourceData.splice(this.sourceData.map(data => data.name).indexOf("Rental Income"), 1); + } + } }); } addIncomeDetails() { @@ -250,7 +301,7 @@ public viewerOptions: any = { // dialogRef.afterClosed() // .subscribe(dataresult => { // }); - const dialogRef = this.dialog.open(RentalInfoComponent, { + const dialogRef = this.dialog.open(RentalVerificationComponent, { data: this.pd_all_details, maxWidth: '100vw', maxHeight: '100vh', @@ -264,5 +315,43 @@ public viewerOptions: any = { }); } + + // compare objects for merge two master table details + compareObjects(o1: any, o2: any) { + if(o1.id == o2.id && o1.group_id == o2.group_id) + return true; + else return false + } + + getOtherIncomeEarnedBy(value,i) { + // console.log('value',value,'I',i); + let Ctrls = this.otherIncomeForm.controls['income_details']; + // console.log('ParCtrls',Ctrls); + let ChdCtrls:any = Ctrls.controls[i]; + // console.log('ChdCtrls',ChdCtrls); + let Avaliablity = 1; + console.log('val',value); + if(value.length>0){ + value.forEach(option => { + if(option.id == 0 && option.group_id == 2){ + Avaliablity = option.id; + } + }); + } + if(Avaliablity == 0){ + // console.log('if Avaliablity',Avaliablity); + ChdCtrls.controls.others_income_earned_by.setValidators([Validators.required]); + this.isIncomeEarnedBy[i] = true; + }else if(Avaliablity == 1){ + // console.log('else Avaliablity',Avaliablity); + // console.log('esle this.isIncomeEarnedBy[ParInx]',this.isIncomeEarnedBy[i]); + ChdCtrls.controls.others_income_earned_by.setValue(''); + ChdCtrls.controls.others_income_earned_by.clearValidators(); + this.isIncomeEarnedBy[i] = false; + // console.log('else this.isIncomeEarnedBy[ParInx]',this.isIncomeEarnedBy[i]); + } + + ChdCtrls.controls.others_income_earned_by.updateValueAndValidity(); +} } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html index e6bbb9a9e..e27dded56 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html @@ -4,7 +4,7 @@
- {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
+ {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
{{pageTitle}}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts index 8f716ffc3..15a112c9f 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts @@ -60,6 +60,7 @@ export class RentalVerificationComponent implements OnInit { } }; constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef) { + console.log('data',data); this.pdid = this.data.pdmaster_details.pd_id; this.notifier = notifier; this.form_id = 17;