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 494caa4a8..264e07082 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 @@ -113,10 +113,10 @@
- + - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts index 3800fb290..b622d1efd 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts @@ -507,4 +507,13 @@ export class AddressComponent implements OnInit { this.addressForm.controls.business_month.setValue(Math.floor(converted_month)); } + /** On Key Press Event For Numbers */ + keyPress(event: any) { + const pattern = /[0-9]/; + + let inputChar = String.fromCharCode(event.charCode); + if (event.keyCode != 8 && !pattern.test(inputChar)) { + event.preventDefault(); + } + } } \ No newline at end of file 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 ac5031bb1..d2346740d 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 @@ -6,7 +6,6 @@
-
@@ -35,265 +34,211 @@
- + +
-
-
- +
+ + {{ prop.name }} -
-
- + + - +
-
- + +
-
-
- +
+
-
- + +
-
-
- +
+
-
- + +
-
-
- +
+
-
+
-
-
- + + -
-
- + + {{ freqn.name }} -
-
- + + + + +
+ +
+ -
-
-
-
- + + -
-
+
-
- + {{ ins_type.name }} -
-
- - + + -
-
- + -
-
- + -
-
-
-
- +
+ - +
+
+ - + - {{d.viewValue}} - + {{data.viewValue}} - - +
-
- - -
-
-
- - - -
-
-
-
- - - -
- - - {{owner.applicant_name}} +
+ + + {{"₹"}} {{appxMarketAmtInwords[i]}} Only + + + + + +
+ - - -
-
- - - -
-
- - - - {{relations.name}} - - - -
--> - -
-
-
+
-
- + + Yes No -
-
- - + + + + {{"₹"}} {{emiAmtInwords[i]}} Only -
-
- + + -
-
- + + -
-
- + + - +
-
-
+
-
+ -
+
@@ -316,358 +261,301 @@
- +
- - -
-
-
- - -
-
- - - {{ asset.name }} - - -
- -
- -
-
-
-
-
- - - {{ prop.name }} - - -
-
- - - -
-
-
-
-
- -
-
-
-
-
- - - -
-
-
-
-
- -
-
-
-
-
- - - -
-
-
-
-
- - - -
-
-
-
-
- - - -
-
-
-
-
- -
-
-
-
-
- -
- - - -
-
- - - {{ freqn.name }} - - -
-
- - - -
-
-
-
- - - -
-
-
-
-
-
- -
-
-
-
-
-
- - - {{ ins_type.name }} - - -
- -
- - - -
- -
- - - -
-
-
-
- - - -
-
-
-
-
-
- -
-
-
-
-
- - - - - - - - - - {{owner.applicant_name}} + + +
+
+
+ + +
+
+ + + {{ asset.name }} + + +
+ +
+ +
+
+
+
+ + + {{ prop.name }} + + + + + +
+
+
+
+ +
+
+
+
+ + + +
+
+
+
+ +
+
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+ + + +
+
+
+
- - -
- - - + +
+
+
+
+ + + + + + {{ freqn.name }} + + + + + +
+ +
+ + + + + + + + +
+
+
+
+ + +
+
+
+
+
+ + + + {{ ins_type.name }} + + + + + + + + + + + +
+
+ + + +
+
+
+
+
+ + +
+ +
+
+
+ + + +
+
+ + + + + + {{owner.applicant_name}} + + + + + + +
+
+ + + + {{relations.name}} + + + + + + + + + + {{data.viewValue}} + + + + + + + + + +
+
+
+
+
+ +
+ + + {{"₹"}} {{OtherAppxMarketAmtInwords[i]}} Only + + + + + {{owner.applicant_name}} + + + + + + + + + + + {{relations.name}} + + + +
+ +
+ + + + Yes + No + + + + + + {{"₹"}} {{OtherEmiAmtInwords[i]}} Only + + + + + + + + + + + + + + +
+
+
+
+ + + +
+
+ + + +
+
+
+ +
+ +
+ + + + + +
-
- - - - {{relations.name}} - - - -
- - - - - - {{d.viewValue}} - - - - - - - - - -
-
-
-
-
- - -
-
- - - -
-
-
- - -
- - - - {{owner.applicant_name}} - - - -
-
- - - -
-
- - - - {{relations.name}} - - - -
-
- - -
-
-
- - - Yes - No - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - - -
-
-
-
-
- - - -
-
-
-
-
-
-
-
- -
- -
- -
- - - -
-
-
-
+
- +
@@ -762,7 +650,7 @@
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.scss index 8acfd1d59..adab2065d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.scss @@ -11,7 +11,7 @@ mat-form-field { margin: 0 2%; - } + } $base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important; $product-bg-color-hover: rgba(103, 58, 183, 0.7); .p-list-main { 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 f1cd2ec9d..e6ddfeeb3 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 @@ -43,6 +43,10 @@ export class AssetsInfoComponent implements OnInit { public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"}, {'value': "no",'viewValue': "No"}, {'value': "nan",'viewValue': "NA"}] + appxMarketAmtInwords : any = []; + OtherAppxMarketAmtInwords : any = []; + emiAmtInwords : any = []; + OtherEmiAmtInwords : any = []; // public m_assets_type = [ // { // 'id': "1", @@ -507,6 +511,7 @@ public m_investmentType = []; //insurance_type: [''], premium_paid: [''], frequency_mode: [''], + other_frequency_mode:[''], sum_assured: [''], members_coverd: [''] }); @@ -582,6 +587,7 @@ public m_investmentType = []; //insurance_type: [data.insurance_type], premium_paid: [data.premium_paid], frequency_mode: [data.frequency_mode], + other_frequency_mode:[data.other_frequency_mode], sum_assured: [data.sum_assured], members_coverd: [data.members_coverd] }); @@ -958,14 +964,23 @@ public m_investmentType = []; } - // { - // 'main_raw_materials': 'sdkjfal', - // 'supplier_details' ; [ - // { - // 'supplier_name':'ldskjfalks', - // 'payment_mode': '1', - // 'payment_mode_value':'' - // } - // ] - // } +/** Amount InWords */ +inWords(e,i,flag){ + switch(flag){ + case 1 : + this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 2 : + this.OtherAppxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 3 : + this.emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 4 : + this.OtherEmiAmtInwords[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/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 7da90f6ca..5f49171f5 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 @@ -95,25 +95,22 @@ - - + {{owner.applicant_name}} - - - + + + + --> + + --> @@ -121,13 +118,13 @@ - - + {{ prop.name }} - - - - Yes - No - NA - - - - - - + - - Yes - No - + + Yes + No + + +
+ + + Yes + No + NA + + + + + + {{"₹"}} {{amtInwords[i]}} Only + +
+ -->

- + - +
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts index d80b9fcfd..6eba35463 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts @@ -38,6 +38,10 @@ export class BankingDetailsComponent implements OnInit { m_accountType= []; m_btLenderList = []; salaryField : boolean; + OtherFlag : any = []; + limitCaseFlag : any = []; + amtInwords : any = []; + emiAmtInwords : any = []; constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, @@ -99,7 +103,12 @@ export class BankingDetailsComponent implements OnInit { if (result.length == 0) { control.push(this.createBankarray()); } else { - result.forEach(datas => { + result.forEach((datas,index) => { + this.amtInwords[index] = this._pd.convertNumberToWords(datas.limit); + this.selectedBorrower(datas.applicant_name,index); + this.selectedAccTypeChanges(datas.account_type,index) + + // this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi); control.push(this.createBankarray()); }); this.bankingForm.controls.itemRows.setValue(result); @@ -210,31 +219,58 @@ export class BankingDetailsComponent implements OnInit { }); } - selectedAccTypeChanges(event: any){ - // console.log('First Time',event); - // console.log('First Time Value',event.value); - if(event.value == 2) { + selectedBorrower(e,i){ + if(e == 0){ + this.OtherFlag[i] = true; + } + else{ + this.OtherFlag[i] = false; + } + } + + selectedAccTypeChanges(event: any,i){ + + if(event == 2 || event == 1) { + this.limitCaseFlag[i] = false; + const control = this.bankingForm.controls['itemRows']; - // console.log('Inside If Condition'); - // console.log(control); - // console.log(control.controls); - + control.controls[0].get('limit').clearValidators(); control.controls[0].get('limit').updateValueAndValidity(); - - //this.loanDetailsForm.controls['is_topup'].setValidators([Validators.required]); - // this.bankingForm.controls['itemRows']. - // this.bankingForm.controls.get('limit').clearValidators(); - // this.bankingForm.controls.itemRows['controls'].get('limit').updateValueAndValidity(); - // const control = this.bankingForm.controls['itemRows']; - // console.log(control.controls['limit'].value); } else{ - //alert('sd'); + this.limitCaseFlag[i] = true; } } + /** To Convert Month into Year */ + ConvertMonthintoYear(itemrow,e){ + //console.log(itemrow); + + let year = itemrow.controls.vintage_year.value; + + let converted_month : number = e%12; + let converted_year : number = e/12; + + itemrow.controls.vintage_year.setValue(+year + +Math.floor(converted_year)); + itemrow.controls.vintage_month.setValue(Math.floor(converted_month)); + + } + + /** Amount InWords */ + inWords(e,i,flag){ + switch(flag){ + case 1 : + this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 2 : + this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); + break; + default: + break; + } + } /** On Key Press Event For Numbers */ keyPress(event: any) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html index cd2bf8ef3..6687cb32d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html @@ -30,7 +30,7 @@ -

Loan Details

+

Loan Details

- + + {{"₹"}} {{amtInwords[i]}} Only {{freq.name}} - - + + + + + + {{"₹"}} {{emiAmtInwords[i]}} Only @@ -56,16 +61,18 @@ - + - + {{owner.applicant_name}} - - + + + + @@ -73,17 +80,19 @@ - + - +
+ - + +
+
+
+ Is Person Met +
+
+ Is Applicant +
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.scss index eee866396..f60049606 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.scss @@ -4,4 +4,11 @@ } mat-form-field { margin: 0 2%; + } + .example-section { + height: 120px; + } + + .example-margin { + margin: 0 10px; } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts index a9c990c53..07281be5a 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts @@ -8,9 +8,9 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angul styleUrls: ['./other-applicant-details.component.scss'] }) export class OtherApplicantDetailsComponent implements OnInit { - pageTitle: string ="Add Other Applicant Details"; + pageTitle: string ="Add Individual Details"; public _OtherForm: FormGroup; - applicantInfo:any={'pd_co_applicant_id':"0",'applicant_name':'','company_name':''}; + applicantInfo:any={'pd_co_applicant_id':"0",'applicant_name':'','is_applicant':false,'is_person_met':false}; constructor(private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef) { } @@ -30,7 +30,8 @@ createApplicant(elementValue:any){ return this._fb.group({ pd_co_applicant_id: [elementValue.pd_co_applicant_id], applicant_name: [elementValue.applicant_name, Validators.required], - //company_name:[elementValue.company_name] + is_applicant:[false], + is_person_met:[false], }); } 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 10d70f253..a2237aab1 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 @@ -9,47 +9,96 @@
- - - Name of Person Met - + + + + Individuals + -
-
- {{applicant.controls.applicant_name.value}} -
-
+ + + Name + + {{details.value.applicant_name | titlecase}} + + + + Is Person Met + + + + + + Is Applicant + + + + + + + + + + + +
- +
+ - - - Applicant Details - - -
+ + + + Companies + + +
+
+ + + + + +
+
+
+
+ + + +
- {{relation.controls.applicant_name.value | titlecase}} + {{relation.controls.applicant_name.value | titlecase}} +

Personal Relationship

- + Select - + - {{rel | titlecase}} + {{rel.applicant_name | titlecase}} - + Select @@ -57,50 +106,46 @@ - +
-
-
- - - - - - Select - - {{comrelShip.name | titlecase}} - - - - - -
-
+
+

Company Relationship

+
+
+ + + Select + + {{comp.company_name | titlecase}} + + + + + + Select + + {{comrelShip.name | titlecase}} + + + + + +
+
- - - -
- - - - - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss index 448028b25..800c2d35e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss @@ -11,4 +11,16 @@ } mat-form-field { margin: 0 2%; - } \ No newline at end of file + } + + mat-header-cell mat-cell { + display:flex; + justify-content:flex-end; + } + .table-checkbox { + margin-left: 15% !important; + } + .p-text { + color:#e00201 !important; + font-weight: bold; + } \ No newline at end of file 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 6e38f395d..5cd6e6e98 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 @@ -1,6 +1,6 @@ import { Component, OnInit, Input, Output, Inject } from '@angular/core'; import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; -import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , MatTableDataSource} from '@angular/material'; import { NotifierService } from 'angular-notifier'; import { PdTrigerService } from './../../../../../pd-service/pd-triger.service'; import {OtherApplicantDetailsComponent} from './../dialogue/other-applicant-details/other-applicant-details.component'; @@ -15,11 +15,15 @@ export class GeneralInfoComponent implements OnInit { form_id:number; private notifier: NotifierService; public _generalForm: FormGroup; + displayedColumns = ['applicant_name','is_person_met','is_applicant']; + public individualsSource= new MatTableDataSource(); public pd_applicants_details: any; relationShipList:any=[]; companyRelationShipList:any=[]; errorMessage:any; - fetch_related_details:any=[]; + individualsList: any=[]; + companyList: any=[]; + constructor(notifier: NotifierService,private _fb: FormBuilder,private _pd: PdTrigerService , private dialog: MatDialog, @Inject(MAT_DIALOG_DATA) public pd_all_details: any,) { this.pdid = this.pd_all_details.pdmaster_details.pd_id; @@ -34,6 +38,17 @@ export class GeneralInfoComponent implements OnInit { this.initFormDetails(); this.getMasterDetails('RELATIONSHIPS',1); this.getMasterDetails('COMPANYRELATIONSHIPS',2); + // update data source table when change the individuals details + this._generalForm.controls['individuals'].valueChanges.subscribe(val=>{ + let control = this._generalForm.controls['individuals']; + this.individualsSource.data =control.controls; + this.individualsList = control.value.filter(element =>element.is_applicant===true); + }); + // update company details + this._generalForm.controls['companies'].valueChanges.subscribe(val=>{ + let control = this._generalForm.controls['companies']; + this.companyList = control.value.filter(element =>element.company_name); + }); } // init form @@ -41,8 +56,9 @@ export class GeneralInfoComponent implements OnInit { this._generalForm = this._fb.group({ pdid:this.pdid, formid:this.form_id, - applicant_list: this._fb.array([]), applicant_relation: this._fb.array([]), + individuals: this._fb.array([]), + companies: this._fb.array([]), general_remark:'' }); this.loadFormData(); @@ -68,96 +84,122 @@ export class GeneralInfoComponent implements OnInit { let params: any = {}; params.pd_id = this.pdid; params.pd_form_id = '18'; - let applicantControl = this._generalForm.controls['applicant_list']; + let individualsControl = this._generalForm.controls['individuals']; + let companyControl = this._generalForm.get('companies') as FormArray; let relationControl = this._generalForm.controls['applicant_relation']; - applicantControl.controls = []; + individualsControl.controls = []; relationControl.controls = []; - let exist_data:any; - let exist_applicant_relation:any; + companyControl.controls = []; + let exist_individuals:any; + let exist_companies:any; + let exist_relation:any; this._pd.retriveForm(params).subscribe(data => { if(data.dataStatus) { this._generalForm.controls['general_remark'].setValue(data.records.general_remark ? data.records.general_remark : ''); + + // create individuals + exist_individuals=Object.keys(data.records.individuals).map(function(key) { + return data.records.individuals[key]; + }); - exist_data=Object.keys(data.records.selected_applicant).map(function(key) { - return data.records.selected_applicant[key].pd_co_applicant_id; - }); - exist_applicant_relation = Object.keys(data.records.applicant_relation).map(function(key) { - return data.records.applicant_relation[key]; + if(exist_individuals.length>0){ + exist_individuals.forEach(element => { + individualsControl.push(this.createIndividulas(element)) }); + } + // create companies + exist_companies = Object.keys(data.records.companies).map(function(key) { + return data.records.companies[key]; + }); + if(exist_companies.length>0){ + exist_companies.forEach(element => { + companyControl.push(this.createCompanies(element)) + }); + } + + // create relations + exist_relation = Object.keys(data.records.applicant_relation).map(function(key) { + return data.records.applicant_relation[key]; + }); + if(exist_relation.length>0){ + exist_relation.forEach((element,index) => { + relationControl.push(this.createApplicantRelation(element)); + let innerrelControl:any = relationControl.controls[index].get('multiple_relation') as FormArray; + element.multiple_relation.forEach((innereElement) => { + innerrelControl.push(this.createMultipleRelation(innereElement)); + }); + let innercomrelControl:any = relationControl.controls[index].get('multiple_company_relation') as FormArray; + element.multiple_company_relation.forEach((innerecomElement) => { + innercomrelControl.push(this.createMultipleCompanyRelation(innerecomElement)); + }); + }); + + + + + + } + } else { - exist_data=[]; - exist_applicant_relation=[]; - } - //find exist and non-exist applicant details - let actual_applicant = this.pd_applicants_details.map(item => item.pd_co_applicant_id); - let checkApplicantExist =actual_applicant.map((id, index) => { - if (exist_data.indexOf(id) < 0) { - this.pd_applicants_details[index].exist_status=0; - return this.pd_applicants_details[index]; - } - else{ - this.pd_applicants_details[index].exist_status=1; - this.pd_applicants_details[index].applicant_relation_to=''; - this.pd_applicants_details[index].relation=''; - return this.pd_applicants_details[index]; - } - }).filter(item => item != undefined); + this.pd_applicants_details.forEach((element,key) => { + element.is_applicant=true; + element.is_person_met=false; + element.individuals_order_id = key+1 + individualsControl.push(this.createIndividulas(element)); + let relationControl = this._generalForm.controls['applicant_relation']; + let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name, 'individula_order_id':relationControl.controls.length+1}; + relationControl.push(this.createApplicantRelation(applicant_details)); + let mulRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_relation'); + mulRelationControl.push(this.createMultipleRelation(applicant_details)) + let mulCmyRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation'); + mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details)) + + // create companies + if(element.company_name!='' && element.company_name!=null){ + let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:element.company_name} + companyControl.push(this.createCompanies(setCompanyValues)) + } + }); + // check company if null update one row + if(companyControl.controls.length ==0){ + let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:''} + companyControl.push(this.createCompanies(setCompanyValues)) - if(checkApplicantExist.length > 0) - { - checkApplicantExist.forEach(val => { - applicantControl.push(this.createApplicant(val)); - }); - - } - if(exist_applicant_relation.length > 0){ - exist_applicant_relation.forEach((val,key) => { - let control: any = this._generalForm.get('applicant_relation') as FormArray; - control.push(this.createApplicantRelation(val)); - control = control.controls[key].get('multiple_relation') as FormArray; - val.multiple_relation.forEach((firstInnerelement,firstInnerKey) => { - control.push(this.createMultipleRelation(firstInnerelement)); - let innerControl = this._generalForm.get('applicant_relation') as FormArray; - innerControl = innerControl.controls[key].get('multiple_relation') as FormArray; - innerControl = innerControl.controls[firstInnerKey].get('multiple_company_relation') as FormArray; - firstInnerelement.multiple_company_relation.forEach((secondInnerValue,secondInnerKey) => { - innerControl.push(this.createMultipleCompanyRelation(secondInnerValue)) - }); - - }); - //push related to details - this.fetch_related_details.push(val.applicant_name); - }); - } + } + } }, error => this.errorMessage = error); } + // create individuals + createIndividulas(elementValue:any) { + return this._fb.group({ + pd_co_applicant_id: [elementValue.pd_co_applicant_id], + applicant_name: [elementValue.applicant_name], + is_applicant:[elementValue.is_applicant], + is_person_met:[elementValue.is_person_met], + individuals_order_id: [elementValue.individuals_order_id], + }); + } + // create companies + createCompanies(elementValue:any) { + return this._fb.group({ + company_order_id: [elementValue.company_order_id], + company_name: [elementValue.company_name,Validators.required], + }); + } - // check and uncheck function - checkboxChange(event, index, item) { - if(item.exist_status.value){ - let relationControl: any = this._generalForm.controls['applicant_relation']; - let applicant_details: any= {'pd_co_applicant_id':item.pd_co_applicant_id.value,'applicant_name':item.applicant_name.value,'applicant_relation_to':'','relation':'','company_name':item.company_name.value,'company_relation':''}; - relationControl.push(this.createApplicantRelation(applicant_details)); - relationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_relation'); - relationControl.push(this.createMultipleRelation(applicant_details)) - relationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation'); - relationControl.push(this.createMultipleCompanyRelation(applicant_details)) - // to push selected persons names - this.fetch_related_details.push(item.applicant_name.value); + // add more companies + addMoreCompanies() { + let control: any = this._generalForm.get('companies') as FormArray; + let setValues: any = {company_order_id :control.controls.length+1,company_name:''} + control.push(this.createCompanies(setValues)) + } - } - else { - if(item.pd_co_applicant_id.value!=0){ - let relationControl = this._generalForm.controls['applicant_relation']; - let pos_id = relationControl.value.map(e=> e.pd_co_applicant_id).indexOf(item.pd_co_applicant_id.value); - relationControl.removeAt(pos_id); - // remove related to details - let pos_name=this.fetch_related_details.indexOf(item.applicant_name.value); - this.fetch_related_details.splice(pos_name, 1); - } - } + // remove companies + removeCompanies(indexValues) { + let control: any = this._generalForm.get('companies') as FormArray; + control.removeAt(indexValues); } // create applicant form array @@ -176,14 +218,15 @@ export class GeneralInfoComponent implements OnInit { pd_co_applicant_id: [elementValue.pd_co_applicant_id], applicant_name: [elementValue.applicant_name], multiple_relation: this._fb.array([]), + multiple_company_relation : this._fb.array([]), + individuals_order_id:[elementValue.individuals_order_id] }); } // create multiple relation details createMultipleRelation(elementValue: any) { return this._fb.group({ - applicant_relation_to: [elementValue.applicant_relation_to, Validators.required], + applicant_relation_to: [elementValue.applicant_relation_to], relationship: [elementValue.relationship], - multiple_company_relation : this._fb.array([]), }); } @@ -193,9 +236,6 @@ export class GeneralInfoComponent implements OnInit { control = control.controls[rindex].get('multiple_relation') as FormArray; let setValues: any = {applicant_relation_to :'',relationship:''} control.push(this.createMultipleRelation(setValues)) - let setCompanyValue = {company_name :'',company_relationship:''}; - control = control.controls[control.controls.length-1].get('multiple_company_relation'); - control.push(this.createMultipleCompanyRelation(setCompanyValue)) } // remove relation @@ -208,29 +248,27 @@ export class GeneralInfoComponent implements OnInit { // create multiple company relation createMultipleCompanyRelation(elementValue: any) { return this._fb.group({ - company_name: [elementValue.company_name,elementValue.company_name ? Validators.required : Validators.nullValidator], + company_name: [elementValue.company_name,Validators.required], company_relationship: [elementValue.company_relationship], }); } // add more company relation - addMoreCompanyRelation(rindex,mindex,cindex) { + addMoreCompanyRelation(rindex,cindex) { let control: any = this._generalForm.get('applicant_relation') as FormArray; - control = control.controls[rindex].get('multiple_relation') as FormArray; - control = control.controls[mindex].get('multiple_company_relation') as FormArray; + control = control.controls[rindex].get('multiple_company_relation') as FormArray; let setValues: any = {company_name :'',company_relationship:''} control.push(this.createMultipleCompanyRelation(setValues)) } // remove company relation - removeCompanyRelation(rindex,mindex,cindex) { + removeCompanyRelation(rindex,cindex) { let control: any = this._generalForm.get('applicant_relation') as FormArray; - control = control.controls[rindex].get('multiple_relation') as FormArray; - control = control.controls[mindex].get('multiple_company_relation') as FormArray; + control = control.controls[rindex].get('multiple_company_relation') as FormArray; control.removeAt(cindex); } - // add more applicant details - addOtherApplicant() { + // add more individuals details + addMoreIndividuals() { const dialogRef = this.dialog.open(OtherApplicantDetailsComponent, { data: '', width:'40%', @@ -240,15 +278,16 @@ export class GeneralInfoComponent implements OnInit { .subscribe(dataresult => { if(dataresult.data.length>0){ dataresult.data.forEach(element => { + let individualsControl = this._generalForm.controls['individuals']; + element.individuals_order_id = individualsControl.controls.length+1; + individualsControl.push(this.createIndividulas(element)); let relationControl = this._generalForm.controls['applicant_relation']; - let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','company_name':element.company_name,'company_relation':''}; + let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','company_name':'','company_relation':'','individuals_order_id':element.individuals_order_id}; relationControl.push(this.createApplicantRelation(applicant_details)); - relationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_relation'); - relationControl.push(this.createMultipleRelation(applicant_details)) - relationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation'); - relationControl.push(this.createMultipleCompanyRelation(applicant_details)) - // push related to details - this.fetch_related_details.push(element.applicant_name); + let mulRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_relation'); + mulRelationControl.push(this.createMultipleRelation(applicant_details)) + let mulCmyRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation'); + mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details)) }); } @@ -256,17 +295,11 @@ export class GeneralInfoComponent implements OnInit { } - - // remove other details - removeOthers(index, item: any){ - if(item.pd_co_applicant_id==0){ - let relationControl = this._generalForm.controls['applicant_relation']; - relationControl.removeAt(index); - // remove related to details - let pos_name=this.fetch_related_details.indexOf(item.applicant_name); - this.fetch_related_details.splice(pos_name, 1); - } - } + // remove individuals + removeIndividuals(findex,order_id){ + let control = this._generalForm.controls['individuals']; + control.removeAt(findex); + } // submit form details submitGeneralForm(formData:any) { @@ -280,34 +313,12 @@ export class GeneralInfoComponent implements OnInit { } else{ let saveRecords:any = {} - let applicantList:any=[]; - let applicantRelationList:any=[]; - // this for applicant list for selected - formData.applicant_list.forEach((element,key) => { - if(element.exist_status==1){ - applicantList.push({ - "pd_co_applicant_id":element.pd_co_applicant_id, - "applicant_name":element.applicant_name, - }) - } - }); - // this is for selected applicant relation - // formData.applicant_relation.forEach((element,key) => { - // applicantRelationList.push({ - // "pd_co_applicant_id":element.pd_co_applicant_id, - // "applicant_name":element.applicant_name, - // "company_name":element.company_name, - // "company_relationship":element.company_relationship, - // "applicant_relation_to":element.applicant_relation_to, - // "relationship":element.relationship, - // }) - // }); - saveRecords.pdid=formData.pdid; saveRecords.formid=formData.formid; - saveRecords.general_remark=formData.general_remark; - saveRecords.selected_applicant=applicantList; + saveRecords.individuals=formData.individuals; + saveRecords.companies=formData.companies; saveRecords.applicant_relation=formData.applicant_relation; + saveRecords.general_remark=formData.general_remark; this._pd.savePDFormDetailsWithID(saveRecords).subscribe( dataresult => { if (dataresult.status == 200) { @@ -324,6 +335,7 @@ export class GeneralInfoComponent implements OnInit { }); } } + // validate all form group and form array fields validateAllFormFields(formGroup: any) { 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 d137527b2..9b8fbcc65 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 @@ -1,6 +1,7 @@

-
+ +
{{pageTitle}} @@ -9,7 +10,7 @@
-
+

@@ -17,6 +18,7 @@ +
{{types.type_name}} @@ -27,17 +29,17 @@ - + - + Yes No - + @@ -54,23 +56,24 @@ - - + + - + Enter Valid Mobile Number. - - - Enter Valid STD Code. - - + + + +91 + Enter Valid STD Code. + - - + Enter Valid Landline Number. - + @@ -82,17 +85,18 @@ - +

Period of Relationship

- - + + - + - + + {{"₹"}} {{amtInwords[r]}} Only @@ -102,6 +106,23 @@ + + + + + + + Select + + {{remark.name}} + + + + + + + + @@ -122,7 +143,7 @@
Remarks - +
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 ce94b7288..77e17bc98 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 @@ -16,12 +16,16 @@ export class NeighbourHoodComponent implements OnInit { form_id:number; private notifier: NotifierService; check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference Check'}] - default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':''}; + default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':'','reference_final_remarks':'','positive_remark':'','negative_remark':'','insufficient_info_remark':''}; default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know':'','is_applicant_owner':''}; busineesRelationshipList:any=[]; volumeunitList:any=[]; errorMessage:any; + finalRemarksList : any = [{'id': 1,'name': "Positive"}, + {'id': 2,'name': "Negative"}, + {'id': 3,'name': "Insufficient information provided"}]; + amtInwords : any = []; constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,) { this.pdid = this.data.pdmaster_details.pd_id; this.notifier = notifier; @@ -90,7 +94,8 @@ export class NeighbourHoodComponent implements OnInit { }); } else if(exist_ref_details.length>0 && data.records.check_type==1){ - exist_ref_details.forEach(element => { + exist_ref_details.forEach((element,index) => { + this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount); referencecheckControl.push(this.createReerenceCheck(element)); }); } @@ -143,6 +148,12 @@ export class NeighbourHoodComponent implements OnInit { months_relation_applicant:[elementValue.months_relation_applicant,Validators.required], business_volume_amount:[elementValue.business_volume_amount,Validators.required], business_volume_unit:[elementValue.business_volume_unit, Validators.required], + others_unit : [elementValue.others_unit], + reference_final_remarks:[elementValue.reference_final_remarks], + specify_final_remark : [elementValue.specify_final_remark], + // positive_remark:[elementValue.positive_remark], + // negative_remark:[elementValue.negative_remark], + // insufficient_info_remark:[elementValue.insufficient_info_remark] }); } @@ -229,6 +240,12 @@ export class NeighbourHoodComponent implements OnInit { "months_relation_applicant":element.months_relation_applicant, "business_volume_amount":element.business_volume_amount, "business_volume_unit":element.business_volume_unit, + "others_unit":element.others_unit, + "reference_final_remarks":element.reference_final_remarks, + "specify_final_remark":element.specify_final_remark + // "positive_remark":element.positive_remark, + // "negative_remark":element.negative_remark, + // "insufficient_info_remark":element.insufficient_info_remark }) }); saveRecords.referencecheck_list=referencecheck_list; @@ -268,7 +285,26 @@ validateAllFormFields(formGroup: any) { this.validateAllFormFields(control); } }); -} +} + + /** To Convert Month into Year */ + ConvertMonthintoYear(itemrow,e){ + // console.log(itemrow); + // console.log(e); + let year = itemrow.controls.year_relation_applicant.value; + + let converted_month : number = e%12; + let converted_year : number = e/12; + + itemrow.controls.year_relation_applicant.setValue(+year + +Math.floor(converted_year)); + itemrow.controls.months_relation_applicant.setValue(Math.floor(converted_month)); + +} + + /** Amount InWords */ + inWords(e,i){ + this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value); +} } 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 14f8677f1..71273a104 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 @@ -31,32 +31,34 @@ -

Income Details

+

Income Details

- + - Rental Income + {{src.name}} + - - + - - + + + {{"₹"}} {{amtInwords[i]}} Only - + {{frq.name}} @@ -64,8 +66,8 @@ - - + @@ -83,7 +85,7 @@
- +
@@ -196,7 +198,7 @@
Remarks - +
@@ -241,7 +243,7 @@ --> - + @@ -261,7 +263,7 @@ - + @@ -289,12 +291,12 @@