From 13d661cff1a71082cc480a851083cb890779afee Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 27 Feb 2019 10:40:52 +0530 Subject: [PATCH 1/2] rental verification changes --- .../rental-info/rental-info.component.html | 50 ++- .../rental-info/rental-info.component.scss | 100 +----- .../rental-info/rental-info.component.ts | 214 ++++--------- .../rental-verification.component.html | 212 +++++++++++++ .../rental-verification.component.scss | 13 + .../rental-verification.component.spec.ts | 25 ++ .../rental-verification.component.ts | 294 ++++++++++++++++++ .../list-pd/start-pd/start-pd.component.ts | 5 +- .../manage-pd/manage-pd.module.ts | 7 +- 9 files changed, 658 insertions(+), 262 deletions(-) create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html index 80d23bbfc..1477843fd 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html @@ -1,10 +1,10 @@ -
+

-
+
@@ -18,6 +18,48 @@
+
+ + + +
+ + Name of the Person who is showing the Property to Sineedge Officer + + + + {{val.name}} + + + + + +
+
+
+ +
+
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.scss index 61e420e61..2c0b25f1d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.scss @@ -1,31 +1,4 @@ -// .address { -// display: flex; -// padding: 0 2%; -// flex-direction: column; -// } - -// .address > * { -// width: 100%; -// } -// .matcard mat-form-field { -// margin: 0 2%; -// width:40%; -// } -// .address .button { -// float: right; -// width: 10px; -// background: #62B013; -// color: white; -// } -// mat-form-field { -// width: 27%; -// margin: 0 2%; -// } -// .fields mat-form-field { -// width: 45%; -// margin: 0 2%; -// } - ::ng-deep .cdk-global-overlay-wrapper{ +::ng-deep .cdk-global-overlay-wrapper{ justify-content: center !important; } .paragraph_change { @@ -42,74 +15,5 @@ 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 { - background: white; - margin: auto; - position: relative; - overflow: hidden !important; - border-radius: 10px 10px 10px 10px; - box-shadow: $base-card-box-shadow; - transform: scale(0.95); - transition: box-shadow 0.5s, transform 0.5s; - &:hover { - transform: scale(1); - box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2); - } - .p-list { - position: relative; - .top { - height: 100%; - width: 100%; - // background: url(https://s-media-cache-ak0.pinimg.com/736x/49/80/6f/49806f3f1c7483093855ebca1b8ae2c4.jpg) no-repeat center center; - -webkit-background-size: 100%; - -moz-background-size: 100%; - -o-background-size: 100%; - background-size: 100%; - } - .bottom { - width: 200%; - height: 15%; - transition: transform 0.5s; - h1 { - margin: 0; - padding: 0; - } - p { - margin: 0; - padding: 0; - } - .left { - height: 100%; - width: 50%; - background: #f4f4f4; - position: relative; - float: left; - .details { - padding: 5px; - float: left; - // width: calc(70% - 40px); - } - - } - .right { - width: 50%; - background: #A6CDDE; - color: white; - float: right; - height: 200%; - overflow: hidden; - .details { - padding: 20px; - float: right; - width: calc(70% - 40px); - } - - - } - } - } - -} + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.ts index 1e8866ba7..ce316acfe 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.ts @@ -3,8 +3,6 @@ import {FormBuilder, FormGroup, Validators, FormControl, FormArray} from '@angul import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; import {NotifierService} from 'angular-notifier'; import {PdTrigerService} from './../../../../../pd-service/pd-triger.service'; -import {AwsService} from '../../../../../../AwsService/aws.service'; -import {Key} from 'protractor'; @Component({ selector: 'app-rental-info', @@ -12,38 +10,47 @@ import {Key} from 'protractor'; styleUrls: ['./rental-info.component.scss'] }) export class RentalInfoComponent implements OnInit { - customer_segment_abbr: any; - subproduct_abbr: any; - lender_applicant_id: any; - main_applicant: any; - - // @Input() pdid: string; - // @Input() pd_all_details: any; - // form_id: number; pageTitle: string ="Rental Information"; pdid: number; form_id: number; - step: number; - public rentalForm: FormGroup; - tenantsList: FormArray; - propertyList: FormGroup; private notifier: NotifierService; - + existCompanyList: any =[]; + mergeCompanyApplicant: any=[]; + //personType: any=[{id:2,name:"Tenant / Lessee"},{id:3,name:"Owner of the Rented Property"},{id:4,name:"Property Caretaker"},{id:1,name:"Others (Please Specify)"}]; constructor( notifier: NotifierService, private _fb: FormBuilder, private _pd: PdTrigerService, - private _aws:AwsService, private dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public pd_all_details: any) { this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.notifier = notifier; this.form_id = 17; - this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant; - this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; - this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; - this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; + // get applicant list + // this.pd_all_details.pdapplicants_detials.push({'pd_co_applicant_id':'0','applicant_name':'Others'}); + // let modifyApplicantList: any=[]; + // if(this.pd_all_details.pdapplicants_detials.length > 0){ + // modifyApplicantList = this.pd_all_details.pdapplicants_detials.map(element => { + // return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2}; + // }); + // this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList}) + + // } + // this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ + // if(data.dataStatus){ + // this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true); + // } + + // let modifyCompanyList : any=[]; + // if(this.existCompanyList.length>0){ + // modifyCompanyList = this.existCompanyList.map(element => { + // return {id:element.company_order_id.toString(),name:element.company_name,group_id:1}; + // }); + // this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) + // } + + // }); } public viewerOptions: any = { navbar: false, @@ -65,147 +72,44 @@ export class RentalInfoComponent implements OnInit { } }; ngOnInit() { - this.step = 0; this.inintRentalForm(); - this.createpropertyArray(); - let params: any = {}; - params.pd_id = this.pdid; - params.pd_form_id = this.form_id; - this._pd.retriveForm(params).subscribe(value => { - let subArray: any; - const control = this.rentalForm.controls['rental_home']; - if (value.status == 200) { - let rentalinfo = value.records; - var result = Object.keys(value.records.rental_home).map(function (key) { - return value.records.rental_home[key]; - }); - if (result.length == 0) { - const control = this.rentalForm.controls['rental_home']; - control.push(this.createpropertyArray()); - } else { - result.forEach((datas, index) => { - control.push(this.createpropertyArray()); - const parentControl = this.rentalForm.controls['rental_home']['controls'][index]; - const sub = parentControl.controls['details_tenants']; - // console.log('control', parentControl); - subArray = Object.keys(datas.details_tenants).map(function (key) { - return datas.details_tenants[key]; - }); - if (subArray.length > 0) { - subArray.forEach((val) => { - // console.log('val', val); - sub.push(this.createTenatsArray()); - }) - sub.removeAt(0); - } - datas.details_tenants = subArray; - }); - } - rentalinfo.rental_home = result; - rentalinfo.pdid = this.pdid; - rentalinfo.formid = this.form_id; - rentalinfo.fk_createdby = this._aws.getlocale(); - this.rentalForm.setValue(rentalinfo); - } else { - control.push(this.createpropertyArray()); - } - }); - } + // observe person met controls + // this.rentalForm.controls['person_met'].valueChanges.subscribe(val => { + // if(val && val.length>0){ + // let otherPersonMetCheck = val.filter(fVal=>fVal.id==0); + // otherPersonMetCheck.length>0 ? this.rentalForm.addControl('other_person_met', new FormControl('', Validators.required)) : this.rentalForm.removeControl('other_person_met'); + // otherPersonMetCheck.length>0 ? this.rentalForm.addControl('other_name_person_showing_property', new FormControl('', Validators.required)) : this.rentalForm.removeControl('other_name_person_showing_property'); + // } + // else { + // this.rentalForm.removeControl('other_person_met'); + // this.rentalForm.removeControl('other_name_person_showing_property'); + // this.rentalForm.removeControl('other_name_person_type'); + // } + // }); + // observe other person type + // this.rentalForm.controls['other_name_person_showing_property'].valueChanges.subscribe(val => { + // if(val && val.length>0){ + // let otherCheck = val.filter(fVal=>fVal.id==0); + // otherCheck.length>0 ? this.rentalForm.addControl('other_name_person_type', new FormControl('', Validators.required)) : this.rentalForm.removeControl('other_name_person_type'); + // } + // else { + // this.rentalForm.removeControl('other_name_person_type'); + // } + // }); + } + inintRentalForm() { - this.rentalForm = this._fb.group({ + return this.rentalForm = this._fb.group({ pdid: this.pdid, formid: this.form_id, - fk_createdby: this.pdid, person_met: [''], - property_own: [''], - nature_property: [''], - rental_home: this._fb.array([]) }); } - - createpropertyArray() { - this.propertyList = this._fb.group({ - complete_add: [''], - area_of_property: [''], - structure_property: [''], - total_room: [''], - is_rent: [''], - date_agreement: [''], - date_validity: [''], - rent_agreement: [''], - actual_rent: [''], - photo_areegment: [''], - bank: [''], - cash: [''], - rent_each_floor: [''], - total_rent: [''], - related_doc_owner: [''], - property_photographs: [''], - third_party_check: [''], - details_tenants: this._fb.array([this.createTenatsArray()]), - }); - return this.propertyList; - } - - createTenatsArray() { - return this._fb.group({ - name: [''], - mobile_no: [''], - tenants_seen: [''], - tenants_con_owner: [''], - staying_since: [''], - rent_paid: [''], - }); - } - - addProperty(event) { - event.stopPropagation(); - - const control = this.rentalForm.controls['rental_home']; - control.push(this.createpropertyArray()); - let length = control.length; - this.step = length - 1; - } - - deleteProperty(index) { - const control = this.rentalForm.controls['rental_home']; - control.removeAt(index); - } - - addTenant(parentIndex:number) { - const parentControl = this.rentalForm.controls['rental_home']['controls'][parentIndex]; - const control = parentControl.controls['details_tenants']; - // console.log(parentControl); - // console.log(control); - control.push(this.createTenatsArray()); - } - - deleteTenant(idx, parentIndex) { - const parentControl = this.rentalForm.controls['rental_home']['controls'][parentIndex]; - const control = parentControl.controls['details_tenants']; - control.removeAt(idx); - } - - rentalSubmit() { - if (!this.rentalForm.valid) { - this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); - return; - } - // console.log('form', this.rentalForm.value); - let records = this.rentalForm.value; - this._pd.saveForm(records).subscribe(data => { - if (data.status == 200) { - this.notifier.notify('success', 'Saved Successfully.'); - setTimeout(() =>{ - this.dialogRef.close(); - },3000); - } - else{ - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - } - }, error => { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - }) - } + // compare objects for merge two master table details + compareObjects(o1: any, o2: any) { + if(o1.id == o2.id && o1.group_id == o2.group_id) + return true; + else return false + } } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html new file mode 100644 index 000000000..e8e80f279 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html @@ -0,0 +1,212 @@ + +

+ +
+
+
+ {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
+ {{pageTitle}} +
+ +
+ +
+
+ +
+

+ + + + +
+ + + Name of the Person who is showing the Property to Sineedge Officer + + + + {{val.name}} + + + + + + Specify Other Person + + + + Who is {{_rentalForm.controls['other_person_met'].value}} + + + {{pType.name}} + + + + + + + Specify Other + + + + + + + Name of the Owner/Owners of the Let out Property as per Loan Applicants + + + + {{val.name}} + + + + + + Specify Other Owner/Owners + + + + Relation of Owner to Loan Applicant + + + + {{relation.name | titlecase}} + + + + + Relation To + + + {{relationto.name | titlecase}} + + + + + + +
+
+
+ + +
+ + + Monthly Rent Amount as per Loan Applicant + + {{"₹"}} {{rentAmtInwords}} Only + + + Mode of Payment of Rent as per Loan Applicant + + + {{payment.name}} + + + + + Amount Received in Cash + + {{"₹"}} {{amountReceivedCash}} Only + + + + Amount Received in Bank + + {{"₹"}} {{amountReceivedBank}} Only + + + Payment Received Reason + + + + Securtity Deposit amount as per Loan Applicant + + {{"₹"}} {{securtityDepositAmount}} Only + + + +
+
+
+ + +
+ + + Nature of Let Out property as per Loan Applicant + + + {{property.name}} + + + + + Other Property + + + + + + + Type of Units as per Loan Applicants + + + + {{unit.name}} + + + + + + Other Units + + + + No Floor + + +
+
+
+ + Floor Level + + + + + No of Units on the Floor + + +
+
+
+ + + + + + +
+
+
+ + +
+ + +
+ +
+ +
+ + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss new file mode 100644 index 000000000..183e27284 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss @@ -0,0 +1,13 @@ +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + } + mat-form-field { + margin: 0 2%; + } + ::ng-deep .cdk-global-overlay-wrapper{ + justify-content: center !important; +} +.align-margin { + margin-left: 25%; +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.spec.ts new file mode 100644 index 000000000..69bfbb086 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { RentalVerificationComponent } from './rental-verification.component'; + +describe('RentalVerificationComponent', () => { + let component: RentalVerificationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ RentalVerificationComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(RentalVerificationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts new file mode 100644 index 000000000..c1350a112 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts @@ -0,0 +1,294 @@ +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 { NotifierService } from 'angular-notifier'; +import { PdTrigerService } from './../../../../../pd-service/pd-triger.service'; + +@Component({ + selector: 'app-rental-verification', + templateUrl: './rental-verification.component.html', + styleUrls: ['./rental-verification.component.scss'] +}) +export class RentalVerificationComponent implements OnInit { + customer_segment_abbr: any; + subproduct_abbr: any; + lender_applicant_id: any; + main_applicant: any; + pageTitle: string = "Rental Information"; + public _neighbourhoodForm: FormGroup; + pdid : string; + form_id:number; + private notifier: NotifierService; + public _rentalForm: FormGroup; + existCompanyList: any =[]; + mergeCompanyApplicant: any=[]; + personType: any=[{id:2,name:"Tenant / Lessee"},{id:3,name:"Owner of the Rented Property"},{id:4,name:"Property Caretaker"},{id:1,name:"Others (Please Specify)"}]; + relationShipList: any=[]; + relationToList: any=[]; + rentAmtInwords : String; + paymentOptions: any=[{id:1,name:"Received in Cash"},{id:2,name:"Received through Banking Channel"},{id:3,name:"Combination of Cash & Bank"}]; + amountReceivedCash: String; + amountReceivedBank: String; + securtityDepositAmount: String; + propertyNature: any=[{id:2,name:"ResiDential Property"},{id:3,name:"Commercial Property"},{id:4,name:"Industrial Property"},{id:1,name:"Others (Please Specify)"}]; + unitTypeList: any=[]; + stateList:any=[]; + //floorList: any=[{id:1,name:"Ground Floor"},{id:1,name:"First Floor"},{id:1,name:"Second Floor"},{id:1,name:"Third Floor"}] + 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, +} +}; + constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef) { + this.pdid = this.data.pdmaster_details.pd_id; + this.notifier = notifier; + this.form_id = 17; + this.main_applicant = this.data.pdmaster_details.main_applicant; + this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id; + this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr; + this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr; + // get applicant list + this.data.pdapplicants_detials.push({'pd_co_applicant_id':'0','applicant_name':'Others'}); + let modifyApplicantList: any=[]; + if(this.data.pdapplicants_detials.length > 0){ + modifyApplicantList = this.data.pdapplicants_detials.map(element => { + return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2}; + }); + this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList}) + + } + // set unit type list details + let resiDentialProperty = [{id:2,name:'Independent Flat',group_id:1},{id:3,name:'Independent Flat',group_id:1},{id:4,name:'Independent Floor',group_id:1}, + {id:5,name:'Independent Bungalow',group_id:1},{id:6,name:'Independent Row House',group_id:1},{id:7,name:'Multi Storey Building',group_id:1},{id:1,name:'Other (Please Specify)',group_id:1}]; + + let commercialProperty = [{id:2,name:'Independent Office',group_id:2},{id:3,name:'Independent Shop',group_id:2},{id:4,name:'Warehouse/Godown',group_id:2}, + {id:5,name:'Workshop',group_id:2},{id:6,name:'Independent Clinic',group_id:2},{id:7,name:'Multi Storey Building',group_id:2},{id:1,name:'Other (Please Specify)',group_id:2}]; + + let industrialProperty = [{id:2,name:'Factory',group_id:3},{id:3,name:'Industrial Shed',group_id:3},{id:1,name:'Other (Please Specify)',group_id:3}]; + + this.unitTypeList.push({groupName:'Residential Property',groupValues:resiDentialProperty}); + this.unitTypeList.push({groupName:'Commercial Property',groupValues:commercialProperty}); + this.unitTypeList.push({groupName:'Industrial Property',groupValues:industrialProperty}); + + + } + + ngOnInit() { + this.initRentalForm(); + this.getMasterDetails('RELATIONSHIPS', 1); + this.getMasterDetails('COMPANYRELATIONSHIPS', 2); + this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ + if(data.dataStatus){ + let modifyCompanyList: any; + modifyCompanyList = data.records.filter(val =>val.is_active==true && val.is_company_applicant==true); + if(modifyCompanyList.length>0){ + modifyCompanyList = modifyCompanyList.map(element => { + return {id:element.company_order_id.toString(),name:element.company_name,group_id:1}; + }); + this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) + } + } + }); + // observe person met controls + this._rentalForm.controls['person_met'].valueChanges.subscribe(val => { + if(val && val.length>0){ + let otherPersonMetCheck = val.filter(fVal=>fVal.id==0); + otherPersonMetCheck.length>0 ? this._rentalForm.addControl('other_person_met', new FormControl('', Validators.required)) : this._rentalForm.removeControl('other_person_met'); + otherPersonMetCheck.length>0 ? this._rentalForm.addControl('other_name_person_showing_property', new FormControl('', Validators.required)) : this._rentalForm.removeControl('other_name_person_showing_property'); + + } + else { + this._rentalForm.removeControl('other_person_met'); + this._rentalForm.removeControl('other_name_person_showing_property'); + this._rentalForm.removeControl('other_name_person_type'); + } + }); + // observe owner of the property + this._rentalForm.controls['property_owner'].valueChanges.subscribe(val => { + if(val && val.length>0){ + let otherOwnerCheck = val.filter(fVal=>fVal.id==0); + otherOwnerCheck.length>0 ? this._rentalForm.addControl('property_owner_other', new FormControl('', Validators.required)) : this._rentalForm.removeControl('property_owner_other'); + otherOwnerCheck.length>0 ? this._rentalForm.addControl('property_owner_other_relationship', new FormControl('', Validators.required)) : this._rentalForm.removeControl('property_owner_other_relationship'); + otherOwnerCheck.length>0 ? this._rentalForm.addControl('property_owner_other_relation_to', new FormControl('', Validators.required)) : this._rentalForm.removeControl('property_owner_other_relation_to'); + + } + else { + this._rentalForm.removeControl('property_owner_other'); + this._rentalForm.removeControl('property_owner_other_relationship'); + this._rentalForm.removeControl('other_name_person_type'); + this._rentalForm.removeControl('property_owner_other_relation_to'); + } + }); + + // mode of payment is both cash and bank means genereate dynamic fields + this._rentalForm.controls['payment_mode'].valueChanges.subscribe(val => { + val ? this._rentalForm.addControl('payment_received_reason', new FormControl('')) : this._rentalForm.removeControl('payment_received_reason'); + + if(val && val.id==1){ + this._rentalForm.addControl('amount_received_cash', new FormControl('', Validators.required)); + this._rentalForm.removeControl('amount_received_bank'); val.id==2 ? this._rentalForm.addControl('amount_received_bank', new FormControl('', Validators.required)) : this._rentalForm.removeControl('amount_received_bank'); + } + else if(val && val.id==2){ + this._rentalForm.addControl('amount_received_bank', new FormControl('', Validators.required)); + this._rentalForm.removeControl('amount_received_cash'); + } + else if(val && val.id==3){ + this._rentalForm.addControl('amount_received_cash', new FormControl('', Validators.required)); + this._rentalForm.addControl('amount_received_bank', new FormControl('', Validators.required)); + } + else { + this._rentalForm.removeControl('amount_received_cash'); + this._rentalForm.removeControl('amount_received_bank'); + this._rentalForm.removeControl('payment_received_reason'); + } + }); + + // observe other property type + this._rentalForm.controls['nature_property'].valueChanges.subscribe(val => { + val.id==1 ? this._rentalForm.addControl('other_nature_property', new FormControl('', Validators.required)) : this._rentalForm.removeControl('other_nature_property'); + }); + + // observe unit type changes + this._rentalForm.controls['unit_type'].valueChanges.subscribe(val => { + val.id==1 ? this._rentalForm.addControl('other_unit_type', new FormControl('', Validators.required)) : this._rentalForm.removeControl('other_unit_type'); + val.group_id==1 && val.id==7 ? this._rentalForm.addControl('no_floor', new FormControl('', Validators.required)) : val.group_id==2 && val.id==7 ? this._rentalForm.addControl('no_floor', new FormControl('', Validators.required)) : this._rentalForm.removeControl('no_floor'); + val.group_id==1 && val.id==7 ? this._rentalForm.addControl('floor_details', this._fb.array([])) : val.group_id==2 && val.id==7 ? this._rentalForm.addControl('floor_details', this._fb.array([])) : this._rentalForm.removeControl('floor_details'); + }); + } + + initRentalForm() { + return this._rentalForm = this._fb.group({ + pdid: this.pdid, + formid: this.form_id, + person_met: ['',Validators.required], + property_owner: ['',Validators.required], + monthly_rent_amount: ['',Validators.required], + payment_mode: ['',Validators.required], + securtity_deposit_amount: ['',Validators.required], + nature_property: ['',Validators.required], + unit_type:['',Validators.required], + address:['',Validators.required], + state:['',Validators.required], + city:['',Validators.required], + pincode:['',Validators.required] + }); +} + // other_name_person_showing_property changes + personShowingChanges(value: any): void { + if(value.length>0){ + let otherCheck: any = value.filter(fVal=>fVal.id==1); + otherCheck.length >0 ? this._rentalForm.addControl('other_name_person_type', new FormControl('', Validators.required)) : this._rentalForm.removeControl('other_name_person_type'); +} +else { + this._rentalForm.removeControl('other_name_person_type'); +} +} + +/*** get all master details **/ +getMasterDetails(table: string, type: number) { + this._pd.getAllMasterDatas(table).subscribe( + data => { + if (data.status == 200) { + if (type == 1) { + let relationshipList: any = data.records.filter(item => item.isactive == 1).map(element => { + return {id:element.relationship_id.toString(),name:element.name,group_id:1}; + }); + relationshipList.length > 0 ? this.relationShipList.push({groupName:'Personal',groupValues:relationshipList}):''; + } + if (type == 2) { + let companyRelationShipList:any = data.records.filter(item => item.isactive == 1 && item.name != 'Others').map(element => { + return {id:element.company_relationship_id.toString(),name:element.name,group_id:2}; + }); + companyRelationShipList.length > 0 ? this.relationShipList.push({groupName:'Official',groupValues:companyRelationShipList}):''; + } + + } + }); +} +// generate floor rows +generateFloor(e:any): void{ + let control = this._rentalForm.controls['floor_details']; + if(e.target.value && Math.round(e.target.value)!=0){ + + if(Math.round(e.target.value) > this._rentalForm.value.floor_details.length){ + let rowValue = Math.round(e.target.value)-this._rentalForm.value.floor_details.length; + for(let i=rowValue;i>0;i--){ + control.push(this.createFloorDetails('')); + } + } + else if(Math.round(e.target.value) < this._rentalForm.value.floor_details.length){ + let rowValue = this._rentalForm.value.floor_details.length-Math.round(e.target.value); + for(let i=rowValue;i>0;i--){ + control.removeAt(this._rentalForm.value.floor_details.length-1); + } + } + } + else if(e.target.value && Math.round(e.target.value)==0){ + control.controls = []; + control.setValue([]); + } + else{ + control.controls = []; + control.setValue([]); + } + e.stopPropagation(); +} + +// create floor details +createFloorDetails(details){ + if(details){ + return this._fb.group({ + floor_level: [this._rentalForm.value.floor_details.length==0 ? 'Ground Floor' : this._rentalForm.value.floor_details.length+' Floor', Validators.compose([Validators.required])], + no_units_on_floor: ['', Validators.compose([Validators.required])], + }); + } + else{ + return this._fb.group({ + floor_level: [this._rentalForm.value.floor_details.length==0 ? 'Ground Floor' : this._rentalForm.value.floor_details.length+' Floor', Validators.compose([Validators.required])], + no_units_in_floor: ['', Validators.compose([Validators.required])], + }); + } + +} + // compare objects for merge two master table details + compareObjects(o1: any, o2: any) { + if(o1.id == o2.id && o1.group_id == o2.group_id) + return true; + else return false + } + /** Amount InWords */ +inWords(e,flag){ + switch(flag){ + case 1: + this.rentAmtInwords = this._pd.convertNumberToWords(e.target.value); + break; + case 2: + this.amountReceivedCash = this._pd.convertNumberToWords(e.target.value); + break; + case 3: + this.amountReceivedBank = this._pd.convertNumberToWords(e.target.value); + break; + case 4: + this.securtityDepositAmount = this._pd.convertNumberToWords(e.target.value); + break; + default: + break; + } + e.stopPropagation(); +} + +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts index 57d57a71b..a2b1532cf 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts @@ -17,7 +17,6 @@ import {StockComponent} from './forms/stock/stock.component'; import {CurrentLoanComponent} from './forms/current-loan/current-loan.component'; import {FinancialInfoComponent} from './forms/financial-info/financial-info.component'; import {AssetsInfoComponent} from './forms/assets-info/assets-info.component'; -import {RentalInfoComponent} from './forms/rental-info/rental-info.component'; import {AssessedIncomeComponent} from './forms/assessed-income/assessed-income.component'; import {BankingDetailsComponent} from './forms/banking-details/banking-details.component'; import {BusinessInfoComponent} from './forms/business-info/business-info.component'; @@ -29,6 +28,8 @@ import {FinalRemarksComponent} from './forms/final-remarks/final-remarks.compone import { BusinessInfoGroupComponent } from './forms/business-info-group/business-info-group.component'; import { BusinessAssetsInfoComponent } from './forms/business-assets-info/business-assets-info.component'; import { PdStatusChangeDialogueComponent } from './../pd-status-change-dialogue/pd-status-change-dialogue.component'; +import {RentalVerificationComponent} from './forms/rental-verification/rental-verification.component'; + @Component({ selector: 'app-start-pd', templateUrl: './start-pd.component.html', @@ -396,7 +397,7 @@ export class StartPdComponent implements OnInit, OnDestroy { } else if(this.selectedFormsCategory.form_id==17){ - const dialogRef = this.dialog.open(RentalInfoComponent, { + const dialogRef = this.dialog.open(RentalVerificationComponent, { data: this.pdFullDetails, // position: { right: '0'}, maxWidth: '100vw', diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index b3e372c8c..17d1d91fb 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -113,6 +113,7 @@ import { PdLocatedMapViewDirective } from './../pd-directive/pd-located-map-view import { ViewLocationComponent } from './../pd-directive/view-location/view-location.component'; import { GetAnswerableFormsPipe } from './../pd-pipes/get-answerable-forms.pipe'; import { ConfirmAiDetailsComponent } from './list-pd/start-pd/forms/assessed-income/confirm-ai-details/confirm-ai-details.component'; +import { RentalVerificationComponent } from './list-pd/start-pd/forms/rental-verification/rental-verification.component'; /** * Custom angular notifier options @@ -159,7 +160,7 @@ const pdCustomNotifierOptions: NotifierOptions = { }; @NgModule({ - declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent], + declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent], imports: [ CommonModule, ManagePdRoutingModule, @@ -192,13 +193,13 @@ const pdCustomNotifierOptions: NotifierOptions = { AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule, OwlNativeDateTimeModule, ], - exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent], + exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent], providers: [PdTrigerService, GetGeometricLocationService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'}, {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]}, {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}, PdLocatedMapViewDirective], entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent, - ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent,PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent], + ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent,PdStatusChangeDialogueComponent, ViewLocationComponent, ConfirmAiDetailsComponent, RentalVerificationComponent], }) export class ManagePdModule { From a166fadff67570d41867dc60aaa15be290eea881 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 27 Feb 2019 10:41:36 +0530 Subject: [PATCH 2/2] merge : kms --- .../list-pd/add-pd/add-pd.component.html | 3 +- .../list-pd/add-pd/add-pd.component.ts | 4 +- .../edit-pd-master.component.html | 3 +- .../edit-pd-master.component.ts | 4 +- .../forms/address/address.component.html | 688 ++++++++---------- .../forms/address/address.component.ts | 623 +++++++--------- .../assets-info/assets-info.component.html | 18 +- .../assets-info/assets-info.component.ts | 24 +- .../banking-details.component.html | 3 + .../business-assets-info.component.html | 206 +----- .../business-assets-info.component.ts | 585 +++------------ .../business-banking-details.component.html | 16 +- .../business-info.component.html | 41 +- .../business-info/business-info.component.ts | 93 ++- .../client-info/client-info.component.html | 12 + .../current-loan/current-loan.component.html | 6 +- .../current-loan/current-loan.component.ts | 74 +- .../employment-info.component.html | 7 + .../family-details.component.html | 272 +------ .../family-details.component.ts | 392 ++-------- .../final-remarks.component.html | 64 +- .../final-remarks/final-remarks.component.ts | 34 +- .../financial-info.component.html | 53 +- .../financial-info.component.ts | 70 +- .../lender-representative.component.html | 1 + .../loan-details/loan-details.component.html | 53 +- .../loan-details/loan-details.component.ts | 589 +++++++-------- .../neighbour-hood.component.html | 3 + .../neighbour-hood.component.ts | 45 ++ .../other-income/other-income.component.html | 4 + .../rental-info/rental-info.component.html | 7 +- .../start-pd/forms/stock/stock.component.html | 112 +-- .../start-pd/forms/stock/stock.component.ts | 132 ++-- .../supplier-info.component.html | 10 +- .../list-pd/view-pd/view-pd.component.html | 13 +- 35 files changed, 1610 insertions(+), 2654 deletions(-) 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 53af6fa0f..2a5d48c1b 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 @@ -127,7 +127,8 @@ - + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index 3d94fbcb8..42ebf4240 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -465,7 +465,7 @@ export class AddPdComponent implements OnInit, OnDestroy { "fk_pd_type":formValue.fk_pd_type, "fk_customer_segment":formValue.fk_customer_segment, "loan_amount":formValue.loan_amount, - "addressline1":formValue.addressline1, + "addressline1":formValue.addressline1.toUpperCase(), "fk_city":formValue.fk_city, "fk_state":formValue.fk_state, "pincode":formValue.pincode, @@ -525,6 +525,8 @@ export class AddPdComponent implements OnInit, OnDestroy { pd_form.append("addtional_requirements",JSON.stringify(formValue.addtional_requirements)) } + // console.log('pd_form',pd_form); + // console.log('pd_details',pd_details); this._pd.addPdDetails(pd_form).subscribe(result => { if (result.status == 200) { this.disableAfterSubmit = false; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html index 68612360f..4cdb391c7 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html @@ -115,8 +115,9 @@ - + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts index f62c7a59c..0636bcf42 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts @@ -168,7 +168,7 @@ export class EditPdMasterComponent implements OnInit { fk_pd_type: [this.data.records.fk_pd_type], fk_customer_segment: [this.data.records.fk_customer_segment], loan_amount: [this.data.records.loan_amount,Validators.compose([Validators.pattern('^[0-9]*$')])], -   addressline1: [this.data.records.addressline1], +   addressline1: [this.data.records.addressline1.toUpperCase()], fk_city: [this.data.records.fk_city], fk_state: [this.data.records.fk_state],   pincode : [this.data.records.pincode_id], @@ -334,7 +334,7 @@ export class EditPdMasterComponent implements OnInit { "fk_pd_type": my_array.fk_pd_type, "fk_customer_segment": my_array.fk_customer_segment, "loan_amount": my_array.loan_amount, -   "addressline1": my_array.addressline1, +   "addressline1": my_array.addressline1.toUpperCase(), "fk_city": my_array.fk_city, "fk_state": my_array.fk_state,   "pincode": my_array.pincode, 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 aebc2fa44..43a2473bd 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 @@ -2,444 +2,326 @@

-
- {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
- {{pageTitle}} -
-
- -
+
+ {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
+ {{pageTitle}} +
+
+ +

- +
- - + -
+
-
- - - - - +
+ +
-
- - - {{m_addressType.address_type}} - - +
+ + + Select + {{SL.name}} + + + + + Select + {{CL.city_name}} + + + + + + Select + {{PL.pincode}} + + + + + + Pincode + Required + +
-
- - - Address Type Required +
+ + + Select + {{m_addressType.address_type}} + + + + + + Address Type Required + +
-
- +
+ - {{m_locality.locality_name}} + Select + {{m_locality.locality_name}} + + + + + + + + Locality Required + + + + + MixUse + Required + +
+ + + +
+ + + Select + {{data.description}} + + + + + + + Select + {{data.rating}}
+ + +
+ + + -
- - - - Locality Required - -
- -
- - - MixUse Required - -
- -
- - - {{data.description}} - - - -
- -
- - - {{data.rating}} - - - -
- - - - -
- - + + + + UOM + Required + +
+ - +
- - - - - - - - - - - - - - - - + + +
-
- - - - - -
-
-
-
-
-
Image 1
-
-
-
-
-
-
-
Image 2
-
-
-
-
-
-
-
Image 3
-
-
-
-
-
-
-
Image 2
-
-
-
-
-
-
-
Image 3
-
-
-
-
-
-
-
Image 1
-
-
-
+ + + + + + + +
+ + + + + + -
- - Remarks - - -
-
+
+ + Remarks + + +
+
- +
- + \ No newline at end of file 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 06a7862b3..2d4e6a122 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 @@ -1,428 +1,299 @@ -import { - Component,OnInit, - Inject, Output, - Input, ElementRef, ViewEncapsulation -} from '@angular/core'; +import { Component, OnInit, Inject, Output, Input, ElementRef, ViewEncapsulation } from '@angular/core'; -import { - FormBuilder, FormGroup, - Validators, - FormArray, FormControl, AbstractControl, -} from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, FormArray, FormControl, AbstractControl } from '@angular/forms'; import { NotifierService } from 'angular-notifier'; -import { - MatDialog, - MatDialogRef, - MAT_DIALOG_DATA -} from '@angular/material'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +import { ActivatedRoute, Router } from "@angular/router"; + /** Service */ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; -import {ActivatedRoute, Router} from "@angular/router"; + @Component({ selector: 'app-address', templateUrl: './address.component.html', styleUrls: ['./address.component.scss'], encapsulation: ViewEncapsulation.None - }) export class AddressComponent implements OnInit { + + /**Declaration of Header Variables */ customer_segment_abbr: any; subproduct_abbr: any; lender_applicant_id: any; main_applicant: any; - pageTitle: string ="PD Address Details"; - + pageTitle: string = "PD Address Details"; + + /**Declaration of FormField Variables */ //@Input() pdid: number; - pdid : number; + pdid: number; form_id: number; pdAddress: string; + pdState: any; + pdCity: any; + pdPincode: any; + pdOtherPincode: any; CustSegAbbr: any; - loadDataStatus: boolean=true; - - // PremisesOtherFlag:boolean; - // PremisesLabel : any = []; + loadDataStatus: boolean = true; + placeholderName: any = 'Estimated area of the (Address Type)'; + + /**Array declaration Of Dropdown */ locationdata: any = []; commentData: any = []; - //customerData: any = []; 221118 review doc s.no 3.e - addressData:any = []; - localityData:any = []; - // ownerShipData:any = []; - // cityData:any = []; - - // z = 0; + addressData: any = []; + localityData: any = []; + stateData: any = []; + pincodeData: any = []; + cityData: any = []; + uomData: any = []; - // formPremisesArray: any = []; - // formPremisesCityArray: any = []; - // additional_premises: any=[]; - // bussiness_address_type: any=[]; - // premisesRentAmtInwords:any=[]; - // rentAmtInwords:any; - // tempArr: any[]; - placeholderName : any = 'Was any business activity seen at the Address Type during PD visit?'; - //neighbourStatusData:any=["Yes","No"]; - //applicantOwnerData:any=["Yes","No","Dont Know"]; - // public currentLoanForm: FormGroup; + /**Declaration of FormField Variables */ private notifier: NotifierService; public addressForm: FormGroup; public address: AbstractControl; public addressType: AbstractControl; + public state: AbstractControl; + public city: AbstractControl; + public pincode: AbstractControl; public locality: AbstractControl; public pdLocation: AbstractControl; public commentLocality: AbstractControl; - // public otherCommentLocality: AbstractControl; - // public customerBehaviour: AbstractControl; - // public ownership: AbstractControl; - // public other_ownership: AbstractControl; - // public rent_amt : AbstractControl; - // public other_premises_bussiness_activity : AbstractControl; - // public bussiness_activity_remark: AbstractControl; - // public bussinessActivity: AbstractControl; - // public business_years: AbstractControl; - // public business_month: AbstractControl; - //constructor(notifier: NotifierService,private _fb: FormBuilder,private _pd: PdTrigerService , ) { - constructor(private el: ElementRef, notifier: NotifierService, - private fb: FormBuilder, - private route: ActivatedRoute, - private router: Router, - private _pd: PdTrigerService, - private dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public pd_all_details: any) - { - // console.log(this.pd_all_details); + public estArea: AbstractControl; + public uom: AbstractControl; + + /**Constructor of the class */ + constructor(private el: ElementRef, notifier: NotifierService, + private fb: FormBuilder, + private route: ActivatedRoute, + private router: Router, + private _pd: PdTrigerService, + private dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public pd_all_details: any) { + this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.form_id = 5; - //commented + this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant; this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; - // console.log(this.pd_all_details.template_forms.form_id); - // console.log(this.pd_all_details.pdmaster_details.customer_segment_abbr); + console.log('this.pd_all_details',this.pd_all_details); let CSAbbrSearch = this.pd_all_details.pdmaster_details.customer_segment_abbr.search("-"); - this.CustSegAbbr = this.pd_all_details.pdmaster_details.customer_segment_abbr.substr(0,CSAbbrSearch); - + this.CustSegAbbr = this.pd_all_details.pdmaster_details.customer_segment_abbr.substr(0, CSAbbrSearch); + this.notifier = notifier; this.pdAddress = this.pd_all_details.pdmaster_details.addressline1; + this.pdState = this.pd_all_details.pdmaster_details.fk_state; + this.getCityAndPincodeDetails(this.pdState); + this.pdCity = this.pd_all_details.pdmaster_details.fk_city; + this.pdPincode = this.pd_all_details.pdmaster_details.pincode_id; + console.log('this.pdPincode', this.pdPincode); + this.pdOtherPincode = this.pdPincode == 1 ? this.pd_all_details.pdmaster_details.other_pincode : ''; + console.log('this.pdOtherPincode', this.pdOtherPincode); + } + /**Init Fns of the class */ ngOnInit() { - // console.clear(); - // console.log('this.address',this.pdAddress); - this.getMasterDetails('PDLOCATIONAPPROACH',1); - this.getMasterDetails('COMMENTSONLOCALITY',2); - //this.getMasterDetails('CUSTOMERBEHAVIOUR',3);review doc s.no 3.e - this.getMasterDetails('LOCALITY',4); - // this.getMasterDetails('ADDRESSTYPE',5); - this.getMasterDetails('RESIDENCEOWNERSHIP',6); - this.getMasterDetails('CITY',7); - this.getM_Address_Type(); + this.getMasterDetails('PDLOCATIONAPPROACH', 1); + this.getMasterDetails('COMMENTSONLOCALITY', 2); + this.getMasterDetails('UOM', 3); + this.getMasterDetails('LOCALITY', 4); + this.getMasterDetails('ADDRESSTYPE', 5); + this.getMasterDetails('STATE', 6); this.initAddressForm(); + let params: any = {}; params.pd_id = this.pdid; params.pd_form_id = '5'; - + this._pd.retriveForm(params).subscribe(data => { - // console.log('data', data); - //const control = this.addressForm.controls['neighbourhood']; - // const control = this.addressForm.controls['additional_address_units']; - //const additionalPremisesControl = this.addressForm.controls['additional_premises']; - if(data.status == 200) { - - this.addressForm.controls.address.setValue(data.records.address); - this.addressForm.controls.pd_location.setValue(data.records.pd_location); - this.addressForm.controls.address_type.setValue(data.records.address_type); - let selectedAddressType = this.addressData.filter(element =>element.address_type_id == data.records.address_type)[0]; - this.selectedAddressType(selectedAddressType.address_type); + if (data.status == 200) { - if(data.records.address_type == 1) { - this.addressForm.controls.address_type_others.setValue(data.records.address_type_others); - this.addressForm.controls.address_type_others.setValidators([Validators.required]); - this.addressForm.controls.address_type_others.updateValueAndValidity(); - this.selectedAddressType(data.records.address_type_others); - } - + this.addressForm.controls.address.setValue(data.records.address); + this.addressForm.controls.state.setValue(data.records.state); - this.addressForm.controls.comment_locality.setValue(data.records.comment_locality); + if (data.records.state != '') { + this.getCityAndPincodeDetails(data.records.state); + this.addressForm.controls.city.setValue(data.records.city); + this.addressForm.controls.pincode.setValue(data.records.pincode); + if (data.records.pincode == 1) { + this.addressForm.controls.pincode_others.setValue(data.records.pincode_others); + this.addressForm.controls.pincode_others.setValidators([Validators.required]); + this.addressForm.controls.pincode_others.updateValueAndValidity(); + } + } - // if(data.records.comment_locality == 1){ - // this.addressForm.controls.other_comment_locality.setValue(data.records.other_comment_locality); - // // this.addressForm.controls.other_comment_locality.setValidators([Validators.required]); - // // this.addressForm.controls.other_comment_locality.updateValueAndValidity(); - // } - // this.addressForm.controls.customer_behaviour.setValue(data.records.customer_behaviour); - this.addressForm.controls.locality.setValue(data.records.locality); + this.addressForm.controls.pd_location.setValue(data.records.pd_location); + this.addressForm.controls.address_type.setValue(data.records.address_type); - if(data.records.locality == 1 ){ - this.addressForm.controls.locality_others.setValue(data.records.locality_others); - this.addressForm.controls.locality_others.setValidators([Validators.required]); - this.addressForm.controls.locality_others.updateValueAndValidity(); - } - if(data.records.locality == 5){ - this.addressForm.controls.locality_mixuse.setValue(data.records.locality_mixuse); - this.addressForm.controls.locality_mixuse.setValidators([Validators.required]) - this.addressForm.controls.locality_mixuse.updateValueAndValidity(); - } - this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark); + let selectedAddressType = this.addressData.filter(element => element.address_type_id == data.records.address_type)[0]; + this.selectedAddressType(selectedAddressType.address_type); - // this.addressForm.controls.other_premises_bussiness_activity.setValue(data.records.other_premises_bussiness_activity); - // if(data.records.other_premises_bussiness_activity != '' && data.records.other_premises_bussiness_activity !=null) { - // this.addressForm.controls.bussiness_activity_remark.setValue(data.records.bussiness_activity_remark); - // } - // else{ - // this.addressForm.controls.bussiness_activity_remark.setValue(''); - // } - // this.addressForm.controls.bussiness_activity.setValue(data.records.bussiness_activity); + if (data.records.address_type == 1) { + this.addressForm.controls.address_type_others.setValue(data.records.address_type_others); + this.addressForm.controls.address_type_others.setValidators([Validators.required]); + this.addressForm.controls.address_type_others.updateValueAndValidity(); + this.selectedAddressType(data.records.address_type_others); + } - // this.addressForm.controls.business_years.setValue(data.records.business_years); - // this.addressForm.controls.business_month.setValue(data.records.business_month); + this.addressForm.controls.comment_locality.setValue(data.records.comment_locality); - // if(data.records.bussiness_activity == 'yes') { - // // const control = this.addressForm.controls['additional_address_units']; - - // var resultOfUnits = Object.keys(data.records.additional_address_units).map(function (key) { - // return data.records.additional_address_units[key]; - // }); - // //console.log(resultOfUnits); + this.addressForm.controls.locality.setValue(data.records.locality); - // if (resultOfUnits.length == 0) { - // control.push(this.createUnits()); - // } else { - // resultOfUnits.forEach((datas,index) => { - // // this.premisesRentAmtInwords[index] = this._pd.convertNumberToWords(datas.premises_rent_amt); - // if(datas.premises_type == 1){ - // // control.controls[index].premises_type_others.clearValidators(); - // // control.controls[index].premises_type_others.updateValueAndValidity(); - // } - - // control.push(this.createUnits()); - // }); - // this.addressForm.controls.additional_address_units.setValue(resultOfUnits); - // } - - // } + if (data.records.locality == 1) { + this.addressForm.controls.locality_others.setValue(data.records.locality_others); + this.addressForm.controls.locality_others.setValidators([Validators.required]); + this.addressForm.controls.locality_others.updateValueAndValidity(); + } + if (data.records.locality == 5) { + this.addressForm.controls.locality_mixuse.setValue(data.records.locality_mixuse); + this.addressForm.controls.locality_mixuse.setValidators([Validators.required]) + this.addressForm.controls.locality_mixuse.updateValueAndValidity(); + } - - } else { - //control.push(this.createNeighbour()); - // control.push(this.createUnits()); - } + this.addressForm.controls.estimated_area.setValue(data.records.estimated_area); + this.addressForm.controls.uom.setValue(data.records.uom); + if (data.records.uom == 1) { + this.addressForm.controls.uom_others.setValue(data.records.uom_others); + this.addressForm.controls.uom_others.setValidators([Validators.required]) + this.addressForm.controls.uom_others.updateValueAndValidity(); + } + this.addressForm.controls.address_form_remark.setValue(data.records.address_form_remark); + } }); } - getM_Address_Type() { - this._pd.getAllMasterDatas('ADDRESSTYPE').subscribe( - data => { - this.addressData = data.records.filter(data => data.isactive == 1); - // console.log(this.addressData); - // if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){ - - // // console.log('whole',FilteredAddressType); - // let index1 = this.addressData.map(data => data.address_type).indexOf("Residence"); - // this.addressData.splice(index1, 1); - // // console.log('FirstOne',FilteredAddressType); - // let index2 = this.addressData.map(data => data.address_type).indexOf("Residence cum Office"); - // this.addressData.splice(index2, 1); - // // console.log('SecondOne',FilteredAddressType); - // } - // console.log(this.addressData); - }) - } + // getM_Address_Type() { + // this._pd.getAllMasterDatas('ADDRESSTYPE').subscribe( + // data => { + // this.addressData = data.records.filter(data => data.isactive == 1); + // if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){ + // let index1 = this.addressData.map(data => data.address_type).indexOf("Residence"); + // this.addressData.splice(index1, 1); + // let index2 = this.addressData.map(data => data.address_type).indexOf("Residence cum Office"); + // this.addressData.splice(index2, 1); + // } + // }) + // } + + /** Address Form ELements */ public initAddressForm(): void { this.addressForm = this.fb.group({ - address: [this.pdAddress != '' ? this.pdAddress : '' , Validators.compose([Validators.required])], + address: [this.pdAddress != '' ? this.pdAddress : '', Validators.compose([Validators.required])], address_type: ['', Validators.compose([Validators.required])], address_type_others: [''], + state: [this.pdState != '' ? this.pdState : ''], + city: [this.pdCity != '' ? this.pdCity : ''], + pincode: [this.pdPincode != '' ? this.pdPincode : ''],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */ + pincode_others: [this.pdOtherPincode != '' ? this.pdOtherPincode : '', Validators.compose([Validators.minLength(6), Validators.maxLength(6)])], locality: ['', Validators.compose([Validators.required])], locality_others: [''], - locality_mixuse:[''], + locality_mixuse: [''], pd_location: ['', Validators.compose([Validators.required])], comment_locality: ['', Validators.compose([Validators.required])], - // other_comment_locality : [''], - //customer_behaviour: ['', Validators.compose([Validators.required])], - //neighbourhood: this.fb.array([]), - // additional_address_units: this.fb.array([]), - address_form_remark:[''], - // address_ownership:[''], - // other_ownership:[''], - // rent_amt:[''], - // other_premises_bussiness_activity : [''], - // bussiness_activity_remark:[''], - // bussiness_activity:[''], - // business_years:[''], - // business_month:[''], - // bussiness_address_type:[''], - // bussiness_address_type_others: [''], + estimated_area: [''], + uom: [''], + uom_others: [''], + address_form_remark: [''] //additional_premises: this.fb.array([]) }); this.address = this.addressForm.controls['address']; + this.state = this.addressForm.controls['state']; + this.city = this.addressForm.controls['city']; + this.pincode = this.addressForm.controls['pincode']; this.addressType = this.addressForm.controls['address_type']; this.locality = this.addressForm.controls['locality']; this.pdLocation = this.addressForm.controls['pd_location']; this.commentLocality = this.addressForm.controls['comment_locality']; - // this.otherCommentLocality = this.addressForm.controls['other_comment_locality']; - //this.customerBehaviour = this.addressForm.controls['customer_behaviour']; - // this.ownership = this.addressForm.controls['address_ownership']; - // this.other_ownership = this.addressForm.controls['other_ownership']; - // this.rent_amt = this.addressForm.controls['rent_amt']; - // this.other_premises_bussiness_activity = this.addressForm.controls['other_premises_bussiness_activity'], - // this.bussiness_activity_remark = this.addressForm.controls['bussiness_activity_remark'], - // this.bussinessActivity = this.addressForm.controls['bussiness_activity']; - // this.business_years = this.addressForm.controls['business_years']; - // this.business_month = this.addressForm.controls['business_month']; - // this.bussiessAddressType = this.addressForm.controls['bussiness_address_type']; + this.estArea = this.addressForm.controls['estimated_area']; + this.uom = this.addressForm.controls['uom']; } - // createNeighbour(): FormGroup { - // return this.fb.group({ - // name: ['', Validators.compose([Validators.required])], - // do_you_know: ['', Validators.compose([Validators.required])], - // how_long_year: ['', Validators.compose([Validators.required])], - // how_long_month: ['', Validators.compose([Validators.required])], - // is_owner: ['', Validators.compose([Validators.required])], - // }); - // } - // createUnits(): FormGroup { - // return this.fb.group({ - // no_of_additional_units: [''], - // premises_type: [''], - // premises_type_others: [''], - // premises_city: [''], - // // premises_ownership: [''], - // // premises_ownership_others: [''], - // // premises_rent_amt:[''], - // premises_remarks: [''], - // }); - // } -// createPremises(): FormGroup { -// return this.fb.group({ -// no_of_additional_units: [''], -// premises_city: [''], -// premises_remarks: [''], -// premises_ownership: [''], -// premises_ownership_others: [''], -// premises_rent_amt:[''], -// }); -// } - getMasterDetails(table:string,type:number){ + + + /** To Get Dropdown Data For Address Form */ + getMasterDetails(table: string, type: number) { this._pd.getAllMasterDatas(table).subscribe(data => { data.records.forEach(val => { - if (type==1 && val.isactive == 1) { + if (type == 1 && val.isactive == 1) { this.locationdata.push(val); } - else if(type==2 && val.isactive == 1){ + else if (type == 2 && val.isactive == 1) { this.commentData.push(val); } - /* else if(type==3 && val.isactive == 1){ - this.customerData.push(val); - } //221118 review doc s.no 3.e */ - else if(type==4 && val.isactive == 1){ + else if (type == 3 && val.isactive == 1) { + this.uomData.push(val); + } + else if (type == 4 && val.isactive == 1) { this.localityData.push(val); } - // else if(type==5 && val.isactive == 1){ - // this.addressData.push(val); - // if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){ - // // console.log(this.CustSegAbbr); - // // console.log('inside if',this.addressData); - // this.addressData.indexOf("Residence") - // this.addressData.indexOf("Residence cum Office") - // // console.log('inside if 2',this.addressData); - // } - // } - // else if(type==6 && val.isactive == 1){ - // this.ownerShipData.push(val); - // } - // else if(type==7 && val.isactive == 1){ - // this.cityData.push(val); - // } + else if (type == 5 && val.isactive == 1) { + this.addressData.push(val); + } + else if (type == 6 && val.isactive == 1) { + this.stateData.push(val); + } }) }); } - 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, - } -}; - /*221118 review doc s.no 3.f - addNeighbour() { - const control = this.addressForm.controls['neighbourhood']; - if (control.length <= 1) { - control.push(this.createNeighbour()); - } + + /** To Get City And Pincode Data For Address Form + * Param 'stateID' -> selected StateId + */ + getCityAndPincodeDetails(stateID: string) { + this._pd.getStateWiseCities(stateID).subscribe(data => { + if (data.status == 200) { + this.cityData = data.records.cities; + this.pincodeData = data.records.pincode; + } + }); } - removeNeighbour(index) { - const control = this.addressForm.controls['neighbourhood']; - control.removeAt(index); - }*/ - - // setRequiredValidation(value,item) { - // console.log(item); - // console.log(value); - // value==1 - // ? item.controls.premises_type_others.setValidators([Validators.required]) - // : item.controls.premises_type_others.clearValidators(); - // item.controls.premises_type_others.updateValueAndValidity(); - // } - - // addUnits() { - // const control = this.addressForm.controls['additional_address_units']; - // control.push(this.createUnits()); - // } - - // removeUnits(index) { - // const control = this.addressForm.controls['additional_address_units']; - // control.removeAt(index); - // } + /** TO Save Address Forms Details*/ onSubmit() { - // Partnr.controls[key].addControl('partner_other_name', new FormControl('', Validators.required)) - - this.addressForm.controls.address_type.value == 1 + + this.addressForm.controls.address_type.value == 1 ? this.addressForm.controls['address_type_others'].setValidators([Validators.required]) : this.addressForm.controls['address_type_others'].clearValidators(); - this.addressForm.controls['address_type_others'].updateValueAndValidity(); - - this.addressForm.controls.locality.value == 1 + this.addressForm.controls['address_type_others'].updateValueAndValidity(); + + this.addressForm.controls.locality.value == 1 ? this.addressForm.controls['locality_others'].setValidators([Validators.required]) : this.addressForm.controls['locality_others'].clearValidators(); - this.addressForm.controls['locality_others'].updateValueAndValidity(); + this.addressForm.controls['locality_others'].updateValueAndValidity(); - this.addressForm.controls.locality.value == 5 + this.addressForm.controls.pincode.value == 1 + ? this.addressForm.controls['pincode_others'].setValidators([Validators.required]) + : this.addressForm.controls['pincode_others'].clearValidators(); + this.addressForm.controls['pincode_others'].updateValueAndValidity(); + + this.addressForm.controls.locality.value == 5 ? this.addressForm.controls['locality_mixuse'].setValidators([Validators.required]) : this.addressForm.controls['locality_mixuse'].clearValidators(); - this.addressForm.controls['locality_mixuse'].updateValueAndValidity(); - - + this.addressForm.controls['locality_mixuse'].updateValueAndValidity(); + + this.addressForm.controls.uom.value == 1 + ? this.addressForm.controls['uom_others'].setValidators([Validators.required]) + : this.addressForm.controls['uom_others'].clearValidators(); + this.addressForm.controls['uom_others'].updateValueAndValidity(); + if (!this.addressForm.valid) { this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); return; } - // console.log(this.addressForm.controls.bussiness_activity_remark.value); - // console.log(this.address.value.bussiness_activity_remark); + // if(this.address.value.bussiness_activity_remark == ''){ // this.notifier.notify('warning', 'Fill Remark!'); // return; @@ -430,102 +301,104 @@ export class AddressComponent implements OnInit { let records: any = {}; records.address = this.address.value; + records.state = this.state.value; + records.city = this.city.value; records.address_type = this.addressType.value; - if (this.addressType.value == 1) { - records.address_type_others = this.addressForm.controls.address_type_others.value; - } + + records.address_type_others = this.addressType.value == 1 ? + this.addressForm.controls.address_type_others.value : ''; + records.locality = this.locality.value; - if (this.locality.value == 1) { - records.locality_others = this.addressForm.controls.locality_others.value; - } - if(this.locality.value == 5){ - records.locality_mixuse = this.addressForm.controls.locality_mixuse.value; - } + records.locality_others = this.locality.value == 1 ? + this.addressForm.controls.locality_others.value : ''; + + records.locality_mixuse = this.locality.value == 5 ? + this.addressForm.controls.locality_mixuse.value : ''; + + records.pincode = this.pincode.value; + records.pincode_others = this.pincode.value == 1 ? + this.addressForm.controls.pincode_others.value : ''; + records.pd_location = this.pdLocation.value; records.comment_locality = this.commentLocality.value; - // records.other_comment_locality = this.otherCommentLocality.value; - //records.customer_behaviour = this.commentlocality.value; - //records.neighbourhood = this.addressForm.controls.neighbourhood.value; - - records.address_form_remark = this.addressForm.controls.address_form_remark.value; - // records.address_ownership = this.ownership.value; - // records.other_ownership = this.other_ownership.value; - // records.rent_amt = this.rent_amt.value; - // records.other_premises_bussiness_activity = this.other_premises_bussiness_activity.value; - // records.bussiness_activity_remark = this.bussiness_activity_remark.value; - // records.bussiness_activity = this.bussinessActivity.value; - // records.business_years = this.business_years.value; - // records.business_month = this.business_month.value; - // if (this.bussinessActivity.value == 'yes') { - // records.additional_address_units = this.addressForm.controls.additional_address_units.value; - // } + records.address_form_remark = this.addressForm.controls.address_form_remark.value; + records.estimated_area = this.estArea.value; + + records.uom = this.uom.value; + records.uom_others = records.uom == 1 ? + this.addressForm.controls.uom_others.value : ''; records.pdid = this.pdid; records.formid = '5'; // records.fk_createdby = '250'; - + // console.log(JSON.stringify(records)); this._pd.saveForm(records).subscribe(data => { - if(data.status == 200) { + if (data.status == 200) { this.notifier.notify('success', 'Saved Successfully.'); - setTimeout(() =>{ + setTimeout(() => { this.dialogRef.close(); - },3000); + }, 3000); } else { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); } }, error => { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); }); } - selectedAddressType(e: any){ - this.placeholderName = 'Was any business activity seen at the '+e+' during PD visit?'; + /** For PlaceHolder + * selected AddressType is concate with label */ + selectedAddressType(e: any) { + console.log(e); + this.placeholderName = 'Estimated area of the ' + e; } + /** To validate All Form Fields */ validateAllFormFields(formGroup: FormGroup) { Object.keys(formGroup.controls).forEach(field => { const control = formGroup.get(field); if (control instanceof FormControl) { - control.markAsTouched({onlySelf: true}); + control.markAsTouched({ onlySelf: true }); } else if (control instanceof FormGroup) { this.validateAllFormFields(control); } }); } - - - // ConvertMonthintoYear(e){ - - // let business_year = this.addressForm.controls.business_years.value; + /** On Key Press Event For Numbers */ + keyPress(event: any) { + const pattern = /[0-9]/; - // let converted_month : number = e%12; - // let converted_year : number = e/12; + let inputChar = String.fromCharCode(event.charCode); + if (event.keyCode != 8 && !pattern.test(inputChar)) { + event.preventDefault(); + } + } - // this.addressForm.controls.business_years.setValue(+business_year + +Math.floor(converted_year)); - // 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(); - // } - // } + /** For DOCS Tab */ + 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, + } + }; - // inWords(e,i){ - // this.premisesRentAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); - // } - - // inWordsForRent(e){ - // this.rentAmtInwords = this._pd.convertNumberToWords(e.target.value); - // } } \ 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 69448f507..c57f7e4a6 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 @@ -29,6 +29,7 @@
+ Select {{ asset.name }} @@ -42,6 +43,7 @@
+ Select {{ prop.name }} @@ -59,6 +61,7 @@
+ Select {{ vehicle.vehicle_type_name }} @@ -135,6 +138,7 @@ + Select {{ freqn.name }} @@ -167,6 +171,7 @@ + Select {{ ins_type.name }} @@ -209,19 +214,19 @@
-
+ + -
-
+
--> +
@@ -296,6 +301,7 @@ + Select Yes No 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 ebb819e3d..703b67ace 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 @@ -400,8 +400,8 @@ export class AssetsInfoComponent implements OnInit { //name_of_the_owner:[''], //other_owner:[''], //relation:[''], - any_other_asset_value : [''], - any_other_asset_loan : [''], + // any_other_asset_value : [''], + // any_other_asset_loan : [''], }); } @@ -480,16 +480,16 @@ export class AssetsInfoComponent implements OnInit { // name_of_the_owner:[data.name_of_the_owner], // other_owner:[data.other_owner], // relation:[data.relation], - any_other_asset_value : [data.any_other_asset_value], - any_other_asset_loan : [data.any_other_asset_loan], + // any_other_asset_value : [data.any_other_asset_value], + // any_other_asset_loan : [data.any_other_asset_loan], }); } otherBusinessAssetsDescriptionWithData(data) { return this._formBuilder.group({ any_other_assets: [data.any_other_assets], - any_other_asset_value : [data.any_other_asset_value], - any_other_asset_loan : [data.any_other_asset_loan], + // any_other_asset_value : [data.any_other_asset_value], + // any_other_asset_loan : [data.any_other_asset_loan], }); } @@ -519,8 +519,8 @@ export class AssetsInfoComponent implements OnInit { load_Four_WeelerWithData(data) { return this._formBuilder.group({ manufacturer_model_vehicle: [data.manufacturer_model_vehicle], - vehicle_type:[''], - other_vehicle_type:[''] + vehicle_type:[data.vehicle_type], + other_vehicle_type:[data.other_vehicle_type] }); } @@ -611,11 +611,11 @@ export class AssetsInfoComponent implements OnInit { let array_data : any; data.forEach((datas,i) => { array_data = { 'any_other_assets': datas.any_other_assets, - 'name_of_the_owner':datas.name_of_the_owner, - 'other_owner':datas.other_owner, + // 'name_of_the_owner':datas.name_of_the_owner, + // 'other_owner':datas.other_owner, //'relation':datas.relation, - 'any_other_asset_value' : datas.any_other_asset_value, - 'any_other_asset_loan' : datas.any_other_asset_loan, + // 'any_other_asset_value' : datas.any_other_asset_value, + // 'any_other_asset_loan' : datas.any_other_asset_loan, }; this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.any_other_asset_value); }); 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 def41f909..8f1d2edd7 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 @@ -109,6 +109,7 @@ + Select {{ btLen.lender_name }} @@ -120,6 +121,7 @@ + Select {{ prop.name }} @@ -136,6 +138,7 @@ + Select Yes No NA diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html index 8078cc8c1..fcfd379ac 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html @@ -1,5 +1,4 @@
-

{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
@@ -12,9 +11,7 @@

- - @@ -32,6 +29,7 @@ + Select Yes No @@ -40,7 +38,7 @@
- + @@ -84,6 +82,7 @@ + Select Owned Rented @@ -99,9 +98,7 @@
- - @@ -121,18 +118,11 @@ Asset Owned by Required - - - - - Approx Vintage Invalid year format -->
- +
+ Select Yes No @@ -163,73 +154,6 @@
- - - - - -
@@ -250,6 +174,7 @@ + Select {{ asset.name | titlecase }} @@ -267,6 +192,7 @@ + Select {{m_address_type.address_type}} @@ -294,6 +220,7 @@ + Select {{ vehicle.vehicle_type_name }} @@ -328,82 +255,6 @@
- - - - - -
@@ -414,34 +265,9 @@ autocomplete="off">
- -
- - - - - - {{data.viewValue - | titlecase}} - - - - - -
-
-
@@ -451,6 +277,7 @@ + Select Owned Rented @@ -467,8 +294,6 @@
- - @@ -493,9 +318,6 @@ autocomplete="off"> - - - Approx Vintage + Select Yes No @@ -538,11 +361,6 @@ Add More Business Asset
- - @@ -709,7 +527,6 @@
-
- -
Loading....
+ \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts index 6ffb1d997..fcc628537 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts @@ -14,68 +14,57 @@ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; templateUrl: './business-assets-info.component.html', styleUrls: ['./business-assets-info.component.scss'] }) + export class BusinessAssetsInfoComponent implements OnInit { + + /**Declaration of Header Variables */ customer_segment_abbr: any; subproduct_abbr: any; lender_applicant_id: any; main_applicant: any; pageTitle: string = "Assets used for Business"; + + /**Declaration of Form Fields Variables */ pdid: string; + company_id: any; placeholderName: any = 'Was any business activity seen at the Address Type during PD visit?'; - + private notifier: NotifierService; public _businessAssetsQuesFrom: FormGroup; public submitted = false; - public m_assets_type = []; - public applicants: any; + isOtherOwnerForAddress : boolean = false; + isOtherOwner: boolean = false; + loadDetails: boolean; - // businessEmiAmtFlag : boolean = false; - public m_any_asset_loan_type = [{ 'value': "yes", 'viewValue': "Yes" }, - { 'value': "no", 'viewValue': "No" }] - appxMarketAmtInwords: any = []; - appxMarketAmtInwordsForAddress: any = []; - // AssetValueInwords: any = []; - RentAmtInwords: any = []; - RentAmtInwordsForAddress: any = []; - public m_propertyType = []; - PropertyOwnedType: any = []; - private notifier: NotifierService; - existCompanyList: any = []; - mergeCompanyApplicant: any = []; - currentYear: any = new Date().getFullYear(); - addressLabel: any; - public m_address_type = []; - public m_vehicle_type = []; - endUserList = []; CustSegAbbr: any; generalExistBusinessYear: Number; generalExistBusinessMonth: Number; yearErrorMessage: any; monthErrorMessage: any; - isOtherOwnerForAddress : boolean = false; - isOtherOwner: boolean = false; + currentYear: any = new Date().getFullYear(); + addressLabel: any; - 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, - } - }; - company_id: any; + /**Declaration of Dropdown And Array */ + public applicants: any; + public m_any_asset_loan_type = [{ 'value': "yes", 'viewValue': "Yes" }, + { 'value': "no", 'viewValue': "No" }] + public m_assets_type = []; + public m_propertyType = []; + public m_address_type = []; + public m_vehicle_type = []; + PropertyOwnedType: any = []; + existCompanyList: any = []; + mergeCompanyApplicant: any = []; + endUserList = []; + + /**Declaration of amount in words */ + appxMarketAmtInwords: any = []; + appxMarketAmtInwordsForAddress: any = []; + RentAmtInwords: any = []; + RentAmtInwordsForAddress: any = []; + + /**Constructor of the class */ constructor( notifier: NotifierService, private _formBuilder: FormBuilder, @@ -97,7 +86,7 @@ export class BusinessAssetsInfoComponent implements OnInit { this.generalExistBusinessMonth = this.pd_all_details.business_month; } - + /** init Function */ ngOnInit() { // this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => { @@ -139,7 +128,6 @@ export class BusinessAssetsInfoComponent implements OnInit { this.pdTrigerService.retriveForm(params).subscribe(data => { if (data.status == 200) { - this.addressLabel = ''; let selectedAddressType = this.m_address_type.filter(element => element.address_type_id == data.records.address_type)[0]; @@ -179,48 +167,15 @@ export class BusinessAssetsInfoComponent implements OnInit { ) } - // getM_InvestmentType() { - // this.pdTrigerService.getAllMasterDatas('INVESTMENTTYPE').subscribe( - // data => { - // this.m_investmentType = data.records.filter(data => data.isactive == 1); - // }, - // error => { - // this.notifier.notify('warning', 'No Category Records Found.!'); - // // this.m_assets_type = "No Category Records Found."; - // } - // ) - // } - - // getM_FreqOfPurchase() { - // this.pdTrigerService.getAllMasterDatas('FREQUENCY').subscribe( - // data => { - // this.m_freqOfPurchase = data.records.filter(data => data.isactive == 1); - // }, - // error => { - // this.notifier.notify('warning', 'No Category Records Found.!'); - // // this.m_assets_type = "No Category Records Found."; - // } - // ) - // } - + /** Address Type For Dropdown List */ getM_Address_Type() { this.pdTrigerService.getAllMasterDatas('ADDRESSTYPE').subscribe( data => { this.m_address_type = data.records.filter(data => data.isactive == 1); - - // if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){ - - // let index1 = this.m_address_type.map(data => data.address_type).indexOf("Residence"); - // this.m_address_type.splice(index1, 1); - - // let index2 = this.m_address_type.map(data => data.address_type).indexOf("Residence cum Office"); - // this.m_address_type.splice(index2, 1); - - // } - }) } + /** Vehicle Type For Dropdown List */ getM_Vehicle_Type() { this.pdTrigerService.getAllMasterDatas('VEHICLETYPE').subscribe( data => { @@ -234,7 +189,9 @@ export class BusinessAssetsInfoComponent implements OnInit { this.pdTrigerService.getPDFormDetailsWithCompanyID(this.pdid, '22', this.company_id).subscribe( data => { if (data) { + console.log('data.records',data); if (data.dataStatus) { + console.log('data.records',data.records); this.formLoadData(data.records); } else { this.formLoadData(null); @@ -247,7 +204,7 @@ export class BusinessAssetsInfoComponent implements OnInit { ); } - //load Form Data + /** load Form Data */ formLoadData(val) { if (val !== null) { let value = val; @@ -261,45 +218,30 @@ export class BusinessAssetsInfoComponent implements OnInit { business_is_pd_visited: [value.business_is_pd_visited], business_pd_visited_remark: [value.business_pd_visited_remark], business_assets_for_address: this._formBuilder.array([]), - // business_activity:[value.business_activity], - // business_premises_additional_units: this._formBuilder.array([]), business_assets_details: this._formBuilder.array([]), business_assets_form_remark: [value.business_assets_form_remark || null] }); if (value.business_address_availability == 'yes') { + console.log(value.business_assets_for_address); this.addBusinessAssetsForAddress(value.business_assets_for_address); } else { const control = this._businessAssetsQuesFrom.controls['business_assets_for_address']; control.push(this.createBusinessAssetsForAddress()); } - // if(value.business_activity == 'yes'){ - // this.addBusinessUnitsWithData(value.business_premises_additional_units); - // } - // else{ - // const control = this._businessAssetsQuesFrom.controls['business_premises_additional_units']; - // control.push(this.createUnits()); - // } this.addBusinessAssetsDetailsWithData(value.business_assets_details); } else { this._businessAssetsQuesFrom = this._formBuilder.group({ pdid: [this.pdid], formid: ['22'], company_id: [this.company_id], - business_assets_details: this._formBuilder.array([ - this.initBusinessDetails(), - ]), + business_assets_details: this._formBuilder.array([ this.initBusinessDetails() ]), business_years: [''], business_month: [''], business_address_availability: [''], - // business_activity:[''], business_is_pd_visited: [''], business_pd_visited_remark: [''], - business_assets_for_address: this._formBuilder.array([ - this.createBusinessAssetsForAddress()]), - // business_premises_additional_units: this._formBuilder.array([ - // this.createUnits() - // ]), + business_assets_for_address: this._formBuilder.array([ this.createBusinessAssetsForAddress() ]), business_assets_form_remark: [''] }); } @@ -309,10 +251,7 @@ export class BusinessAssetsInfoComponent implements OnInit { // convenience getter for easy access to form fields get f() { return this._businessAssetsQuesFrom.controls; } - // get f_assets_details() { - // return this._businessAssetsQuesFrom.get('assets_details'); - // } - + // Dynamic Form field creation Functionality : START ===> initBusinessDetails() { return this._formBuilder.group({ @@ -328,16 +267,7 @@ export class BusinessAssetsInfoComponent implements OnInit { business_emi: [''], }); } - createUnits(): FormGroup { - return this._formBuilder.group({ - no_of_additional_units: [''], - premises_type: [''], - premises_type_others: [''], - premises_city: [''], - premises_remarks: [''], - }); - } - + createBusinessAssetsForAddress(): FormGroup { return this._formBuilder.group({ business_approximate_market_value: [''], @@ -351,7 +281,6 @@ export class BusinessAssetsInfoComponent implements OnInit { }); } - selectedPropertyOwnedType(e, s, i) { // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(i).get('business_details') as FormArray ; @@ -364,6 +293,7 @@ export class BusinessAssetsInfoComponent implements OnInit { this.PropertyOwnedType[i] = false; } } + show: boolean; selectedAssetsType(e: any, i: any): void { let val = i; @@ -371,6 +301,11 @@ export class BusinessAssetsInfoComponent implements OnInit { arr.controls.splice(0); switch (e.value) { + case '1': { + const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray; + control.push(this.otherBusinessAssetsDescription()); + break; + } case '2': { let val = i; const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray; @@ -387,37 +322,17 @@ export class BusinessAssetsInfoComponent implements OnInit { control.push(this.loadEquipmentManufacturingDescription()); break; } - // case '5': { - // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - // //control.push(this.loadJwellDescription()); - // break; - // } - // case '8': { - // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - // control.push(this.loadConsumerDurableDescription()); - // break; - // } - // case '6': { - // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - // control.push(this.loadInsuranceDescription()); - // break; - // } - // case '7': { - // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - // control.push(this.loadInvestDescription()); - // break; - // } - case '1': { - const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray; - control.push(this.otherBusinessAssetsDescription()); - break; - } default: { break; } } } + loadEquipmentManufacturingDescription() { + return this._formBuilder.group({ + equipment_manufacturing_description: [''] + }); + } loadProperty() { return this._formBuilder.group({ @@ -427,52 +342,6 @@ export class BusinessAssetsInfoComponent implements OnInit { }); } - // loadJwellDescription() { - // return this._formBuilder.group({ - // jwell_description: [''] - // }); - // } - - // loadConsumerDurableDescription() { - // return this._formBuilder.group({ - // consumer_durable_description: [''] - // }); - // } - - loadEquipmentManufacturingDescription() { - return this._formBuilder.group({ - equipment_manufacturing_description: [''] - }); - } - - otherBusinessAssetsDescription() { - return this._formBuilder.group({ - any_other_assets: [''], - // any_other_asset_value: [''], - any_other_asset_loan: [''], - }); - } - - // loadInsuranceDescription() { - // return this._formBuilder.group({ - // //insurance_type: [''], - // premium_paid: [''], - // frequency_mode: [''], - // other_frequency_mode:[''], - // sum_assured: [''], - // members_coverd: [''] - // }); - // } - - // loadInvestDescription() { - // return this._formBuilder.group({ - // investments_type: [''], - // other_investments_type:[''], - // amount_of_invest: [], - // bank_name: [''] - // }); - // } - load_Four_Weeler() { return this._formBuilder.group({ manufacturer_model_vehicle: [''], @@ -482,33 +351,21 @@ export class BusinessAssetsInfoComponent implements OnInit { }); } - // load_Two_Weeler() { - // return this._formBuilder.group({ - // manufacturer_model_vehicle: [''] - // }); - // } + otherBusinessAssetsDescription() { + return this._formBuilder.group({ + any_other_assets: [''], + }); + } + loadPropertyWithData(data) { return this._formBuilder.group({ property_type: [data.property_type], other_property_type: [data.other_property_type], address_of_the_property: [data.address_of_the_property], - //property_type:[''] }); } - // loadJwellDescriptionWithData(data) { - // return this._formBuilder.group({ - // jwell_description: [data.jwell_description] - // }); - // } - - // loadConsumerDurableDescriptionWithData(data) { - // return this._formBuilder.group({ - // consumer_durable_description: [data.consumer_durable_description] - // }); - // } - loadEquipmentManufacturingDescriptionWithData(data) { return this._formBuilder.group({ equipment_manufacturing_description: [data.equipment_manufacturing_description] @@ -518,32 +375,9 @@ export class BusinessAssetsInfoComponent implements OnInit { otherBusinessAssetsDescriptionWithData(data) { return this._formBuilder.group({ any_other_assets: [data.any_other_assets], - // any_other_asset_value: [data.any_other_asset_value], - any_other_asset_loan: [data.any_other_asset_loan], }); } - - // loadInsuranceDescriptionWithData(data) { - // return this._formBuilder.group({ - // //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] - // }); - // } - - // loadInvestDescriptionWithData(data) { - // return this._formBuilder.group({ - // investments_type: [data.investments_type], - // other_investments_type : [data.other_investments_type], - // amount_of_invest: [data.amount_of_invest], - // bank_name: [data.bank_name] - // }); - // } - load_Four_WeelerWithData(data) { return this._formBuilder.group({ manufacturer_model_vehicle: [data.manufacturer_model_vehicle], @@ -552,22 +386,6 @@ export class BusinessAssetsInfoComponent implements OnInit { }); } - // load_Two_WeelerWithData(data) { - // return this._formBuilder.group({ - // manufacturer_model_vehicle: [data.manufacturer_model_vehicle] - // }); - // } - - createUnitswithData(data) { - let formGroup = this._formBuilder.group({ - no_of_additional_units: [data.no_of_additional_units], - premises_type: [data.premises_type], - premises_type_others: [data.premises_type_others], - premises_city: [data.premises_city], - premises_remarks: [data.premises_remarks], - }); - return formGroup; - } createBusinessAssetsForAddressWithData(data): FormGroup { return this._formBuilder.group({ @@ -592,17 +410,16 @@ export class BusinessAssetsInfoComponent implements OnInit { business_monthly_rented_amt: [data.business_monthly_rented_amt], business_name_of_the_owner: [data.business_name_of_the_owner], business_name_of_the_other_owner: [data.business_name_of_the_other_owner || ''], - // relation: [data.relation || ''], business_vintage: [data.business_vintage], business_purchase_year: [data.business_purchase_year, Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])], - // purchase_month: [data.purchase_month], business_emi: [data.business_emi || ''], }); return formGroup; } - loadDetails: boolean; + addBusinessAssetsForAddress(data) { + console.log(data); var result = Object.keys(data).map(function (key) { return data[key]; }); @@ -620,6 +437,7 @@ export class BusinessAssetsInfoComponent implements OnInit { }); } this.isOtherOwnerForAddress = Avaliablity == 0 ? true : false; + }); for (let val of result) { @@ -641,31 +459,7 @@ export class BusinessAssetsInfoComponent implements OnInit { control.push(this.createBusinessAssetsForAddress()); } } - // addBusinessUnitsWithData(data){ - - // var result = Object.keys(data).map(function (key) { - // return data[key]; - // }); - - // if (result.length > 0) { - // for (let val of result) { - // let vals = { - // no_of_additional_units: val.no_of_additional_units, - // premises_type: val.premises_type, - // premises_type_others: val.premises_type_others, - // premises_city: val.premises_city, - // premises_remarks: val.premises_remarks, - // }; - // const control = this._businessAssetsQuesFrom.controls['business_premises_additional_units']; - // control.push(this.createUnitswithData(vals)); - // } - // }else{ - // const control = this._businessAssetsQuesFrom.controls['business_premises_additional_units']; - // control.push(this.createUnits()); - // } - - // } - + addBusinessAssetsDetailsWithData(supp_data) { var result = Object.keys(supp_data).map(function (key) { @@ -677,15 +471,9 @@ export class BusinessAssetsInfoComponent implements OnInit { this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value); this.RentAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_monthly_rented_amt); let Avaliablity = 1; - // console.log(datas.business_name_of_the_owner); - // datas.business_name_of_the_owner.forEach(option => { - // if(option.id == 0 && option.group_id == 2){ - // Avaliablity = option.id; - // } - // }); - this.isOtherOwner = Avaliablity == 0 ? true : false; - // .business_assets_details['controls'] - // this.setRequiredValidation(datas.business_name_of_the_owner, item, 4); + + this.isOtherOwner = Avaliablity == 0 ? true : false; + }); for (let val of result) { @@ -718,11 +506,19 @@ export class BusinessAssetsInfoComponent implements OnInit { arr.controls.splice(0); switch (assets_details_mode) { + case '1': { + let array_datas: any; + data.forEach((datas, i) => { + array_datas = { 'any_other_assets': datas.any_other_assets }; + }); + const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray; + control.push(this.otherBusinessAssetsDescriptionWithData(array_datas)); + break; + } case '2': { let business_property_datas: any; data.forEach((datas, i) => { business_property_datas = { 'property_type': datas.property_type, 'other_property_type': datas.other_property_type, 'address_of_the_property': datas.address_of_the_property }; - // this.selectedPropertyOwnedType(datas.properties_ownership_type,i,val); }); const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray; control.push(this.loadPropertyWithData(business_property_datas)); @@ -746,62 +542,6 @@ export class BusinessAssetsInfoComponent implements OnInit { control.push(this.loadEquipmentManufacturingDescriptionWithData(equipment_manufacturing_description_datas)); break; } - // case '4': { - // break; - // } - // case '5': { - // let business_ConsumerDurableDescription_datas : any; - // data.forEach((datas,i) => { - // business_ConsumerDurableDescription_datas = { 'consumer_durable_description': datas.consumer_durable_description }; - // }); - // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - // control.push(this.loadConsumerDurableDescriptionWithData(business_ConsumerDurableDescription_datas)); - // break; - // } - // case '6': { - // let business_InsuranceDescription_datas : any; - // data.forEach((datas,i) => { - // this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid); - // this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured); - // business_InsuranceDescription_datas = { - // 'premium_paid': datas.premium_paid, - // 'frequency_mode': datas.frequency_mode, - // 'other_frequency_mode':datas.other_frequency_mode, - // 'sum_assured': datas.sum_assured, - // 'members_coverd': datas.members_coverd - // }; - // }); - // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - // control.push(this.loadInsuranceDescriptionWithData(business_InsuranceDescription_datas)); - // break; - // } - // case '7': { - // let business_InvestDescription_datas : any; - // data.forEach((datas,i) => { - // this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest); - // business_InvestDescription_datas = { 'investments_type': datas.investments_type, - // 'other_investments_type' : datas.other_investments_type, - // 'amount_of_invest': datas.amount_of_invest, - // 'bank_name': datas.bank_name }; - // }); - // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - // control.push(this.loadInvestDescriptionWithData(business_InvestDescription_datas)); - // break; - // } - case '1': { - let array_datas: any; - data.forEach((datas, i) => { - // this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value); - array_datas = { - 'any_other_assets': datas.any_other_assets, - // 'any_other_asset_value': datas.any_other_asset_value, - 'any_other_asset_loan': datas.any_other_asset_loan, - }; - }); - const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray; - control.push(this.otherBusinessAssetsDescriptionWithData(array_datas)); - break; - } default: { break; } @@ -827,13 +567,13 @@ export class BusinessAssetsInfoComponent implements OnInit { public paymentModeTextBox: number; selectedPM(e) { this.paymentModeTextBox = e.value; - // this.f.supplier_details.controls.get('payment_mode_value'); } public freqPurchaseTextBox: number; selectedFreqPurchase(e) { this.freqPurchaseTextBox = e.value; } + // // compare objects for merge two master table details compareObjects(o1: any, o2: any) { if (o1.id == o2.id && o1.group_id == o2.group_id) @@ -841,27 +581,6 @@ export class BusinessAssetsInfoComponent implements OnInit { else return false } - // // check others - // checkOthers(values) { - // if (values != null) { - // return values.id == 0 ? true : false; - // } - // else { - // return false; - // } - - // } - - // checkOthers2(values) { - // if (values != null) { - // return values.id == 0 ? true : false; - // } - // else { - // return false; - // } - - // } - // calculate vintage and purchase {} calculateVintagePurchase(value: any, controlKey: any, type: number) { if (type == 1) { @@ -895,12 +614,6 @@ export class BusinessAssetsInfoComponent implements OnInit { } else { var answerFormValues = this._businessAssetsQuesFrom.value; let dataOwner_name = []; - // console.log('answerFormValues',answerFormValues); - - // this.loanDetailsForm.controls['owner_name'].value.forEach(element => { - // dataOwner_name.push({ owner_name: element }) - // }); - // records.owner_name_group = dataOwner_name; //To Remove The "Null" With Key also Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); @@ -922,13 +635,6 @@ export class BusinessAssetsInfoComponent implements OnInit { } } - /** To Reset Popup Data */ - // onReset() { - // const arr = this._businessAssetsQuesFrom.controls.business_assets_details; - // arr.controls.splice(0); - // this.getPdSupplierFormDetails(); - // } - /** On Key Press Event For Number only Accepting */ keyPress(event: any) { const pattern = /[0-9]/; @@ -939,17 +645,6 @@ export class BusinessAssetsInfoComponent implements OnInit { } } - // ConvertMonthintoYear(e){ - - // let business_year = this._businessAssetsQuesFrom.controls.business_years.value; - - // let converted_month : number = e%12; - // let converted_year : number = e/12; - - // this._businessAssetsQuesFrom.controls.business_years.setValue(+business_year + +Math.floor(converted_year)); - // this._businessAssetsQuesFrom.controls.business_month.setValue(Math.floor(converted_month)); - - // } /** To Convert Month into Year */ ConvertMonthintoYear(e) { @@ -995,42 +690,29 @@ export class BusinessAssetsInfoComponent implements OnInit { } setRequiredValidation(value, item, flag) { + console.log('controls',item); if (flag == 1) { if (value == 'yes') { - this._businessAssetsQuesFrom.controls.business_years.setValidators([Validators.required]); - + this._businessAssetsQuesFrom.controls.business_years.setValidators([Validators.required]); this._businessAssetsQuesFrom.controls.business_address_availability.setValidators([Validators.required]); - // this._businessAssetsQuesFrom.controls.business_activity.setValidators([Validators.required]) ; this._businessAssetsQuesFrom.controls.business_is_pd_visited.setValidators([Validators.required]); this._businessAssetsQuesFrom.controls.business_pd_visited_remark.setValidators([Validators.required]); - // this._businessAssetsQuesFrom.controls.business_activity.setValidators([Validators.required]) ; + } else { this._businessAssetsQuesFrom.controls.business_years.clearValidators(); - this._businessAssetsQuesFrom.controls.business_address_availability.clearValidators(); - // this._businessAssetsQuesFrom.controls.business_activity.clearValidators(); this._businessAssetsQuesFrom.controls.business_is_pd_visited.clearValidators(); this._businessAssetsQuesFrom.controls.business_pd_visited_remark.clearValidators(); - // this._businessAssetsQuesFrom.controls.business_activity.clearValidators(); + } this._businessAssetsQuesFrom.controls.business_years.updateValueAndValidity(); - this._businessAssetsQuesFrom.controls.business_address_availability.updateValueAndValidity(); - // this._businessAssetsQuesFrom.controls.business_activity.updateValueAndValidity(); this._businessAssetsQuesFrom.controls.business_is_pd_visited.updateValueAndValidity(); this._businessAssetsQuesFrom.controls.business_pd_visited_remark.updateValueAndValidity(); - // this._businessAssetsQuesFrom.controls.business_activity.updateValueAndValidity(); - - + } - // if(flag == 2){ - // value==1 - // ? item.controls.premises_type_others.setValidators([Validators.required]) - // : item.controls.premises_type_others.clearValidators(); - // item.controls.premises_type_others.updateValueAndValidity(); - // } if (flag == 3) { if (value == 'owned') { item.controls.business_monthly_rented_amt.clearValidators(); @@ -1063,10 +745,6 @@ export class BusinessAssetsInfoComponent implements OnInit { item.controls.business_name_of_the_other_owner.updateValueAndValidity(); - // value == 0 - // ? item.controls.business_name_of_the_other_owner.setValidators([Validators.required]) - // : item.controls.business_name_of_the_other_owner.clearValidators(); - // item.controls.business_name_of_the_other_owner.updateValueAndValidity(); } if (flag == 5) { value == 1 @@ -1101,17 +779,16 @@ export class BusinessAssetsInfoComponent implements OnInit { let Avaliablity = 1; value.forEach(option => { if(option.id == 0 && option.group_id == 2){ - // console.log('true'); Avaliablity = option.id; } }); - // isOtherOwner: boolean = false; + if(Avaliablity == 0){ - // console.log(Avaliablity); + item.controls.business_name_of_the_other_owner.setValidators([Validators.required]); this.isOtherOwnerForAddress = true; }else{ - // console.log(Avaliablity); + item.controls.business_name_of_the_other_owner.setValue(''); item.controls.business_name_of_the_other_owner.clearValidators(); this.isOtherOwnerForAddress = false; @@ -1123,41 +800,6 @@ export class BusinessAssetsInfoComponent implements OnInit { } -// endUserChange(event) { - -// this.endUserList = []; -// - -// event.forEach(option => { -// // let othersData = this.m_endUseofLoad.filter(sub=>sub.subproduct_id==option)[0]; -// let othersData = this.m_endUseForLoan.filter(sub => sub.enduse_of_loan_id == option)[0]; - -// OthersAvaliable = othersData.enduse_of_loan.substr(0, 6).toLowerCase(); - -// this.endUserList.push({ end_use: option }); -// }); - -// if (OthersAvaliable == 'others') { -// this.isOtherPurpose = true; -// this.loanDetailsForm.controls['end_use_other'].setValidators([Validators.required]); - -// } else { -// this.loanDetailsForm.controls['end_use_other'].clearValidators(); -// this.isOtherPurpose = false; -// } -// this.loanDetailsForm.controls['end_use_other'].updateValueAndValidity(); -// //this.isOtherPurpose = event.some(e => e == 'others') // this return true or false Only; -// } - - // addUnits() { - // const control = this._businessAssetsQuesFrom.controls['business_premises_additional_units']; - // control.push(this.createUnits()); - // } - - // removeUnits(index) { - // const control = this._businessAssetsQuesFrom.controls['business_premises_additional_units']; - // control.removeAt(index); - // } selectedAddressType(e: any) { this.placeholderName = 'Was any business activity seen at the ' + e + ' during PD visit?'; @@ -1169,24 +811,6 @@ export class BusinessAssetsInfoComponent implements OnInit { case 1: this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); break; - // case 2 : - // this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - // break; - // case 3 : - // this.emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - // break; - // case 4 : - // this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - // break; - // case 5 : - // this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - // break; - // case 6: - // this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - // break; - // case 7 : - // this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - // break; case 8: this.RentAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); break; @@ -1202,22 +826,25 @@ export class BusinessAssetsInfoComponent implements OnInit { } -} -// let ownername: any = []; -// if (value.records.owner_name_group != null) { -// let owner = Object.keys(value.records.owner_name_group).map(function (key) { -// return value.records.owner_name_group[key]; -// }); + /** For Docs Tab */ + 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, + } + }; - -// owner.forEach(val => { -// ownername.push(val.business_name_of_the_owner); -// if (val.business_name_of_the_owner == 'Others') { -// this.OtherOwnerFlag = true; -// } -// else { -// this.OtherOwnerFlag = false; -// } -// }); -// } -// this.loanDetailsForm.controls['business_name_of_the_owner'].setValue(owner); \ No newline at end of file +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html index be3132419..3fe220cc1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html @@ -24,6 +24,9 @@

Banking Details #{{i+1}}

+ @@ -40,7 +43,8 @@ - {{ btLen.lender_name }} + Select + {{ btLen.lender_name }} @@ -51,6 +55,7 @@ + Select {{ prop.name }} @@ -58,6 +63,7 @@ + Select Yes No @@ -67,6 +73,7 @@ + Select Yes No NA @@ -108,7 +115,8 @@
-
@@ -116,9 +124,9 @@ + --> diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html index 65267133c..a74cb1ed0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html @@ -57,7 +57,7 @@
- Select + Select Yes No @@ -116,6 +116,7 @@ + Select {{title.name}} @@ -136,6 +137,7 @@ + Select {{member.name + ' of' | titlecase}} @@ -147,7 +149,8 @@ - {{appc.applicant_name | titlecase}} + Select + {{appc.applicant_name | titlecase}} @@ -158,6 +161,7 @@ + Select {{comrelShip.name}} @@ -169,7 +173,7 @@ - Select + Select Yes No @@ -300,6 +304,7 @@ Countries Where The Export Is Being Done for {{manufacturing.value.main_products}} + Select {{CL.country_name}} @@ -1203,14 +1208,34 @@ No - - + + Yes No - + + + + + + +
+
+ + + Select + {{ b.lender_name }} + + + + + +
+
+
+
- @@ -1222,7 +1247,7 @@ Yes - No Major Changes In Sales + No Major Changes In Sales
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts index b54ee3b53..e6c418c2a 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts @@ -48,6 +48,7 @@ export class BusinessInfoComponent implements OnInit { activityData: any = []; stateList: any = []; countryDataList : any = []; + bankList = []; relativeNames: any; applicants: any; @@ -86,6 +87,9 @@ export class BusinessInfoComponent implements OnInit { WholeSalesChecked: boolean; ServiceChecked: boolean; + temp_noofposmachine : any; + temp_additiondetailofposmachine : any = []; + constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, @@ -141,6 +145,7 @@ export class BusinessInfoComponent implements OnInit { this.getCompanyRelation(); this.getTitle(); this.getAllPersons(); + this.getBank(); // const Desgn = this.businessForm.controls['designation']; // const Partnr = this.businessForm.controls['partners']; // const otherDoc = this.businessForm.controls['documents']; @@ -162,6 +167,7 @@ export class BusinessInfoComponent implements OnInit { const wholesaleControl: any = this.businessForm.controls['wholesale_trading_activity_details']; const serviceProviderControl: any = this.businessForm.controls['service_provider_activity_details']; const othersControl: any = this.businessForm.controls['others_activity_details']; + if (data.status == 200) { let DocArray: any; // let DesgnArray = Object.keys(data.records.designation).map(function (key) { @@ -356,6 +362,9 @@ export class BusinessInfoComponent implements OnInit { selectedRetail.length > 0 ? this.businessForm.addControl('export_import_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('export_import_cert'); selectedRetail.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl('')) : this.businessForm.removeControl('applicant_use_mobile_wallets'); selectedRetail.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl('')) : this.businessForm.removeControl('applicant_use_pos_machines'); + selectedRetail.length > 0 && businessVal.applicant_use_pos_machines == 'yes' ? this.businessForm.addControl('no_of_pos_machines', new FormControl('')): this.businessForm.removeControl('no_of_pos_machines'); + selectedRetail.length > 0 && businessVal.applicant_use_pos_machines == 'yes' ? this.businessForm.addControl('pos_machines_details', this.fb.array([])) : this.businessForm.removeControl('pos_machines_details'); + selectedRetail.forEach((element,index)=>{ this.CheckExport(element.area_of_sale,'RActivity',index); retailControl.push(this.createActivity()); @@ -418,6 +427,9 @@ export class BusinessInfoComponent implements OnInit { selectedWholesale.length > 0 ? this.businessForm.addControl('export_import_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('export_import_cert'); selectedWholesale.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl('')) : this.businessForm.removeControl('applicant_use_mobile_wallets'); selectedWholesale.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl('')) : this.businessForm.removeControl('applicant_use_pos_machines'); + selectedWholesale.length > 0 && businessVal.applicant_use_pos_machines == 'yes' ? this.businessForm.addControl('no_of_pos_machines', new FormControl('')): this.businessForm.removeControl('no_of_pos_machines'); + selectedWholesale.length > 0 && businessVal.applicant_use_pos_machines == 'yes' ? this.businessForm.addControl('pos_machines_details', this.fb.array([])) : this.businessForm.removeControl('pos_machines_details'); + selectedWholesale.forEach((element,index)=>{ this.CheckExport(element.area_of_sale,'WActivity',index); wholesaleControl.push(this.createActivity()); @@ -482,6 +494,9 @@ export class BusinessInfoComponent implements OnInit { selectedService.length > 0 ? this.businessForm.addControl('practice_cert', new FormControl('', Validators.required)) : this.businessForm.removeControl('practice_cert'); selectedService.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl('')) : this.businessForm.removeControl('applicant_use_mobile_wallets'); selectedService.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl('')) : this.businessForm.removeControl('applicant_use_pos_machines'); + selectedService.length > 0 && businessVal.applicant_use_pos_machines == 'yes' ? this.businessForm.addControl('no_of_pos_machines', new FormControl('')): this.businessForm.removeControl('no_of_pos_machines'); + selectedService.length > 0 && businessVal.applicant_use_pos_machines == 'yes' ? this.businessForm.addControl('pos_machines_details', this.fb.array([])) : this.businessForm.removeControl('pos_machines_details'); + selectedService.forEach((element,index)=>{ this.CheckExport(element.area_of_sale,'SPActivity',index); serviceProviderControl.push(this.createServiceActivity()); @@ -556,10 +571,15 @@ export class BusinessInfoComponent implements OnInit { } else { businessVal.others_activity_details=[]; - } - - this.businessForm.setValue(businessVal); + if(businessVal.applicant_use_pos_machines == 'yes'){ + this.businessForm.controls.no_of_pos_machines.setValue(businessVal.no_of_pos_machines); + const posControl: any = this.businessForm.controls['pos_machines_details']; + for(let i = 1; i<= businessVal.no_of_pos_machines; i++ ){ + posControl.push(this.createPOSMachinesDetails(businessVal.pos_machines_details)); + } + } + this.businessForm.setValue(businessVal); } else { //Desgn.push(this.createDesignation()); Partnr.push(this.createPartners()); @@ -722,6 +742,10 @@ export class BusinessInfoComponent implements OnInit { this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl(this.businessForm.value.applicant_use_mobile_wallets)) : this.businessForm.removeControl('applicant_use_mobile_wallets'); this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl(this.businessForm.value.applicant_use_pos_machines)) : this.businessForm.removeControl('applicant_use_pos_machines'); + if(this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0){ + this.changePOSMachinesAvailablity(this.businessForm.value.applicant_use_pos_machines,2); + } + if(this.ManufacturingChecked && this.RetailedChecked && this.WholeSalesChecked && this.ServiceChecked){ this.ExportFlag = false; } @@ -1089,6 +1113,14 @@ export class BusinessInfoComponent implements OnInit { }) }); } + + getBank(){ + this._pd.getAllMasterDatas('BTLENDERLIST').subscribe( + data => { + this.bankList = data.records.filter(data => data.isactive == 1 && data.lender_type == 1); + }) + } + // get title master getTitle() { let master_name = 'TITLES'; @@ -1159,9 +1191,7 @@ export class BusinessInfoComponent implements OnInit { // if(this.businessForm.controls.partners['controls'].length > 1) - // { - // console.log('asd'); - // } + // {} if(this.businessEntityTypeList.business_entity_type_name == 'OPC (One Person Company)' || this.businessEntityTypeList.business_entity_type_name == 'Sole proprietorship'){ this.EntityTypeFlag = true; @@ -1201,7 +1231,6 @@ export class BusinessInfoComponent implements OnInit { data.records.forEach(val => { if (val.isactive == 1) { this.countryDataList.push(val); - // console.log(this.countryDataList); } }) }); @@ -1836,5 +1865,55 @@ CheckExport(value,stringFlag,index){ } } + changePOSMachinesAvailablity(e,flag){ + + e == 'yes' + ? this.businessForm.addControl('no_of_pos_machines', new FormControl('')) + : this.businessForm.removeControl('no_of_pos_machines'); + + if(flag == 2){ + e == 'yes' + ? this.businessForm.controls.no_of_pos_machines.setValue(this.temp_noofposmachine) + : this.businessForm.removeControl('no_of_pos_machines'); + } + + } + toGetPOSMachinesDetails(e,flag){ + + if(flag == 1){ this.businessForm.addControl('pos_machines_details', this.fb.array([])); } + const control = this.businessForm.controls['pos_machines_details']; + + while (control.length !== 0) { + control.removeAt(0); + } + + if(e > 0 ){ + if(flag == 1){ + for(let i = 1 ; i<= e ; i++ ){ + control.push(this.createPOSMachinesDetails(null)); + } + } + else if(flag == 2){ + for(let i = 1 ; i<= e ; i++ ){ + control.push(this.createPOSMachinesDetails(this.temp_additiondetailofposmachine)); + } + } + } + } + + createPOSMachinesDetails(data){ + if(data == null){ + return this.fb.group({ + pos_machines_financial_institution_name: [''], + tid_no_of_pos_machine: [''], + }); + } + else if(data != null) { + return this.fb.group({ + pos_machines_financial_institution_name: [data.pos_machines_financial_institution_name], + tid_no_of_pos_machine: [data.tid_no_of_pos_machine], + }); + } + } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html index 42bd65146..a0140fec6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html @@ -22,6 +22,7 @@
+ Select {{ pm.name }} @@ -36,6 +37,7 @@
+ Select {{tl.name}} @@ -77,12 +79,14 @@ {{ pm.name }} --> + Select {{ pm.name }} + Select Payment received in Cash. Payment received through Banking channels. @@ -135,6 +139,7 @@
+ Select {{ pm.name }} @@ -148,6 +153,7 @@
+ Select {{tl.name}} @@ -190,12 +196,14 @@ {{ pm.name }} --> + Select {{ pm.name }} + Select Payment received in Cash. Payment received through Banking channels. @@ -249,6 +257,7 @@
+ Select {{ pm.name }} @@ -262,6 +271,7 @@ --> + Select {{tl.name}} @@ -303,12 +313,14 @@ {{ pm.name }} --> + Select {{ pm.name }} + Select Payment received in Cash. Payment received through Banking channels. 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 7c9e8b6b8..0b36181b6 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 @@ -26,6 +26,7 @@ + Select Yes No @@ -44,6 +45,7 @@ + Select {{types.loan_type_name}} @@ -57,6 +59,7 @@ + Select {{ btLen.lender_name }} @@ -84,7 +87,8 @@ + formControlName="frequency" > + Select {{freq.name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts index 4c8bd7dae..2f75c964a 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts @@ -148,7 +148,6 @@ export class CurrentLoanComponent implements OnInit { result.forEach((val,index) => { this.amtInwords[index] = this._pd.convertNumberToWords(val.loan_amount); this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi); - control.push(this.createLoanDetail(null)); this.selectedfrequency(val.frequency,index); //this.selectedLoanTakenBy(val.loan_taken_by,index); }); @@ -167,7 +166,6 @@ export class CurrentLoanComponent implements OnInit { let AssetData = data.record; - if(AssetData.business_assets.length>0){ AssetData.business_assets.map(element => { @@ -204,15 +202,25 @@ export class CurrentLoanComponent implements OnInit { if(val.mode == 1){ let data; + let owner val.details.forEach((v,index) => { data = v.any_other_assets; }); + if(val.form_type == 'Data From Business Assets'){ + owner = val.owner_name.map((e => { + return e.name.split(',') + })); + } + else { + owner = val.owner_name; + } let description = data != '' ? ' ( '+ data +' )' : ''; - labelarray[index] = ' : '+val.owner_name +' - '+ val.mode_name + description; + labelarray[index] = ' : '+owner +' - '+ val.mode_name + description; } if(val.mode == 2){ let data; + let owner; val.details.forEach((v,index) => { data = v.property_type; if(v.property_type != 1){ @@ -228,41 +236,81 @@ export class CurrentLoanComponent implements OnInit { }else{ data=v.other_property_type; } + if(val.form_type == 'Data From Business Assets'){ + owner = val.owner_name.map((e => { + return e.name.split(',') + })); + } + else { + owner = val.owner_name; + } - }); let description = data != '' ? ' ( '+ data +' )' : ''; - labelarray[index] = ' : '+val.owner_name +' - '+ val.mode_name + description; + labelarray[index] = ' : '+owner +' - '+ val.mode_name + description; } if(val.mode == 3){ - let data; + let data;let owner; val.details.forEach((v,index) => { data = v.manufacturer_model_vehicle; }); + if(val.form_type == 'Data From Business Assets'){ + owner = val.owner_name.map((e => { + return e.name.split(',') + })); + } + else { + owner = val.owner_name; + } let description = data != '' ? ' ( '+ data +' )' : ''; - labelarray[index] = ' : '+val.owner_name +' - '+ val.mode_name + description; + labelarray[index] = ' : '+owner +' - '+ val.mode_name + description; } if(val.mode == 4){ - let data; + let data;let owner; val.details.forEach((v,index) => { data = v.equipment_manufacturing_description; }); + if(val.form_type == 'Data From Business Assets'){ + owner = val.owner_name.map((e => { + return e.name.split(',') + })); + } + else { + owner = val.owner_name; + } let description = data != '' ? ' ( '+ data +' )' : ''; - labelarray[index] = ' : '+val.owner_name +' - '+ val.mode_name + description; + labelarray[index] = ' : '+owner +' - '+ val.mode_name + description; } if(val.mode == 6){ - labelarray[index] = ' : '+val.owner_name+' - '+ val.mode_name; + let owner + if(val.form_type == 'Data From Business Assets'){ + owner = val.owner_name.map((e => { + return e.name.split(',') + })); + } + else { + owner = val.owner_name; + } + labelarray[index] = ' : '+owner+' - '+ val.mode_name; } if(val.mode == 7){ - let data; + let data;let owner; val.details.forEach((v,index) => { data = v.investments_type != 1 ? this.investmentTypeData.filter(data => data.id == v.investments_type)[0].name : v.other_investments_type ; }); + if(val.form_type == 'Data From Business Assets'){ + owner = val.owner_name.map((e => { + return e.name.split(',') + })); + } + else { + owner = val.owner_name; + } let description = data != '' ? '( '+ data +' )' : ''; - labelarray[index] = ' : '+val.owner_name +' - '+ val.mode_name + description; + labelarray[index] = ' : '+owner +' - '+ val.mode_name + description; } }); const control = this.currentLoanForm.controls['loan_details']; @@ -445,7 +493,6 @@ export class CurrentLoanComponent implements OnInit { if (records.existing_loan == 'Yes') { records.loan_details = this.currentLoanForm.controls['loan_details'].value; } - // console.log('data', records); this._pd.saveForm(records).subscribe(data => { if(data.status == 200) { this.notifier.notify('success', 'Saved Successfully.'); @@ -518,7 +565,6 @@ export class CurrentLoanComponent implements OnInit { } } setRequiredValidation(value,item,flag) { - if(flag == 1){ value==1 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html index 2c914bda6..bf5383f5d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/employment-info/employment-info.component.html @@ -35,6 +35,7 @@ + Select Yes No @@ -50,6 +51,7 @@ + Select Yes No @@ -60,6 +62,7 @@ + Select Yes No @@ -67,6 +70,7 @@ + Select Yes No @@ -98,6 +102,7 @@ + Select {{ fd.name }} @@ -105,6 +110,7 @@ + Select Fixed Variable depending on performance Others @@ -116,6 +122,7 @@ + Select Yes No diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html index 4487221b8..e508f58cb 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html @@ -1,264 +1,3 @@ - - - -

{{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
@@ -283,6 +22,7 @@
+ Select {{person.applicant_name}} @@ -294,6 +34,7 @@
Residence Details of {{FamilyMemberAsLabel[ix]}}
+ Select {{s.name}} @@ -301,6 +42,7 @@ + Select {{c.city_name}} @@ -311,6 +53,7 @@ + Select {{p.pincode}} @@ -336,6 +79,7 @@ + Select {{ownerShip.name}} @@ -369,6 +113,7 @@ + Select {{relation.name}} @@ -381,6 +126,7 @@
+ Select {{earnings.type}} @@ -390,6 +136,7 @@
+ Select {{earn.earning_member_status}} @@ -403,7 +150,7 @@ {{"₹"}} {{IncomePerMonth[i]}} Only - + + Select {{occupation.name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts index 17bbd303f..fadbf148e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts @@ -1,382 +1,93 @@ -// import { -// Component, -// OnInit, -// Inject, -// Input, Output -// } from '@angular/core'; +import { Component,OnInit,Inject,Input, Output } from '@angular/core'; -// import { -// FormBuilder, -// FormGroup, -// Validators, -// FormArray, FormControl, AbstractControl, -// } from '@angular/forms'; - -// import { NotifierService } from 'angular-notifier'; - -// import { -// MatDialog, -// MatDialogRef, -// MAT_DIALOG_DATA -// } from '@angular/material'; -// /** Service */ -// import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; -// import {ActivatedRoute, Router} from "@angular/router"; - -// @Component({ -// selector: 'app-family-details', -// templateUrl: './family-details.component.html', -// styleUrls: ['./family-details.component.scss'] -// }) -// export class FamilyDetailsComponent implements OnInit { -// //@Input() pdid: number; -// pageTitle: string ="Other Family Details"; -// pdid : string; -// form_id : number; - -// private notifier: NotifierService; -// public familyForm: FormGroup; -// public selectPerson; -// // selectPerson = [{ -// // name : 'person 1', -// // id : 111 -// // }, { -// // name : 'person 2', -// // id : 222 -// // }]; - -// earningStatus = [{ -// type: 'Earning', -// id: 1 -// }, { -// type: 'Non Earning', -// id: 2 -// }] - -// relationData: any = []; -// occupationData: any = []; -// //personMetData: any = []; -// ownerShipData: any = []; -// customerSegData: any = []; -// // earnMemberArrCount :any ; -// // nonEarnMemberArrCount :any ; -// count : number; -// constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, -// private router: Router, -// private _pd: PdTrigerService, -// @Inject(MAT_DIALOG_DATA) public pd_all_details: any) { -// console.log(pd_all_details); -// this.selectPerson = this.pd_all_details.pdapplicants_detials; -// this.pdid = this.pd_all_details.pdmaster_details.pd_id; -// this.form_id = 6; -// this.notifier = notifier; -// } -// ngOnInit() { -// this.getMasterDetails('RELATIONSHIPS',1); -// this.getMasterDetails('OCCUPATIONMEMBERS',2); -// //this.getMasterDetails('PERSONSMET',3); -// this.getMasterDetails('RESIDENCEOWNERSHIP',4); -// this.getMasterDetails('CUSTOMERSEGMENT',5); -// this.initFamilyForm(); -// let params: any = {}; -// params.pd_id = this.pdid; -// params.pd_form_id = '6'; -// this._pd.retriveForm(params).subscribe(data => { -// const control = this.familyForm.controls['nonEarningMembers']; -// const value = this.familyForm.controls['earningMembers']; -// if (data.status == 200) { -// this.familyForm.controls.selected_person.setValue(data.records.selected_person); -// this.familyForm.controls.residence_place.setValue(data.records.residence_place); -// this.familyForm.controls.residence_city.setValue(data.records.residence_city); -// this.familyForm.controls.residence_state.setValue(data.records.residence_state); -// this.familyForm.controls.residence_pin.setValue(data.records.residence_pin); -// this.familyForm.controls.residence_No_of_years.setValue(data.records.residence_No_of_years); -// this.familyForm.controls.residence_ownership.setValue(data.records.residence_ownership); -// this.familyForm.controls.ownershipOther.setValue(data.records.ownershipOther); -// this.familyForm.controls.rent.setValue(data.records.rent); -// this.familyForm.controls.total_number_of_family_members.setValue(data.records.total_number_of_family_members); -// this.familyForm.controls.family_details_form_remark.setValue(data.records.family_details_form_remark); -// this.generateFamilyMembersDetailsGetData(data.records.family_members_details); -// } else { -// // value.push(this.createMembers()); -// // control.push(this.createNonMembers()); -// } -// }); -// } - -// initgenerateFamilyMembersDetailsGet(val): FormGroup { -// return this.fb.group({ -// family_member_name : [val.family_member_name, Validators.compose([])], -// family_member_relationship : [val.family_member_relationship, Validators.compose([])], -// family_member_age : [val.family_member_age, Validators.compose([])], -// family_member_earning_status : [val.family_member_earning_status, Validators.compose([])], -// earning_segment: [val.earning_segment, Validators.compose([])], -// earning_gross_income_per_month: [val.earning_gross_income_per_month, Validators.compose([])], -// earning_name_of_the_employer_or_business: [val.earning_name_of_the_employer_or_business, Validators.compose([])], -// earning_number_of_years_in_employment_or_business: [val.earning_number_of_years_in_employment_or_business, Validators.compose([])], -// non_earning_occupation: [val.non_earning_occupation, Validators.compose([])], -// non_earning_if_others: [val.non_earning_if_others, Validators.compose([])], -// non_earning_if_retired_from: [val.non_earning_if_retired_from, Validators.compose([])], -// }) -// } - -// generateFamilyMembersDetailsGetData(data) { -// var result = Object.keys(data).map(function (key) { -// return data[key]; -// }); -// if (result.length > 0) { -// for (let val of result) { -// const control = this.familyForm.controls['family_members_details']; -// control.push(this.initgenerateFamilyMembersDetailsGet(val)); -// } -// } -// } - -// onSearchChange(e):void { -// e.preventDefault(); -// } -// public initFamilyForm(): void { -// this.familyForm = this.fb.group({ -// selected_person: ['', Validators.compose([Validators.required])], -// residence_place: ['', Validators.compose([])], -// residence_city: ['', Validators.compose([])], -// residence_state: ['', Validators.compose([])], -// residence_pin: ['', Validators.compose([])], -// residence_No_of_years: ['', Validators.compose([])], -// residence_ownership: ['', Validators.compose([])], -// ownershipOther: [''], -// rent: [''], -// total_number_of_family_members: ['', Validators.compose([Validators.min(1), Validators.max(20)])], -// family_members_details: this.fb.array([]), -// family_details_form_remark: [''] -// }); -// } - - -// getNumberOfFamilyMemberDetails(){ -// // alert(this.familyForm.controls.total_number_of_family_members.valid); -// if(this.familyForm.controls.total_number_of_family_members.valid){ -// let totalMem = this.familyForm.get('total_number_of_family_members').value; -// const control = this.familyForm.controls.family_members_details; -// if(totalMem > control.length) { -// let len = totalMem - control.length; -// for(let i = 0; i < len; i++){ -// control.push(this.generateFamilyMembersDetailsGet()); -// } -// } else if (totalMem < control.length) { -// // control.controls.slice(0, totalMem); -// control.controls = []; -// for(let i = 0; i < totalMem; i++){ -// control.push(this.generateFamilyMembersDetailsGet()); -// } -// } -// } else { - -// } -// } - -// generateFamilyMembersDetailsGet(): FormGroup { -// return this.fb.group({ -// family_member_name : ['', Validators.compose([])], -// family_member_relationship : ['', Validators.compose([])], -// family_member_age : ['', Validators.compose([])], -// family_member_earning_status : ['', Validators.compose([])], -// earning_segment: ['', Validators.compose([])], -// earning_gross_income_per_month: ['', Validators.compose([])], -// earning_name_of_the_employer_or_business: ['', Validators.compose([])], -// earning_number_of_years_in_employment_or_business: ['', Validators.compose([])], -// non_earning_occupation: ['', Validators.compose([])], -// non_earning_if_others: ['', Validators.compose([])], -// non_earning_if_retired_from: ['', Validators.compose([])], -// }) -// } - -// // get all master details -// getMasterDetails(table:string,type:number){ -// this._pd.getAllMasterDatas(table).subscribe( -// data => { -// if (data.status == 200) { -// if(type==1){ -// this.relationData=data.records.filter(item => item.isactive == 1); -// } -// else if(type==2){ -// this.occupationData=data.records.filter(item => item.isactive == 1); -// } -// // else if(type==3){ -// // this.personMetData=data.records.filter(item => item.isactive == 1); -// // } -// else if(type==4){ -// this.ownerShipData=data.records.filter(item => item.isactive == 1); -// } -// else if(type==5){ -// this.customerSegData=data.records.filter(item => item.isactive == 1); -// } - -// } -// }); -// } - -// submitFamily() { -// if (!this.familyForm.valid) { -// return; -// } -// var records = this.familyForm.value; -// //To Remove The "Null" With Key also -// Object.keys(records).forEach((key) => (records[key] == null) && delete records[key]); -// // records.other_family_details = answerFormValues; -// records.pdid = this.pdid; -// records.formid = '6'; -// // records.fk_createdby = '251'; -// this._pd.saveForm(records).subscribe(data => { -// this.notifier.notify('success', 'Saved Successfully.'); -// }, error => { -// this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); -// }); -// } -// // validateAllFormFields(formGroup: FormGroup) { -// // Object.keys(formGroup.controls).forEach(field => { -// // const control = formGroup.get(field); -// // if (control instanceof FormControl) { -// // control.markAsTouched({onlySelf: true}); -// // } else if (control instanceof FormGroup) { -// // this.validateAllFormFields(control); -// // } -// // }); -// // } - -// // /** On Key Press Event For Age */ -// // keyPress(event: any) { -// // const pattern = /[0-9]/; - -// // let inputChar = String.fromCharCode(event.charCode); -// // if (event.keyCode != 8 && !pattern.test(inputChar)) { -// // event.preventDefault(); -// // } -// // } - -// } - - - - - - - -// =================== other family details multiple add - -import { - Component, - OnInit, - Inject, - Input, Output -} from '@angular/core'; - -import { - FormBuilder, - FormGroup, - Validators, - FormArray, FormControl, AbstractControl, -} from '@angular/forms'; +import { FormBuilder,FormGroup,Validators,FormArray, FormControl, AbstractControl } from '@angular/forms'; import { NotifierService } from 'angular-notifier'; -import { - MatDialog, - MatDialogRef, - MAT_DIALOG_DATA -} from '@angular/material'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +import { ActivatedRoute, Router } from "@angular/router"; + /** Service */ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; -import { ActivatedRoute, Router } from "@angular/router"; + @Component({ selector: 'app-family-details', templateUrl: './family-details.component.html', styleUrls: ['./family-details.component.scss'] }) + export class FamilyDetailsComponent implements OnInit { + + /** Header Variable Declaration */ customer_segment_abbr: any; subproduct_abbr: any; lender_applicant_id: any; main_applicant: any; - IncomePerMonth: any = []; - RentAmount: any = []; - FamilyMemberAsLabel: any = []; - //@Input() pdid: number; pageTitle: string = "Family Details"; - pdid: string; - form_id: number; - isReadOnly:any = []; + + /** Variable Declaration */ private notifier: NotifierService; public familyForm: FormGroup; public selectPerson; public apiFamilyMembers : any = []; - // selectPerson = [{ - // name : 'person 1', - // id : 111 - // }, { - // name : 'person 2', - // id : 222 - // }]; + pdid: string; + form_id: number; + isReadOnly:any = []; + count: number; + IncomePerMonth: any = []; + RentAmount: any = []; + FamilyMemberAsLabel: any = []; + + //@Input() pdid: number; - earningStatus = [{ - type: 'Earning', - id: 1 - }, { - type: 'Non Earning', - id: 2 - }] + /** Declartion For Dropdowns */ relationData: any = []; occupationData: any = []; - //personMetData: any = []; ownerShipData: any = []; - // customerSegData: any = []; earningData:any =[]; stateData: any = []; - // wholeCityData:any =[]; cityData: any =[]; pincodeData:any=[]; - // earnMemberArrCount :any ; - // nonEarnMemberArrCount :any ; - count: number; + earningStatus = [{ id: 1,type: 'Earning' }, + { id: 2,type: 'Non Earning' }] + + /** constructor Of the class */ constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService, private dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public pd_all_details: any) { - // console.log(pd_all_details); - this.selectPerson = this.pd_all_details.pdapplicants_detials; - this.pdid = this.pd_all_details.pdmaster_details.pd_id; - this.form_id = 6; - this.notifier = notifier; + + this.form_id = 6; + this.notifier = notifier; + this.selectPerson = this.pd_all_details.pdapplicants_detials; + this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.main_applicant = this.pd_all_details.pdmaster_details.main_applicant; - this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; - this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; - this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; + this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; + this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; + this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; + + } + ngOnInit() { this.getMasterDetails('RELATIONSHIPS', 1); this.getMasterDetails('OCCUPATIONMEMBERS', 2); - //this.getMasterDetails('PERSONSMET',3); this.getMasterDetails('RESIDENCEOWNERSHIP', 4); - // this.getMasterDetails('CUSTOMERSEGMENT', 5); this.getMasterDetails('EARNINGMEMBERSSTATUS', 5); this.getMasterDetails('STATE', 6); - // this.getMasterDetails('CITY', 7); - // this.getMasterDetails('PINCODE', 8); this._pd.getFamilyDetails(this.pdid).subscribe(data=>{ console.clear(); - // console.log('getFamilyDetails data',data); + if(data.dataStatus == true){ let Temparr : any = []; - // console.log('from_business_form',data.record.from_business_form); - // console.log('from_general_form',data.record.from_general_form); - if(data.record.from_general_form.length > 0){ let familyMembersGeneralForm = Object.keys(data.record.from_general_form).map(function (key) { return data.record.from_general_form[key]; @@ -390,7 +101,7 @@ export class FamilyDetailsComponent implements OnInit { age:element.age, data_gets_from:'GeneralForm'}; }); - // console.log('familyMembersGeneralForm',familyMembersGeneralForm); + Temparr.push(datas); } @@ -420,7 +131,6 @@ export class FamilyDetailsComponent implements OnInit { params.pd_id = this.pdid; params.pd_form_id = '6'; - // - { "pd_id":"104"} this._pd.retriveForm(params).subscribe(data => { const control = this.familyForm.controls['nonEarningMembers']; @@ -478,6 +188,7 @@ export class FamilyDetailsComponent implements OnInit { onSearchChange(e): void { e.preventDefault(); } + public initFamilyFormDetails(): void { this.familyForm = this.fb.group({ family_details: this.fb.array([]), @@ -794,9 +505,6 @@ removeFamilyMembers(inx,i) { else if (type == 2) { this.occupationData = data.records.filter(item => item.isactive == 1); } - // else if(type==3){ - // this.personMetData=data.records.filter(item => item.isactive == 1); - // } else if (type == 4) { this.ownerShipData = data.records.filter(item => item.isactive == 1); } @@ -806,18 +514,11 @@ removeFamilyMembers(inx,i) { else if (type == 6) { this.stateData = data.records.filter(item => item.isactive == 1); } - // else if(type == 7){ - // this.wholeCityData = data.records.filter(item => item.isactive == 1); - // } - } }); } getCity(e,i){ - - // this.cityData = this.wholeCityData.filter(city=>city.fk_state_id == e); - // this._pd.retriveForm(params).subscribe(data => { this._pd.getStateWiseCities(e).subscribe(data=>{ if (data.status == 200) { @@ -836,13 +537,12 @@ removeFamilyMembers(inx,i) { var records = this.familyForm.value; //To Remove The "Null" With Key also Object.keys(records).forEach((key) => (records[key] == null) && delete records[key]); - // records.other_family_details = answerFormValues; + records.pdid = this.pdid; records.formid = '6'; - // records.fk_createdby = '251'; - // console.log(JSON.stringify(records)); + this._pd.saveForm(records).subscribe(data => { - // this.notifier.notify('success', 'Saved Successfully.'); + if(data.status == 200) { this.notifier.notify('success', 'Saved Successfully.'); setTimeout(() =>{ @@ -856,6 +556,7 @@ removeFamilyMembers(inx,i) { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); }); } + // validateAllFormFields(formGroup: FormGroup) { // Object.keys(formGroup.controls).forEach(field => { // const control = formGroup.get(field); @@ -876,6 +577,7 @@ removeFamilyMembers(inx,i) { event.preventDefault(); } } + /** To Convert Amount into Words */ inWords(e,flag:number,i){ switch(flag){ @@ -883,8 +585,8 @@ removeFamilyMembers(inx,i) { this.RentAmount[i] = this._pd.convertNumberToWords(e.target.value); break; case 2 : - this.IncomePerMonth[i] = this._pd.convertNumberToWords(e.target.value); - break; + this.IncomePerMonth[i] = this._pd.convertNumberToWords(e.target.value); + break; default: break; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html index 5c4469438..51f52ce09 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html @@ -12,53 +12,45 @@
- + + Select {{ pm.description }} - + - - - - Location - - - - - Well Suited. - Fairly Suited - Not Suited - - - - - - - - + + + Location + + + Select + Well Suited. + Fairly Suited + Not Suited + + + + +
+ + + Select {{ list.pdofficer_recommendation }} - - - - - - - + + - - + + + + + -
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts index 83d40a946..d59843d4e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts @@ -151,10 +151,10 @@ export class FinalRemarksComponent implements OnInit { /** To Save/Edited Popup Data */ onSubmit() { this.submitted = true; - if (this._finalRemarkForm.controls.final_custormer_remark_type.value == 1) { - this._finalRemarkForm.controls['final_other_customer_behaviour'].setValidators([Validators.required]); - this._finalRemarkForm.controls['final_other_customer_behaviour'].updateValueAndValidity(); - } + if (this._finalRemarkForm.controls.final_custormer_remark_type.value == 1) { + this._finalRemarkForm.controls['final_other_customer_behaviour'].setValidators([Validators.required]); + this._finalRemarkForm.controls['final_other_customer_behaviour'].updateValueAndValidity(); + } // stop here if form is invalid if (this._finalRemarkForm.invalid) { this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); @@ -203,18 +203,18 @@ export class FinalRemarksComponent implements OnInit { } RecommendationChange(e){ - if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){ + // if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){ - } - if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 3){ + // } + // if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 3){ - } - if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 4){ + // } + // if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 4){ - } - + // } + console.log('e',e); if(e==1){ - + console.log('other only',e); this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValidators([Validators.required]); this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity(); @@ -227,7 +227,7 @@ export class FinalRemarksComponent implements OnInit { this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue(''); } if(e==2){ - + console.log('all Validation clear ',e); this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators(); this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity(); this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue(''); @@ -242,7 +242,7 @@ export class FinalRemarksComponent implements OnInit { } if(e==3){ - + console.log('negative only',e); this._finalRemarkForm.controls['enter_reason_for_negative'].setValidators([Validators.required]); this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity(); @@ -251,12 +251,12 @@ export class FinalRemarksComponent implements OnInit { this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity(); this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue(''); - this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators(); - this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity(); + this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].clearValidators(); + this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity(); } if(e==4){ - + console.log('credit only',e); this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValidators([Validators.required]); this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity(); 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 b862690df..9073a7e12 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 @@ -168,9 +168,9 @@
-
+
- +

Financial as per Customer

@@ -266,7 +266,7 @@ {{"₹"}} {{AV_netProfitAmtToInwords[i]}} Only - + @@ -275,8 +275,47 @@
- - +
+ Working Capital Details + + + + + + + + + + + + Yes + No + + + + + {{a.name}} + + + + + +
+
@@ -286,7 +325,7 @@ - + @@ -305,7 +344,7 @@ {{"₹"}} {{AV_netLossAmtToInwords[i]}} Only - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts index 861edbb5e..79d3f45d4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts @@ -39,6 +39,7 @@ export class FinancialInfoComponent implements OnInit { pdid: string; form_id: number; company_id: string; + CustSegAbbr : any; public financialForm: FormGroup; private notifier: NotifierService; @@ -66,7 +67,14 @@ export class FinancialInfoComponent implements OnInit { AV_netLossAmtToInwords: any = []; AV_SalesFrmInwords: any = []; AV_SalesToInwords: any = []; - + av : any =[{id:6, name:'Letter of Credit'}, + {id:2, name:'Bank Guarantee'}, + {id:3, name:'Cash Credit Limit'}, + {id:7, name:'OD Limit'}, + {id:4, name:'Factoring'}, + {id:5, name:'Forfaiting'}, + {id:1, name:'Others'}] + // values = [0, 1, 2, 3]; constructor(notifier: NotifierService, private fb: FormBuilder, @@ -84,6 +92,9 @@ export class FinancialInfoComponent implements OnInit { this.lender_applicant_id = this.pd_all_details.pdmaster_details.lender_applicant_id; this.subproduct_abbr = this.pd_all_details.pdmaster_details.subproduct_abbr; this.customer_segment_abbr = this.pd_all_details.pdmaster_details.customer_segment_abbr; + let x = this.customer_segment_abbr.split("-"); + this.CustSegAbbr = x[1]; + console.log('this.CustSegAbbr',this.CustSegAbbr); } //ViewerOption For Docs Display @@ -146,6 +157,8 @@ export class FinancialInfoComponent implements OnInit { } /** Backend Data of Asper Customer */ + if(this.CustSegAbbr != 'AI'){ + let result_val = Object.keys(value.records.estimated_value).map(function(key) { return value.records.estimated_value[key]; }); @@ -169,6 +182,9 @@ export class FinancialInfoComponent implements OnInit { } else { estimated_val.push(this.createValue('')); } + } + else + {retriveData.estimated_value = [];} retriveData.pdid = this.pdid; retriveData.formid = this.form_id; retriveData.company_id = this.company_id; @@ -256,7 +272,13 @@ export class FinancialInfoComponent implements OnInit { estimate_net_loss_to:[''], estimate_net_loss_percent:[''], estimate_net_loss:[''], - estimate_reason_for_loss:[''] + estimate_reason_for_loss:[''], + estimate_receive_the_money_in_days:[''], + estimate_pay_the_money_in_days:[''], + estimate_unsold_stock_lies_in_days:[''], + estimate_working_capital_facilities_availed:[''], + reason_for_working_capital_facilities_availed:[''], + is_there_working_capital_available:[''] }); } @@ -288,6 +310,12 @@ export class FinancialInfoComponent implements OnInit { estimate_net_loss_percent:[value.estimate_net_loss_percent], estimate_net_loss:[value.estimate_net_loss], estimate_reason_for_loss:[value.estimate_reason_for_loss], + estimate_receive_the_money_in_days:[value.estimate_receive_the_money_in_days], + estimate_pay_the_money_in_days:[value.estimate_pay_the_money_in_days], + estimate_unsold_stock_lies_in_days:[value.estimate_unsold_stock_lies_in_days], + is_there_working_capital_available:[value.is_there_working_capital_available], + estimate_working_capital_facilities_availed:[value.estimate_working_capital_facilities_availed], + reason_for_working_capital_facilities_availed:[value.reason_for_working_capital_facilities_availed] }); } @@ -798,7 +826,8 @@ export class FinancialInfoComponent implements OnInit { annual_sale = val.financial_annual_sale; /** Calculating Sale Variation Based on Prev.Year ( Datas returns in percentage ) - * Label name = " Sale Variation from Previous Year in % " + * Explaination : Comparing Curr.Year annual sales and Prev.year annual sales + * Label name : " Sale Variation from Previous Year in % " */ if (index != 0) { @@ -821,7 +850,8 @@ export class FinancialInfoComponent implements OnInit { loss_amt = val.financial_net_loss; /** Calculating Profit's Variation - STARTS HERE - * Label name = "Profit Variation from Previous Year in %" + * Explaination : Comparing Curr.Year Net Profit (or) Loss Amount With Prev.year Net Profit (or) Loss Amount + * Label name : "Profit Variation from Previous Year in %" */ if((profit_amt != '' || loss_amt != '') && index != 0) { if(+profit_amt > +annual_sale){ @@ -842,7 +872,8 @@ export class FinancialInfoComponent implements OnInit { /********************************* Calculating Profit's Variation - ENDS HERE **************************************************************/ /** Calculating Net Profit (or) Net Loss (and) Sales's Profit Variation - * Label name = "Net Profit to Sales in % (or) Net Loss to Sales in % + * Explaination : Comparing Curr.Year Net Profit Amount With Curr.year Annual Sales Amount ( like wise loss ) + * Label name : "Net Profit to Sales in % (or) Net Loss to Sales in % **/ let SelectedlossOrProfit = val.finanical_profit_or_loss; @@ -895,9 +926,14 @@ export class FinancialInfoComponent implements OnInit { } } } - - prev_profit_margin[index] = val.financial_margin_of_profit != '' ? val.financial_margin_of_profit: 0; - prev_loss_margin[index] = val.financial_margin_of_loss !='' ? val.financial_margin_of_loss : 0 ; + console.log('val.financial_margin_of_profit',val.financial_margin_of_profit); + console.log('profit_margin',profit_margin); + console.log('childArray.controls.financial_margin_of_loss',childArray.controls.financial_margin_of_loss.value); + // prev_profit_margin[index] = val.financial_margin_of_profit != '' ? val.financial_margin_of_profit: 0; + // prev_loss_margin[index] = val.financial_margin_of_loss !='' ? val.financial_margin_of_loss : 0 ; + prev_profit_margin[index] = profit_margin != '' ? profit_margin : 0; + prev_loss_margin[index] = loss_margin !='' ? loss_margin : 0 ; + // if(index != 0 ){ @@ -917,12 +953,22 @@ export class FinancialInfoComponent implements OnInit { if ((profit_margin != '' || loss_margin != '') && index != 0) { + + console.log('temp_prev_losses',prev_loss_margin); + console.log('temp_prev_profits',prev_profit_margin); + + console.log('curr index',index); loss_margin = loss_margin !== undefined ? loss_margin : 0; profit_margin = profit_margin !== undefined ? profit_margin:0; let temp_prev_loss_margin = prev_loss_margin[index-1] !== undefined ? prev_loss_margin[index-1] : 0 ; let temp_prev_profit_margin = prev_profit_margin[index-1] !== undefined ? prev_profit_margin[index-1] : 0 ; + console.log('profit_margin',profit_margin); + console.log('pre year loss_margin',temp_prev_loss_margin); + console.log('loss_margin',loss_margin); + console.log('pre year profit_margin',temp_prev_profit_margin); + if(annual_sale != ''){ @@ -1573,7 +1619,12 @@ export class FinancialInfoComponent implements OnInit { // } submitDetails() { - + + if(this.CustSegAbbr == 'AI'){ + this.financialForm.removeControl('estimated_value'); + this.financialForm.controls['is_financial_customer'].setValue(''); + } + if(this.financialForm.value.date_per_financial['finanical_profit_or_loss'] == 1){ this.financialForm.value.date_per_financial['financial_net_profit'].setValidators([Validators.required]); @@ -1602,6 +1653,7 @@ export class FinancialInfoComponent implements OnInit { this.financialForm.value.date_per_financial['financial_margin_of_loss'].setValidators([Validators.required]); this.financialForm.value.date_per_financial['financial_margin_of_loss'].updateValueAndValidity(); } + // if (!this.financialForm.valid) { // this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); // return; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.html index 3fc823428..e9dc2d35d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.html @@ -24,6 +24,7 @@ + Select Yes No diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html index e848a68bd..a48bbb000 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html @@ -29,6 +29,12 @@ {{"₹"}} {{loanAmtInWords}} Only + + Loan Tenure applied for? + + + @@ -37,18 +43,18 @@ - + Select Yes No - @@ -58,23 +64,18 @@ {{"₹"}} {{balTxrfAmtInWords}} Only - + + Select {{ btLen.lender_name }} - @@ -90,20 +91,14 @@ + Select {{ list.end_use_of_topup }} - - - @@ -126,11 +121,11 @@ + + --> - @@ -151,20 +146,21 @@

Details of Property being Mortgaged

- + + Select {{ typeprop.property_name }} - - + - + @@ -195,17 +191,18 @@ - + + Select {{ status.name }} - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts index 1315da288..7c119dd59 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts @@ -5,37 +5,38 @@ import { Input } from '@angular/core'; -import { - FormBuilder, - FormGroup, - Validators, - FormArray, FormControl, -} from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, FormArray, FormControl } from '@angular/forms'; import { NotifierService } from 'angular-notifier'; -import { - MatDialog, - MatDialogRef, - MAT_DIALOG_DATA -} from '@angular/material'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +import { ActivatedRoute, Router } from '@angular/router'; + /** Service */ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; -import { ActivatedRoute, Router } from '@angular/router'; + @Component({ selector: 'app-loan-details', templateUrl: './loan-details.component.html', styleUrls: ['./loan-details.component.scss'] }) + export class LoanDetailsComponent implements OnInit { + + /**Declaration of Header Variables */ customer_segment_abbr: any; subproduct_abbr: any; lender_applicant_id: any; main_applicant: any; - public loanDetailsForm: FormGroup; - private notifier: NotifierService; + pageTitle: string = "Loan Details"; + + /**Declaration of formfields Variables */ + private notifier: NotifierService; + public loanDetailsForm: FormGroup; + pdid: number; form_id: number; exist_loan_amt: any; @@ -44,7 +45,10 @@ export class LoanDetailsComponent implements OnInit { productAbbr: any; productID: any; subProductName: any; + propertyType: any; + mortageCardAccess: boolean; + mortageAccess: boolean = false; isOtherPurpose: boolean = false; isOtherSource: boolean = false; isPLSource: boolean = false; @@ -52,6 +56,7 @@ export class LoanDetailsComponent implements OnInit { isContribution: boolean = false; OtherOwnerFlag: boolean; + /* Declaration of Array For Dropdown */ endUserList: any = []; sourceList: any = []; ownerNames: any = []; @@ -69,6 +74,8 @@ export class LoanDetailsComponent implements OnInit { mergeCompanyApplicant: any = []; existCompanyList: any = []; companies: any = []; + + /* Declaration of Variables For Amount IN words */ loanAmtInWords: any; balTxrfAmtInWords: any; valAsPerAgmtInWords: any; @@ -76,13 +83,9 @@ export class LoanDetailsComponent implements OnInit { topUpAmtInWords: any; emiAmtInWords: any; emvAmtInWords: any; - pageTitle: string = "Loan Details"; - - mortageCardAccess: boolean; - mortageAccess: boolean = false; - propertyType: any; + /** Constructor Of the Class */ constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, @@ -112,26 +115,10 @@ export class LoanDetailsComponent implements OnInit { this.isContribution = true; } } - 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, - } - }; + + /** init Fns */ ngOnInit() { + this.initloanDetailsForm(); this.getM_EndUseofLoad(); this.getM_EndUseForLoan(this.pdid); @@ -204,16 +191,16 @@ export class LoanDetailsComponent implements OnInit { this.endUserChange(enduse); - this.loanDetailsForm.controls['loan_amount'].setValue(value.records.loan_amount); if (value.records.loan_amount) { this.loanAmtInWords = this._pd.convertNumberToWords(value.records.loan_amount); } - - + + this.loanDetailsForm.controls['loan_tenure'].setValue(value.records.loan_tenure); + if (value.records.end_use_other != null) { this.loanDetailsForm.controls['end_use_other'].setValue(value.records.end_use_other); } this.loanDetailsForm.controls['is_transfer'].setValue(value.records.is_transfer); - // this.loanDetailsForm.controls['is_topup'].setValue(value.records.is_topup); + if (value.records.balance_transfer_amount) { this.loanDetailsForm.controls['balance_transfer_amount'].setValue(value.records.balance_transfer_amount); this.balTxrfAmtInWords = this._pd.convertNumberToWords(value.records.balance_transfer_amount); @@ -261,22 +248,12 @@ export class LoanDetailsComponent implements OnInit { this.sourceChange(dbsourcelist); if (value.records.other_source) { - // this.isOtherSource = true; this.loanDetailsForm.controls['other_source'].setValue(value.records.other_source); } - - // if(value.records.personal_loan_source) { - // // this.isPLSource = true; - // this.loanDetailsForm.controls['personal_loan_source'].setValue(value.records.personal_loan_source); - // } } } - // if (value.records.lender_name_type) { - // this.loanDetailsForm.controls['lender_name_type'].setValue(value.records.lender_name_type); - // } - if (value.records.emi_level) { this.loanDetailsForm.controls['emi_level'].setValue(value.records.emi_level); this.emiAmtInWords = this._pd.convertNumberToWords(value.records.emi_level); @@ -292,15 +269,9 @@ export class LoanDetailsComponent implements OnInit { if (this.mortageCardAccess == true) { this.loanDetailsForm.controls['property_type_others'].setValue(value.records.property_type_others); this.loanDetailsForm.controls['owner_name'].setValue(ownername); - // this.loanDetailsForm.controls['other_owners_name'].setValue(value.records.other_owners_name); + this.loanDetailsForm.controls['construction_status'].setValue(value.records.construction_status); - // if(value.records.construction_status == 4 ){ - // this.loanDetailsForm.controls['percentage_of_construction'].setValue(value.records.percentage_of_construction); - // } - // else{ - // this.loanDetailsForm.controls['percentage_of_construction'].setValue(''); - // } if (value.records.emv_per_customer != '') { this.loanDetailsForm.controls['emv_per_customer'].setValue(value.records.emv_per_customer); this.emvAmtInWords = this._pd.convertNumberToWords(value.records.emv_per_customer); @@ -308,10 +279,6 @@ export class LoanDetailsComponent implements OnInit { } - - - // this.loanDetailsForm.controls['value_per_agreement'].setValue(value.records.value_per_agreement); - // if(value.records.value_per_agreement){ this.valAsPerAgmtInWords = this._pd.convertNumberToWords(value.records.value_per_agreement); } this.loanDetailsForm.controls['loandetails_remarks'].setValue(value.records.loandetails_remarks); } }) @@ -330,42 +297,25 @@ export class LoanDetailsComponent implements OnInit { } } - // ============= - getM_EndUseofLoad() { - //this._pd.getAllMasterDatas('ENDUSEOFLOAN').subscribe( this._pd.getAllMasterDatas('SUBPRODUCTS').subscribe( data => { this.m_endUseofLoad = data.records.filter(data => data.isactive == 1 && data.fk_product_id == this.productID); - }, - error => { - // this.notifier.notify('warning', 'No Category Records Found.!'); - // this.m_assets_type = "No Category Records Found."; - } - ) + }); } + getM_EndUseForLoan(pdid) { this._pd.getEndUseForLoan(pdid).subscribe( data => { this.m_endUseForLoan = data.records.filter(data => data.isactive == 1); - }, - error => { - // this.notifier.notify('warning', 'No Category Records Found.!'); - // this.m_assets_type = "No Category Records Found."; - } - ) + }); } getM_sourceofamount() { this._pd.getAllMasterDatas('SOURCEOFBALANCETRANSFER').subscribe( data => { this.m_sourceofamount = data.records.filter(data => data.isactive == 1); - }, - error => { - // this.notifier.notify('warning', 'No Category Records Found.!'); - // this.m_assets_type = "No Category Records Found."; - } - ) + }); } getM_MortageTypeProperty() { @@ -395,27 +345,16 @@ export class LoanDetailsComponent implements OnInit { } }); this.m_mortageTypeProperty - // mortage_property_id">{{ typeprop.property_name } - }, - error => { - // this.notifier.notify('warning', 'No Category Records Found.!'); - // this.m_assets_type = "No Category Records Found."; - } - ) + }); } getM_StatusofCunstruction() { this._pd.getAllMasterDatas('STATUSOFCONSTRUCTION').subscribe( data => { this.m_statusofCunstruction = data.records.filter(data => data.isactive == 1); - }, - error => { - // this.notifier.notify('warning', 'No Category Records Found.!'); - // this.m_assets_type = "No Category Records Found."; - } - ) + }); } getM_BTLenderList() { @@ -431,7 +370,7 @@ export class LoanDetailsComponent implements OnInit { // } // return 0; // }); - }) + }); } @@ -439,10 +378,36 @@ export class LoanDetailsComponent implements OnInit { this._pd.getAllMasterDatas('ENDUSEOFTOPUP').subscribe( data => { this.m_endUseOFTopUpList = data.records.filter(data => data.is_active == 1); - }) + }); } + /** Loan Form Elements */ + public initloanDetailsForm(): void { + this.loanDetailsForm = this.fb.group({ + loan_amount: [this.exist_loan_amt], + loan_tenure:[''], + end_use: [''], + end_use_other: [''], + is_transfer: [''], + balance_transfer_amount: [''], + topup_amount: [''], + end_use_topup: [''], + other_end_use_topup: [''], + lender: [''], + other_bt_lender: [''], + own_contribution: [''], + source: [''], + other_source: [''], + emi_level: [''], + property_type: [''], + property_type_others: [''], + owner_name: [''], + construction_status: [''], + emv_per_customer: [''], + loandetails_remarks: [''], + }); + } // compare objects for merge two master table details @@ -464,49 +429,7 @@ export class LoanDetailsComponent implements OnInit { } - - // ================== - public initloanDetailsForm(): void { - this.loanDetailsForm = this.fb.group({ - - loan_amount: [this.exist_loan_amt], - end_use: [''], - end_use_other: [''], - is_transfer: [''], - //is_topup: [''], - balance_transfer_amount: [''], - topup_amount: [''], - end_use_topup: [''], - other_end_use_topup: [''], - lender: [''], - other_bt_lender: [''], - own_contribution: [''], - source: [''], - other_source: [''], - // personal_loan_source:[''], - //lender_name_type: [''], - emi_level: [''], - property_type: [''], - property_type_others: [''], - owner_name: [''], - // other_owners_name :[''], - construction_status: [''], - //percentage_of_construction : [''], - emv_per_customer: [''], - //value_per_agreement: [''], - loandetails_remarks: [''], - }); - } - // endUserChange(event) { - // this.endUserList = []; - // event.value.forEach(option => { - // this.endUserList.push({end_use: option}); - // if (option == 'other') { - // this.isOtherPurpose = true; - // } - // }); - // } - + /** Enduse Changes And its Validation */ endUserChange(event) { this.endUserList = []; let OthersAvaliable; @@ -532,18 +455,16 @@ export class LoanDetailsComponent implements OnInit { } + /** Source Changes with Validation */ sourceChange(evt) { - - // this.isOtherSource = (evt.some(e => e == 4) == true) ? true : false ; - // this.isPLSource = (evt.some(e => e == 3) == true) ? true : false ; - this.isOtherSource = evt.some(e => e == 1) // this return true or false Only; - // this.isPLSource = evt.some(e => e == 3) // this return true or false Only; + if (this.isOtherSource) { this.loanDetailsForm.controls['other_source'].setValidators([Validators.required]); this.loanDetailsForm.controls['other_source'].updateValueAndValidity(); } else { + this.loanDetailsForm.controls['other_source'].setValue(''); this.loanDetailsForm.controls['other_source'].clearValidators(); this.loanDetailsForm.controls['other_source'].updateValueAndValidity(); } @@ -554,6 +475,7 @@ export class LoanDetailsComponent implements OnInit { }); } + /** Validation Based on Owner Name */ ownerNameChange(event) { let EventValue; event.value.forEach(option => { @@ -566,195 +488,38 @@ export class LoanDetailsComponent implements OnInit { } }); - // this.ownerNames = []; - // event.value.forEach(option => { - // this.ownerNames.push({owner_name: option}); - // }); - } - submitLoanDetails() { - - if ((this.isContribution == true) && (this.loanDetailsForm.controls['is_transfer'].value != 'yes')) { - this.loanDetailsForm.controls['own_contribution'].setValue(''); - this.loanDetailsForm.controls['own_contribution'].clearValidators(); - this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity(); - this.loanDetailsForm.controls['other_source'].setValue(''); - this.loanDetailsForm.controls['other_source'].clearValidators(); - this.loanDetailsForm.controls['other_source'].updateValueAndValidity(); - this.loanDetailsForm.controls['source'].setValue(''); - this.loanDetailsForm.controls['source'].clearValidators(); - this.loanDetailsForm.controls['source'].updateValueAndValidity(); - } - - if (this.loanDetailsForm.controls['lender'].value == 1) { - this.loanDetailsForm.controls['other_bt_lender'].setValidators([Validators.required]); - this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity(); - } - else { - this.loanDetailsForm.controls['other_bt_lender'].clearValidators(); - this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity(); - } - - if (this.loanDetailsForm.controls['end_use_topup'].value == 1) { - this.loanDetailsForm.controls['other_end_use_topup'].setValidators([Validators.required]); - this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity(); - } - else { - this.loanDetailsForm.controls['other_end_use_topup'].clearValidators(); - this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity(); - } - - if (!this.loanDetailsForm.valid) { - this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); - return; - } - - let records: any = {}; - records.pdid = this.pdid; - records.formid = this.form_id; - records.fk_createdby = this.pdid; - records.loan_amount = this.loanDetailsForm.controls['loan_amount'].value; - - // get end user final group data - let dataEnd_user_data = []; - - this.loanDetailsForm.controls['end_use'].value.forEach(element => { - dataEnd_user_data.push({ end_use: element }) - }); - - records.end_use_group = dataEnd_user_data; - - if (this.isOtherPurpose) { - records.end_use_other = this.loanDetailsForm.controls['end_use_other'].value; - } else { records.end_use_other = null; } - - records.is_transfer = this.loanDetailsForm.controls['is_transfer'].value; - // records.is_topup = this.loanDetailsForm.controls['is_topup'].value; - // if((this.productAbbr != 'PL' || this.productAbbr != 'BL' || this.productAbbr != 'LAP') && (value.records.is_transfer != 'yes')){ - if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') { - records.balance_transfer_amount = this.loanDetailsForm.controls['balance_transfer_amount'].value; - } - else if (this.loanDetailsForm.controls['is_transfer'].value == 'no') { - if (this.isContribution) { - records.own_contribution = ''; - records.source_group = ''; - records.other_source = ''; - } - else { - - records.own_contribution = this.loanDetailsForm.controls['own_contribution'].value; - // records.source = this.loanDetailsForm.controls['source'].value; - // if (this.loanDetailsForm.controls['source'].value == 'other') { - // records.lender_name_type = this.loanDetailsForm.controls['lender_name_type'].value; - // } - // if (this.loanDetailsForm.controls['source'].value == 4) { - // records.other_source = this.loanDetailsForm.controls['other_source'].value; - // } - - let dataSource_list = []; - this.loanDetailsForm.controls['source'].value.forEach(element => { - dataSource_list.push({ sources: element }) - }); - records.source_group = dataSource_list; - - - } - } - // if (this.loanDetailsForm.controls['is_topup'].value == 'yes') { - records.topup_amount = this.loanDetailsForm.controls['topup_amount'].value; - // } - - if (records.topup_amount > 0) { - records.end_use_topup = this.loanDetailsForm.controls['end_use_topup'].value; - if (records.end_use_topup == 1) { - records.other_end_use_topup = this.loanDetailsForm.controls['other_end_use_topup'].value; - } - } - - - - if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') { //this.loanDetailsForm.controls['is_topup'].value == 'yes' || - records.lender = this.loanDetailsForm.controls['lender'].value; - if (this.loanDetailsForm.controls['lender'].value == 1) { - records.other_bt_lender = this.loanDetailsForm.controls['other_bt_lender'].value; - } - } - - records.emi_level = this.loanDetailsForm.controls['emi_level'].value; - if (this.mortageCardAccess == true) { - - records.property_type = this.loanDetailsForm.controls['property_type'].value; - records.property_type_others = this.loanDetailsForm.controls['property_type_others'].value; - let dataOwner_name = []; - this.loanDetailsForm.controls['owner_name'].value.forEach(element => { - dataOwner_name.push({ owner_name: element }) - }); - records.owner_name_group = dataOwner_name; - records.construction_status = this.loanDetailsForm.controls['construction_status'].value; - records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value; - } else { - records.property_type = null; - records.property_type_others = null; - records.owner_name_group = null; - records.construction_status = null; - records.emv_per_customer = null; - } - - if (this.isOtherSource) { - records.other_source = this.loanDetailsForm.controls['other_source'].value; - } else { records.other_source = ''; } - - records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value; - - records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value; - this._pd.saveForm(records).subscribe(data => { - if (data.status == 200) { - this.notifier.notify('success', 'Saved Successfully.'); - // this.dialogRef.close(); - setTimeout(() => { - this.dialogRef.close(); - }, 3000); - } - else { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - } - }, error => { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - }) - } - - validateAllFormFields(formGroup: FormGroup) { - Object.keys(formGroup.controls).forEach(field => { - const control = formGroup.get(field); - if (control instanceof FormControl) { - control.markAsTouched({ onlySelf: true }); - } else if (control instanceof FormGroup) { - this.validateAllFormFields(control); - } - }); } + /**For Setting Validations */ selectedBalancesTransferChanges(event: any) { if (event.value == 'no') { - // this.loanDetailsForm.controls['is_topup'].clearValidators(); - // this.loanDetailsForm.controls['is_topup'].updateValueAndValidity(); - this.loanDetailsForm.controls['source'].setValidators([Validators.required]); this.loanDetailsForm.controls['source'].updateValueAndValidity(); this.loanDetailsForm.controls['own_contribution'].setValidators([Validators.required]); this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity(); + + this.loanDetailsForm.controls['other_bt_lender'].setValue(''); + this.loanDetailsForm.controls['balance_transfer_amount'].setValue(''); + this.loanDetailsForm.controls['lender'].setValue(''); + this.loanDetailsForm.controls['topup_amount'].setValue(''); + this.loanDetailsForm.controls['end_use_topup'].setValue(''); + this.loanDetailsForm.controls['other_end_use_topup'].setValue(''); + } else if (event.value == 'yes') { - // this.loanDetailsForm.controls['is_topup'].setValidators([Validators.required]); - // this.loanDetailsForm.controls['is_topup'].updateValueAndValidity(); - + this.loanDetailsForm.controls['source'].setValue(''); this.loanDetailsForm.controls['source'].clearValidators(); this.loanDetailsForm.controls['source'].updateValueAndValidity(); - + + this.loanDetailsForm.controls['own_contribution'].setValue(''); this.loanDetailsForm.controls['own_contribution'].clearValidators(); this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity(); - + + this.isOtherSource = false; + this.loanDetailsForm.controls['other_source'].setValue(''); + } } @@ -798,9 +563,7 @@ export class LoanDetailsComponent implements OnInit { } } - /** - * mortage_type - */ + /** Using Selected Mortage Type Set validation */ mortage_type(mortage_value) { //let mortagetypes = this.m_mortageTypeProperty.filter(mor=>mor.mortage_property_id==mortage_value)[0]; @@ -812,14 +575,13 @@ export class LoanDetailsComponent implements OnInit { this.loanDetailsForm.controls['property_type_others'].updateValueAndValidity(); } else { this.mortageAccess = false; + this.loanDetailsForm.controls['property_type_others'].setValue(''); this.loanDetailsForm.controls['property_type_others'].clearValidators(); this.loanDetailsForm.controls['property_type_others'].updateValueAndValidity(); } } - /** - * LoanCalculation - */ + /** For Loan Calculation */ loanCalc() { let BtAmount: number = +this.loanDetailsForm.value.balance_transfer_amount; let loanAmount: number = +this.loanDetailsForm.value.loan_amount; @@ -840,4 +602,179 @@ export class LoanDetailsComponent implements OnInit { } } + /** Validation */ + validateAllFormFields(formGroup: FormGroup) { + Object.keys(formGroup.controls).forEach(field => { + const control = formGroup.get(field); + if (control instanceof FormControl) { + control.markAsTouched({ onlySelf: true }); + } else if (control instanceof FormGroup) { + this.validateAllFormFields(control); + } + }); + } + + /** To save Loan FOrm Details */ + submitLoanDetails() { + + if ((this.isContribution == true)){ + if(this.loanDetailsForm.controls['is_transfer'].value != 'yes') { + this.loanDetailsForm.controls['own_contribution'].setValue(''); + this.loanDetailsForm.controls['own_contribution'].clearValidators(); + this.loanDetailsForm.controls['own_contribution'].updateValueAndValidity(); + this.loanDetailsForm.controls['other_source'].setValue(''); + this.loanDetailsForm.controls['other_source'].clearValidators(); + this.loanDetailsForm.controls['other_source'].updateValueAndValidity(); + this.loanDetailsForm.controls['source'].setValue(''); + this.loanDetailsForm.controls['source'].clearValidators(); + this.loanDetailsForm.controls['source'].updateValueAndValidity(); + } + else if(this.loanDetailsForm.controls['is_transfer'].value == 'yes'){ + + if (this.loanDetailsForm.controls['end_use_topup'].value == 1) { + this.loanDetailsForm.controls['other_end_use_topup'].setValidators([Validators.required]); + this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity(); + } + else { + this.loanDetailsForm.controls['other_end_use_topup'].setValue(''); + this.loanDetailsForm.controls['other_end_use_topup'].clearValidators(); + this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity(); + } + + if (this.loanDetailsForm.controls['lender'].value == 1) { + this.loanDetailsForm.controls['other_bt_lender'].setValidators([Validators.required]); + this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity(); + } + else { + this.loanDetailsForm.controls['other_bt_lender'].setValue(''); + this.loanDetailsForm.controls['other_bt_lender'].clearValidators(); + this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity(); + } + } + } + + if (!this.loanDetailsForm.valid) { + this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); + return; + } + + let records: any = {}; + records.pdid = this.pdid; + records.formid = this.form_id; + records.fk_createdby = this.pdid; + records.loan_amount = this.loanDetailsForm.controls['loan_amount'].value; + records.loan_tenure = this.loanDetailsForm.controls['loan_tenure'].value; + + // get end user final group data + let dataEnd_user_data = []; + + this.loanDetailsForm.controls['end_use'].value.forEach(element => { + dataEnd_user_data.push({ end_use: element }) + }); + + records.end_use_group = dataEnd_user_data; + + records.end_use_other = this.isOtherPurpose ? this.loanDetailsForm.controls['end_use_other'].value : null; + + records.is_transfer = this.loanDetailsForm.controls['is_transfer'].value; + + if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') { + records.balance_transfer_amount = this.loanDetailsForm.controls['balance_transfer_amount'].value; + } + else if (this.loanDetailsForm.controls['is_transfer'].value == 'no') { + if (this.isContribution) { + records.own_contribution = ''; + records.source_group = ''; + records.other_source = ''; + } + else { + records.own_contribution = this.loanDetailsForm.controls['own_contribution'].value; + + let dataSource_list = []; + this.loanDetailsForm.controls['source'].value.forEach(element => { + dataSource_list.push({ sources: element }) + }); + records.source_group = dataSource_list; + } + } + + records.topup_amount = this.loanDetailsForm.controls['topup_amount'].value; + + + if (records.topup_amount > 0) { + records.end_use_topup = this.loanDetailsForm.controls['end_use_topup'].value; + records.other_end_use_topup = records.end_use_topup == 1 ? + this.loanDetailsForm.controls['other_end_use_topup'].value : ''; + } + + if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') { + records.lender = this.loanDetailsForm.controls['lender'].value; + records.other_bt_lender = this.loanDetailsForm.controls['lender'].value == 1 ? + this.loanDetailsForm.controls['other_bt_lender'].value : ''; + } + + records.emi_level = this.loanDetailsForm.controls['emi_level'].value; + if (this.mortageCardAccess == true) { + + records.property_type = this.loanDetailsForm.controls['property_type'].value; + records.property_type_others = this.loanDetailsForm.controls['property_type_others'].value; + let dataOwner_name = []; + this.loanDetailsForm.controls['owner_name'].value.forEach(element => { + dataOwner_name.push({ owner_name: element }) + }); + records.owner_name_group = dataOwner_name; + records.construction_status = this.loanDetailsForm.controls['construction_status'].value; + records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value; + } else { + records.property_type = null; + records.property_type_others = null; + records.owner_name_group = null; + records.construction_status = null; + records.emv_per_customer = null; + } + + records.other_source = this.isOtherSource ? + this.loanDetailsForm.controls['other_source'].value : ''; + + records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value; + + records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value; + + this._pd.saveForm(records).subscribe(data => { + if (data.status == 200) { + this.notifier.notify('success', 'Saved Successfully.'); + // this.dialogRef.close(); + setTimeout(() => { + this.dialogRef.close(); + }, 3000); + } + else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }) + } + + + /** For DOCS tab */ + 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, + } + }; } \ No newline at end of file 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 dad103fba..4f23b10b7 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 @@ -36,6 +36,7 @@ + Select Yes No @@ -84,6 +85,7 @@
+ Select {{list.applicant_name}} @@ -119,6 +121,7 @@
+ Select Positive Negative 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 d49bd592d..284274ae3 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 @@ -235,6 +235,51 @@ export class NeighbourHoodComponent implements OnInit { //save heighbourhood forms saveNeighbourhood(formData:any){ let resultMessage:string=''; + + + // const referencecheckControl = this._neighbourhoodForm.controls['referencecheck_list']; + // const referencecheckControl = this._neighbourhoodForm.get('referencecheck_list') as FormControl; + const neighbourhoodControl : FormGroup = this._neighbourhoodForm.controls['neighbourhood_list'] as FormGroup; + + if(formData.check_type==0){ + console.log('neighbourhoodControl',neighbourhoodControl); + + // neighbourhoodControl.contdols['neighbourhood_name'].setValidators([Validators.required]); + // neighbourhoodControl.controls['neighbourhood_name'].updateValueAndValidity(); + + // neighbourhoodControl.controls['do_know'].setValidators([Validators.required]); + // neighbourhoodControl.controls['do_know'].updateValueAndValidity(); + return; + } + + + // if(formData.check_type==1){ + // referencecheckControl.controls['reference_name'].setValidators([Validators.required]); + // referencecheckControl.controls['reference_name'].updateValueAndValidity(); + + // referencecheckControl.controls['location'].setValidators([Validators.required]); + // referencecheckControl.controls['location'].updateValueAndValidity(); + + // referencecheckControl.controls['mobile'].setValidators([Validators.required]); + // referencecheckControl.controls['mobile'].updateValueAndValidity(); + + // referencecheckControl.controls['relationship_with'].setValidators([Validators.required]); + // referencecheckControl.controls['relationship_with'].updateValueAndValidity(); + + // referencecheckControl.controls['year_relation_applicant'].setValidators([Validators.required]); + // referencecheckControl.controls['year_relation_applicant'].updateValueAndValidity(); + + // referencecheckControl.controls['business_volume_amount'].setValidators([Validators.required]); + // referencecheckControl.controls['business_volume_amount'].updateValueAndValidity(); + + // referencecheckControl.controls['business_volume_unit'].setValidators([Validators.required]); + // referencecheckControl.controls['business_volume_unit'].updateValueAndValidity(); + + // referencecheckControl.controls['reference_final_remarks'].setValidators([Validators.required]); + // referencecheckControl.controls['reference_final_remarks'].updateValueAndValidity(); + + // } + if (this._neighbourhoodForm.invalid) { this.validateAllFormFields(this._neighbourhoodForm); this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); 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 74a444bff..47ac52c6e 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 @@ -24,6 +24,7 @@ + Select Yes No @@ -40,6 +41,7 @@ + Select {{src.name}} +
Manufacturing Stock Details
-
+
-
Manufacturing Stock Details
Raw Material #{{a+1}} @@ -34,7 +34,8 @@ - + + Select Add Stock Details No Stock Observed @@ -44,8 +45,9 @@ - + + Select {{uom.name}} @@ -59,17 +61,6 @@ - - - Yes - No - - - - - Please comment on the stock level observed? - - @@ -89,7 +80,20 @@
-
+ + + + Select + Yes + No + + + + Please comment on the stock level observed? + + + +
@@ -101,7 +105,8 @@ - + + Select Add Stock Details No Stock Observed @@ -111,8 +116,9 @@ - + Select {{uom.name}} @@ -123,20 +129,6 @@ {{"₹"}} {{M_goodsValueInWords[b]}} Only - - - - Yes - No - - - - - Please comment on the finished goods stock level observed? - - - +
Retail Trading Details
- - -
-
Retail Trading Details
Traded Goods #{{e+1}} @@ -195,7 +183,8 @@ - + + Select Add Stock Details No Stock Observed @@ -205,8 +194,9 @@ - + Select {{uom.name}} @@ -217,9 +207,10 @@ {{"₹"}} {{R_tradedGoodsValueInWords[e]}} Only + + @@ -228,12 +219,10 @@ - + - +
Wholesale Trading Details
-
Wholesale Trading Details
+ Traded Goods #{{g+1}} @@ -286,6 +275,7 @@ + Select Add Stock Details No stock observed @@ -295,8 +285,9 @@ - + Select {{uom.name}} @@ -310,18 +301,18 @@ - - + + + Select {{ pm.name }} + Select Payment made in Cash. Payment made through Banking channels. @@ -145,6 +148,7 @@
+ Select {{tl.name}} @@ -187,13 +191,15 @@ {{ pm.name }} --> + Select {{ pm.name }} - Payment received in Cash. - Payment received through Banking channels. + Select + Payment made in Cash. + Payment made through Banking channels. diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index d43d5e8dc..cfa01dd06 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -180,7 +180,7 @@  {{applicant.landline}} - ( Main Applicant ) + ( Applicant ) {{applicant.relation_name}}

@@ -248,11 +248,11 @@ - QC Remarks -
QC Feedback +
-
QC Remarks
+
QC Feedback
@@ -269,6 +269,11 @@ {{ pdMasterData[0]?.qc_feedback}}
+ + +

No Feedback

+
+
PD History