From c6ea021dcaca9467d4cf0cb8195c884daa7ea439 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 31 Dec 2018 18:50:54 +0530 Subject: [PATCH 01/11] general form changes --- .../other-applicant-details.component.html | 14 +- .../other-applicant-details.component.scss | 7 + .../other-applicant-details.component.ts | 7 +- .../general-info/general-info.component.html | 151 ++++++---- .../general-info/general-info.component.scss | 14 +- .../general-info/general-info.component.ts | 282 +++++++++--------- 6 files changed, 282 insertions(+), 193 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html index ff4bce671..6dd57493a 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html @@ -11,9 +11,21 @@ - + + +
+
+ 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..bd017c6a6 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 Individuals 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..f27160506 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}} +

With Personel Relationships

- + Select - + - {{rel | titlecase}} + {{rel.applicant_name | titlecase}} - + Select @@ -63,44 +112,40 @@ delete
-
-
- - - - - - Select - - {{comrelShip.name | titlecase}} - - - - - -
-
+
+

With Company Relationships

+
+
+ + + 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) { From 5125209c6e22c62b71f5a0a59ce4b9998373f3a3 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 31 Dec 2018 18:51:23 +0530 Subject: [PATCH 02/11] merge : kms --- .../list-pd/add-pd/add-pd.component.html | 34 +- .../pd-report/pd-report.component.html | 7 +- .../list-pd/pd-report/pd-report.component.ts | 2 +- .../forms/address/address.component.ts | 9 +- .../assets-info/assets-info.component.html | 39 +-- .../assets-info/assets-info.component.ts | 161 ++++++---- .../financial-info.component.html | 300 +++++++++++------- .../financial-info.component.scss | 9 + .../financial-info.component.ts | 288 ++++++++++++++--- .../list-pd/view-pd/view-pd.component.html | 25 +- .../service/templates/templates.service.ts | 14 +- .../template-forms.component.html | 9 + .../template-forms.component.scss | 7 + .../template-forms.component.spec.ts | 25 ++ .../template-forms.component.ts | 77 +++++ .../edit/templates.edit.component.html | 6 + .../template/templates/templates.module.ts | 4 +- 17 files changed, 731 insertions(+), 285 deletions(-) create mode 100644 ng6-seed/src/app/template/templates/templates-list/edit/template-forms/template-forms.component.html create mode 100644 ng6-seed/src/app/template/templates/templates-list/edit/template-forms/template-forms.component.scss create mode 100644 ng6-seed/src/app/template/templates/templates-list/edit/template-forms/template-forms.component.spec.ts create mode 100644 ng6-seed/src/app/template/templates/templates-list/edit/template-forms/template-forms.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index 4188d4851..19ad95809 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -39,18 +39,18 @@ - + - + - + Enter Valid Mobile Number. @@ -108,23 +108,23 @@ - + {{"₹"}} {{loanAmtInWords}} Only Enter valid amount. - + @@ -156,7 +156,7 @@ - + Enter Valid Pincode. @@ -173,26 +173,26 @@ - + - + - + - + Enter Valid Mobile Number. - + +91 Enter Valid STD Code Number.   -   - + Enter Valid LandLine Number. @@ -207,7 +207,7 @@ - + @@ -234,7 +234,7 @@ - + @@ -261,7 +261,7 @@
- +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html index 7e165291b..34ebafa73 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html @@ -13,9 +13,10 @@
-
- Export - +
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts index 70a079cce..33e15c2d0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts @@ -266,7 +266,7 @@ export class PdReportComponent implements OnInit { console.log(blob); let datass = blob.headers.get('content-disposition'); let fileName = datass.split(/"/)[1]; - this.notifier.notify('success', 'Your Changes Updated.!'); + // this.notifier.notify('success', 'Your Changes Updated.!'); const blobs = new Blob([blob.body], { type: 'application/vnd.ms-excel' }); const file = new File([blobs], fileName, 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 82368e70c..3800fb290 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 @@ -322,17 +322,17 @@ export class AddressComponent implements OnInit { records.bussiness_address_type_others = this.addressForm.controls.bussiness_address_type_others.value; } } + console.log('this.addressForm.controls.additional_premises.value',this.addressForm.controls.additional_premises.value); + this.addressForm.controls.additional_premises.value.forEach((val,index)=> { - - console.log('val.premises_city',val.premises_city); if(val.premises_city != '' && val.premises_city != null){ this.formPremisesCityArray = []; val.premises_city.forEach(option => { this.formPremisesCityArray.push({additional_premises_city: option}); - this.addressForm.controls.additional_premises.value[index].premises_city = this.formPremisesCityArray; }); + this.addressForm.controls.additional_premises.value[index].premises_city = this.formPremisesCityArray; } else{ this.formPremisesCityArray = []; @@ -343,11 +343,12 @@ export class AddressComponent implements OnInit { }); records.additional_premises = this.addressForm.controls.additional_premises.value; - + records.pdid = this.pdid; records.formid = '5'; // records.fk_createdby = '250'; + console.log(JSON.stringify(records)); this._pd.saveForm(records).subscribe(data => { 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 a52057c6b..ac5031bb1 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 @@ -183,14 +183,16 @@ - - Yes + + {{d.viewValue}} + - + + @@ -267,12 +269,12 @@
- +
- +
@@ -288,7 +290,7 @@
- +
@@ -302,7 +304,7 @@
+ class="mr-1 mb-1 hover-icon" (click)="addAssetDetails($event,2); false">add
@@ -527,20 +529,19 @@ -
+
- - Yes - No - NA + + {{d.viewValue}} - + - + + @@ -622,12 +623,12 @@
- +
- +
@@ -640,7 +641,7 @@
- +
@@ -654,7 +655,7 @@
+ class="mr-1 mb-1 hover-icon" (click)="addAssetDetails($event,1); false">add
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 90c350611..f1cd2ec9d 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 @@ -38,7 +38,11 @@ export class AssetsInfoComponent implements OnInit { public m_assets_type = []; public m_relation = []; public applicants: any; - + otherEmiamtFlag : boolean = false; + businessEmiAmtFlag : boolean = false; + public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"}, + {'value': "no",'viewValue': "No"}, + {'value': "nan",'viewValue': "NA"}] // public m_assets_type = [ // { // 'id': "1", @@ -177,38 +181,38 @@ public m_investmentType = []; } public viewerOptions: any = { - navbar: false, - toolbar: { - zoomIn: 4, - zoomOut: 4, - oneToOne: 4, - reset: 4, - prev: 4, - play: { - show: 4, - size: 'large', - }, - next: 4, - rotateLeft: 4, - rotateRight: 4, - flipHorizontal: 4, - flipVertical: 4, - } -}; + navbar: false, + toolbar: { + zoomIn: 4, + zoomOut: 4, + oneToOne: 4, + reset: 4, + prev: 4, + play: { + show: 4, + size: 'large', + }, + next: 4, + rotateLeft: 4, + rotateRight: 4, + flipHorizontal: 4, + flipVertical: 4, + } + }; ngOnInit() { - this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => { - this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ; - }); + this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => { + this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ; + }); - this.getPdSupplierFormDetails(); - this.getM_Assets_Type(); - this.getM_PropertyType(); - this.getM_InvestmentType(); - this.getM_FreqOfPurchase(); - this.getM_Relation(); - //this.getM_InsuranceType(); + this.getPdSupplierFormDetails(); + this.getM_Assets_Type(); + this.getM_PropertyType(); + this.getM_InvestmentType(); + this.getM_FreqOfPurchase(); + this.getM_Relation(); + //this.getM_InsuranceType(); } // ====================== @@ -351,7 +355,7 @@ public m_investmentType = []; name_of_the_owner: [''], other_owner:[''], relation: [''], - // purchase_year: [''], + //purchase_year: [''], //purchase_month: [''], emi: [''], emi_paid: [''], @@ -367,9 +371,9 @@ public m_investmentType = []; business_details: this._formBuilder.array([]), business_approximate_market_value: [''], business_name_of_the_owner: [data], - // other_owner:[''], - // relation:[''], - // purchase_year: [''], + //other_owner:[''], + //relation:[''], + //purchase_year: [''], //purchase_month: [''], business_emi: [''], business_emi_paid: [''], @@ -614,8 +618,8 @@ public m_investmentType = []; name_of_the_owner: [data.name_of_the_owner], other_owner:[data.other_owner || ''], relation: [data.relation || ''], - // purchase_year: [data.purchase_year], - // purchase_month: [data.purchase_month], + // purchase_year: [data.purchase_year], + // purchase_month: [data.purchase_month], emi: [data.emi || 0], emi_paid: [data.emi_paid || ''], original_loan_tenure: [data.original_loan_tenure || ''], @@ -623,6 +627,7 @@ public m_investmentType = []; elapsed_tenure: [data.elapsed_tenure || ''] }); } + initBusinessDetailsWithdata(data) { return this._formBuilder.group({ business_assets_mode: [data.business_assets_mode], @@ -631,15 +636,16 @@ public m_investmentType = []; business_name_of_the_owner: [data.business_name_of_the_owner], // other_owner:[data.other_owner || ''], // relation: [data.relation || ''], - // purchase_year: [data.purchase_year], - // purchase_month: [data.purchase_month], - business_emi: [data.business_emi || 0], - business_emi_paid: [data.business_emi_paid || ''], - business_original_loan_tenure: [data.business_original_loan_tenure || ''], - business_balance_tenure: [data.business_balance_tenure || ''], - business_elapsed_tenure: [data.business_elapsed_tenure || ''] + // purchase_year: [data.purchase_year], + // purchase_month: [data.purchase_month], + business_emi: [data.business_emi || 0], + business_emi_paid: [data.business_emi_paid || ''], + business_original_loan_tenure: [data.business_original_loan_tenure || ''], + business_balance_tenure: [data.business_balance_tenure || ''], + business_elapsed_tenure: [data.business_elapsed_tenure || ''] }); } + loadDetails: boolean; addAssetsDetailsWithData(supp_data) { console.log(supp_data); @@ -654,8 +660,8 @@ public m_investmentType = []; name_of_the_owner: val.name_of_the_owner, other_owner:val.other_owner, relation: val.relation, - // purchase_year: val.purchase_year, - // purchase_month: val.purchase_month, + // purchase_year: val.purchase_year, + // purchase_month: val.purchase_month, emi: val.emi, emi_paid: val.emi_paid, original_loan_tenure: val.original_loan_tenure, @@ -685,21 +691,22 @@ public m_investmentType = []; business_name_of_the_owner: val.business_name_of_the_owner, // other_owner: val.other_owner, // relation : val.relation, - // purchase_year: val.purchase_year, - // purchase_month: val.purchase_month, - business_emi: val.business_emi, - business_emi_paid: val.business_emi_paid, - business_original_loan_tenure: val.business_original_loan_tenure, - business_elapsed_tenure: val.business_elapsed_tenure, - business_balance_tenure: val.business_balance_tenure + // purchase_year: val.purchase_year, + // purchase_month: val.purchase_month, + business_emi: val.business_emi, + business_emi_paid: val.business_emi_paid, + business_original_loan_tenure: val.business_original_loan_tenure, + business_elapsed_tenure: val.business_elapsed_tenure, + business_balance_tenure: val.business_balance_tenure }; + // const control = this._assetsQuesFrom.controls['assets_details']; // control.push(this.initDetailsWithdata(vals)); // this.setAssetsDetailsWithData(vals.business_assets_mode, val.details, control.length - 1) const control = this._assetsQuesFrom.controls['business_assets_details']; control.push(this.initBusinessDetailsWithdata(vals)); - this.setAssetsDetailsWithData2(vals.business_assets_mode, val.business_details, control.length - 1) + this.setBusinessAssetsDetailsWithData(vals.business_assets_mode, val.business_details, control.length - 1) } } //this.loadDetails = true; @@ -762,7 +769,7 @@ public m_investmentType = []; } } - setAssetsDetailsWithData2(assets_details_mode: any, datas: any, i: any): void { + setBusinessAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void { let val = i; let data = datas; const arr = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; @@ -813,9 +820,10 @@ public m_investmentType = []; } } - addSupplierDetails(e,flag) { - console.log(flag); - console.log(e); + /** Add More Asset using Flag Both "Other Asset" And "Business Asset" */ + addAssetDetails(e,flag) { + // console.log(flag); + // console.log(e); if(flag == 1){ const control = this._assetsQuesFrom.controls['assets_details']; control.push(this.initDetails()); @@ -824,14 +832,16 @@ public m_investmentType = []; control.push(this.initBusinessDetails(this.businessProfessionName)); } } - removeLanguage(i: number,flag) { - if(flag == 1){ - const control = this._assetsQuesFrom.controls['assets_details']; - control.removeAt(i); - }else if(flag == 2){ - const control = this._assetsQuesFrom.controls['business_assets_details']; - control.removeAt(i); - } + + /** To remove The Added Asset using Flag Both "Other Asset" And "Business Asset" */ + removeAssetsDetails(i: number,flag) { + if(flag == 1){ + const control = this._assetsQuesFrom.controls['assets_details']; + control.removeAt(i); + }else if(flag == 2){ + const control = this._assetsQuesFrom.controls['business_assets_details']; + control.removeAt(i); + } } public paymentModeTextBox: number; @@ -845,10 +855,22 @@ public m_investmentType = []; this.freqPurchaseTextBox = e.value; } + /** Show/hide EMI amount Field using Flag Both "other Asset" and "business" + * REF = "Other Asset type at last Field" + **/ + selectedAssetLoanType(e: any,flag): void { + if(flag == 1){ + this.otherEmiamtFlag = (e == 'yes') ? true : false; + } + else if(flag == 2){ + this.businessEmiAmtFlag = (e == 'yes') ? true : false; + } + } /** To Save/Edited Popup Data */ onSubmit() { this.submitted = true; + // stop here if form is invalid if (this._assetsQuesFrom.invalid) { return; @@ -876,22 +898,19 @@ public m_investmentType = []; } }); - // Add BRANCH data with help Service File + // Save the data with help of Service this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe( dataresult => { if (dataresult.status == 200) { - // console.log(dataresult); this.notifier.notify('success', 'Record Saved Successfully.!'); // this.dialogRef.close(); // alert("sample alert for Saving"); } else { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - // this.errorMessage = "Some Thing Wents Wrong Try Again !"; } }, error => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - // this.errorMessage = "Something Wents Wrong Try Again !"; // this.dialogRef.close(); }); //After Saving the BRANCH data then popup close @@ -905,7 +924,8 @@ public m_investmentType = []; arr.controls.splice(0); this.getPdSupplierFormDetails(); } - /** On Key Press Event For Mobile Number */ + + /** On Key Press Event For Number only Accepting */ keyPress(event: any) { const pattern = /[0-9\-\.\ ]/; @@ -915,7 +935,8 @@ public m_investmentType = []; } } - loanCalc(details ,flag) + /** To calculating Loan Elapsed Tenure both "Other Asset" And "Business Asset" using Flag */ + loanTenureCalc(details ,flag) { if(flag == 1){ //console.log(details.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 4385d2676..ef48af123 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 @@ -20,67 +20,112 @@
-

Data as Per Financial Statements

+

Data as Per Financial Statements

- - - Please provide Correct Year Format. Format Should Be (YYYY) - - - - -
+
+ + Starting Financial Year + + Invalid year format + + + + + + +
+ +
- - - - - - - - - - - - - Net Profit - Net Loss - - - - - - - - - - + + + Financial Year : {{details.get('financial_year').value}} +
+ +
+
+ + + + + {{"₹"}} {{FY_annualSalesInwords[i]}} Only + + + + + + + + No differents in Sales in FY {{details.get('financial_year').value}} over Sales in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} + + + Increase in Sales in FY {{details.get('financial_year').value}} over Sales in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} {{details.get('financial_annualsales_variation').value}} % + + + Decrease in Sales in FY {{details.get('financial_year').value}} over Sales in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} {{(details.get('financial_annualsales_variation').value).replace('-', '')}} % + + + + + +
+ +
+ + + + + Net Profit + Net Loss + + + + + + + {{"₹"}} {{FY_netProfitAmtInwords[i]}} Only + + + + + + + + + {{"₹"}} {{FY_netLossAmtInwords[i]}} Only + + + + + +
+ + + + + + + No differents in Profit in FY {{details.get('financial_year').value}} over Profit in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} + + + Increase in Profit in FY {{details.get('financial_year').value}} over Profit in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} {{details.get('financial_variation').value}} % + + + Decrease in Profit in FY {{details.get('financial_year').value}} over Profit in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} {{(details.get('financial_variation').value).replace('-', '')}} % + + + + + - - - - - - - - - - - - - - {{details.get('variation').value <= 0 ? 'Decreases ' : 'Increases '}} in Sales in FY Over Sales in FY is % - - - - - - - + @@ -89,10 +134,10 @@ matTooltip="Add More Financial Statements" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="i==0"> add --> - + -->
@@ -104,66 +149,107 @@ -

Actual Values as per Customer

+

Actual Values as per Customer

- + + Yes No +
- - - - - - - - - - - - Net Profit - Net Loss - - - - - - - - - - - - - - - - - - - - - {{details.controls['estimate_variation'].value}} {{details.controls['estimate_year'].value}} - - - - - -
@@ -313,10 +399,10 @@
- + - + @@ -355,7 +441,7 @@ - + - + + {{"₹"}} {{amtInwords[i]}} Only {{freq.name}} - - + + + {{"₹"}} {{emiAmtInwords[i]}} Only @@ -56,16 +58,18 @@ - + - + {{owner.applicant_name}} - - + + + + @@ -73,17 +77,19 @@ - + - +
+ - + +
@@ -17,6 +18,7 @@ +
{{types.type_name}} @@ -27,17 +29,17 @@ - + - + Yes No - + @@ -54,23 +56,25 @@ - - + + - + Enter Valid Mobile Number. - - - Enter Valid STD Code. - - + + + + +91 + Enter Valid STD Code. + - - + Enter Valid Landline Number. - + @@ -82,17 +86,18 @@ - +

Period of Relationship

- + - + - + + {{"₹"}} {{amtInwords[r]}} Only @@ -102,6 +107,20 @@ + + + + Select + + {{remark.name}} + + + + + + + + @@ -122,7 +141,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..f6324652d 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,11 @@ 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], + 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 +239,11 @@ 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, + "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 +283,12 @@ validateAllFormFields(formGroup: any) { this.validateAllFormFields(control); } }); -} +} + + /** 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 @@ + + + --> + + --> @@ -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..186ecba17 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/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 afd68848a..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 @@ -56,16 +56,15 @@ - + Enter Valid Mobile Number. - - + +91 Enter Valid STD Code. - @@ -86,14 +85,14 @@ - +

Period of Relationship

- - + + - + @@ -107,8 +106,11 @@ + + + - + Select @@ -116,7 +118,7 @@ - + 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 f6324652d..80a3a679a 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 @@ -148,6 +148,7 @@ 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], @@ -239,6 +240,7 @@ 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, @@ -283,6 +285,20 @@ 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 */ From d67d0a3c663addaf82d1c02785ece2fd8099e813 Mon Sep 17 00:00:00 2001 From: venbaSriram Date: Tue, 1 Jan 2019 18:40:20 +0530 Subject: [PATCH 09/11] css assets : ps --- .../assets-info/assets-info.component.html | 872 ++++++++---------- .../assets-info/assets-info.component.scss | 2 +- .../assets-info/assets-info.component.ts | 2 + .../neighbour-hood.component.ts | 4 +- 4 files changed, 414 insertions(+), 466 deletions(-) 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..40e14ff6c 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 @@ -37,101 +37,106 @@
-
+
-
- + +
+ {{ prop.name }} -
-
- +
-
+
-
+
-
- +
+
-
+
-
+
-
- + +
+
-
+
-
+
-
- +
+
-
+
-
+
-
- + + -
-
- + + {{ freqn.name }} + + +
-
- + +
+ + -
-
-
-
- + + + + -
+
-
+
@@ -139,28 +144,28 @@
-
- + + {{ ins_type.name }} -
-
- - + + + + -
-
- + + + -
-
- + + -
+
@@ -169,29 +174,31 @@
-
+
-
- +
+ - +
+
+ - + - {{d.viewValue}} + {{data.viewValue}} - + @@ -199,101 +206,68 @@
-
+
-
-
-
- - - -
-
-
- -
- - - -
- - - {{owner.applicant_name}} +
+ + + + + + + +
+ - - -
-
- - - -
-
- - - - {{relations.name}} - - - -
--> - -
-
-
+
-
- + + Yes No -
-
- + + + -
-
- + + + -
-
- + + -
-
- + + + +
-
-
+
-
+ -
+
@@ -316,358 +290,330 @@
- +
- - -
-
-
- - -
-
- - - {{ 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}} + + + + + + + + + +
+
+
+ +
+
+ + +
+ + + + + + + {{owner.applicant_name}} + + + + + + + + + + + {{relations.name}} + + + +
+ +
+ + + + Yes + No + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + +
+
+ + + +
+
+
+ +
+ +
+ + + + + +
-
- - - - {{relations.name}} - - - -
- - - - - - {{d.viewValue}} - - - - - - - - - -
-
-
-
-
- - -
-
- - - -
-
-
- - -
- - - - {{owner.applicant_name}} - - - -
-
- - - -
-
- - - - {{relations.name}} - - - -
-
- - -
-
-
- - - Yes - No - - -
-
- - - -
-
- - - -
-
- - - -
-
- - - - -
-
-
-
-
- - - -
-
-
-
-
-
-
-
- -
- -
- -
- - - -
-
-
-
+
- +
@@ -762,7 +708,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..c2cc2647a 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 @@ -507,6 +507,7 @@ public m_investmentType = []; //insurance_type: [''], premium_paid: [''], frequency_mode: [''], + other_frequency_mode:[''], sum_assured: [''], members_coverd: [''] }); @@ -582,6 +583,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] }); 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 80a3a679a..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 @@ -289,8 +289,8 @@ validateAllFormFields(formGroup: any) { /** To Convert Month into Year */ ConvertMonthintoYear(itemrow,e){ - console.log(itemrow); - console.log(e); + // console.log(itemrow); + // console.log(e); let year = itemrow.controls.year_relation_applicant.value; let converted_month : number = e%12; From bfe5fed27a036401700b26928fef6c339983fa88 Mon Sep 17 00:00:00 2001 From: venbaSriram Date: Tue, 1 Jan 2019 21:06:19 +0530 Subject: [PATCH 10/11] asset amtinwds incomplete : ps --- .../assets-info/assets-info.component.html | 172 ++++++------------ .../assets-info/assets-info.component.ts | 27 ++- .../banking-details.component.ts | 2 +- 3 files changed, 75 insertions(+), 126 deletions(-) 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 40e14ff6c..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,29 +34,29 @@
- + +
-
-
+ {{ prop.name }} + - +
-
- + +
-
@@ -67,14 +66,12 @@
-
- + +
-
-
@@ -82,11 +79,10 @@
-
- + +
-
@@ -96,85 +92,69 @@
-
+
-
- - + + - - + + {{ freqn.name }} - + + -
+
-
- +
- - - + -
-
+
- {{ ins_type.name }} - - - - - -
-
-
@@ -192,31 +172,26 @@ {{data.viewValue}} - -
-
- - - + +
- + + {{"₹"}} {{appxMarketAmtInwords[i]}} Only @@ -228,35 +203,31 @@
- + Yes No - - + - + + {{"₹"}} {{emiAmtInwords[i]}} Only - - + - + - - + - - +
@@ -314,7 +285,6 @@
-
@@ -329,7 +299,6 @@
-
@@ -345,7 +314,6 @@
-
@@ -355,7 +323,6 @@
-
-
@@ -383,21 +349,16 @@
-
-
- - {{ freqn.name }} @@ -406,69 +367,57 @@ -
+
-
- +
- - - + - +
-
- -
- + {{ ins_type.name }} - - - + - - - + - +
- -
+
- +
@@ -483,12 +432,10 @@ - {{owner.applicant_name}} - - + @@ -503,7 +450,7 @@ - + @@ -522,14 +469,13 @@
-
-
- + + {{"₹"}} {{OtherAppxMarketAmtInwords[i]}} Only @@ -554,35 +500,31 @@
- + Yes No - - + - + + {{"₹"}} {{OtherEmiAmtInwords[i]}} Only - - + - - + - - + - - +
@@ -592,7 +534,7 @@
- +
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 c2cc2647a..db14a7934 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", @@ -960,14 +964,17 @@ 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; + default: + break; + } +} } 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 186ecba17..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 @@ -105,7 +105,7 @@ export class BankingDetailsComponent implements OnInit { } else { result.forEach((datas,index) => { this.amtInwords[index] = this._pd.convertNumberToWords(datas.limit); - this. selectedBorrower(datas.applicant_name,index); + this.selectedBorrower(datas.applicant_name,index); this.selectedAccTypeChanges(datas.account_type,index) // this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi); From 1f4c405cfbfbe90aa2544da14a1f31b481a3414b Mon Sep 17 00:00:00 2001 From: venbaSriram Date: Tue, 1 Jan 2019 21:08:44 +0530 Subject: [PATCH 11/11] asset : ps --- .../start-pd/forms/assets-info/assets-info.component.ts | 6 ++++++ 1 file changed, 6 insertions(+) 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 db14a7934..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 @@ -973,6 +973,12 @@ inWords(e,i,flag){ 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; }