diff --git a/ng6-seed/package-lock.json b/ng6-seed/package-lock.json index 3bcc3772f..c56a6d0a5 100755 --- a/ng6-seed/package-lock.json +++ b/ng6-seed/package-lock.json @@ -11192,4 +11192,4 @@ "integrity": "sha512-W9Nj+UmBJG251wkCacIkETgra4QgBo/vgoEkb4a2uoLzpQG7qF9nzwoLXWU5xj3Fg2mxGvEDh47mg24vXccYjA==" } } -} +} \ No newline at end of file diff --git a/ng6-seed/package.json b/ng6-seed/package.json index c6bc1cb28..30b3524cf 100755 --- a/ng6-seed/package.json +++ b/ng6-seed/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "license": "MIT", "scripts": { + "build-prod": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng", "ng": "ng", "start": "ng serve", "build": "ng build", 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 19ad95809..5936fdbb5 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 @@ -109,7 +109,7 @@ - {{"₹"}} {{loanAmtInWords}} Only + {{"₹"}} {{loanAmtInWords}} Only Enter valid amount. 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 6c23033f2..48b443dc7 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 @@ -273,7 +273,7 @@ export class AddPdComponent implements OnInit, OnDestroy { // save pd in draft saveDraftPD(formValue: any, status:string){ - alert('Inside The Draft PD'); + //alert('Inside The Draft PD'); this.submitPdDetails(formValue, status); } //trigger pd @@ -362,11 +362,11 @@ export class AddPdComponent implements OnInit, OnDestroy { // common function for both draft and process pd submitPdDetails(formValue: any, status:string) { - alert('Inside Function Submit Function'); + //alert('Inside Function Submit Function'); if(this._PDtriggerForm.invalid) { this.validateAllFormFields(this._PDtriggerForm); - alert('validationError'); - console.log(this._PDtriggerForm); + //alert('validationError'); + //console.log(this._PDtriggerForm); return; } else { @@ -473,7 +473,8 @@ export class AddPdComponent implements OnInit, OnDestroy { } /** On Key Press Event For Mobile Number */ keyPress(event: any) { - const pattern = /[0-9/ /./-]/; + // const pattern = /[0-9/ /./-]/; + const pattern = /[0-9]/; let inputChar = String.fromCharCode(event.charCode); if (event.keyCode != 8 && !pattern.test(inputChar)) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts index 247b93d73..c7541c588 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts @@ -42,7 +42,7 @@ export class EditPdApplicantComponent implements OnInit { this._EditApplicantForm = this._fb.group({ fk_applicant_primary_id: [null], applicant_name: [null, Validators.compose([Validators.required])], - mobile_no: [null, Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(12)])], + mobile_no: [null, Validators.compose([Validators.minLength(10),Validators.maxLength(12)])], stdcode: [null, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])], landline: [null, Validators.compose([Validators.minLength(8),Validators.maxLength(12)])], company_name: [null], @@ -59,7 +59,7 @@ export class EditPdApplicantComponent implements OnInit { this._EditApplicantForm = this._fb.group({ fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id], applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])], - mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.required,Validators.required,Validators.minLength(10),Validators.maxLength(12)])], + mobile_no: [this.mainApplicantData[0].mobile_no, Validators.compose([Validators.minLength(10),Validators.maxLength(12)])], stdcode: [stdcode, Validators.compose([Validators.minLength(2),Validators.maxLength(4)])], landline: [landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8)])], company_name: [this.mainApplicantData[0].company_name], @@ -76,9 +76,19 @@ export class EditPdApplicantComponent implements OnInit { } createItem(listData): FormGroup { if(listData){ + console.log(listData.landline); + let stdcode; + let landline; + if(listData.landline != null){ let stdcodesearch = listData.landline.search("-"); - let stdcode = listData.landline.substr(0,stdcodesearch); - let landline = listData.landline.substr(+stdcodesearch + 1,8); + stdcode = listData.landline.substr(0,stdcodesearch); + //console.log(stdcode); + landline = listData.landline.substr(+stdcodesearch + 1,8);} + else{ + stdcode = null; + landline = null; + } + console.log(landline); return this._fb.group({ label: ['Co Applicant'], fk_applicant_primary_id: [listData.pd_co_applicant_id], @@ -136,13 +146,32 @@ export class EditPdApplicantComponent implements OnInit { "isactive":1 }]; formValue.coApplicantItems.forEach((itemElement, itemIndex) => { + // console.log(itemElement.coapplicant_stdcode); + // console.log(itemElement.coapplicant_landline); + let concat_landline + if(itemElement.coapplicant_stdcode != null && itemElement.coapplicant_landline != null){ + if(itemElement.coapplicant_stdcode == '' && itemElement.coapplicant_landline == ''){ + concat_landline = null; + }else{ + let std = itemElement.coapplicant_stdcode == '' ? '' : itemElement.coapplicant_stdcode; + let landline = itemElement.coapplicant_landline == '' ? '' : itemElement.coapplicant_landline; + concat_landline = std+'-'+landline; + } + }else if(itemElement.coapplicant_stdcode == '' && itemElement.coapplicant_landline == ''){ + concat_landline = null; + }else{ + concat_landline = null; + } + + + console.log(concat_landline); let obj1 = { "fk_pd_id": this.data.pdID, "pd_co_applicant_id": itemElement.fk_applicant_primary_id, "applicant_name":itemElement.coapplicantName, "relation":itemElement.relationship, "mobile_no":itemElement.coapplicant_mobile_no, - "landline":itemElement.coapplicant_stdcode+'-'+itemElement.coapplicant_landline, + "landline":concat_landline, "applicant_type":itemElement.applicant_type, "company_name":itemElement.company_name, "isactive":1 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 259d90574..1a5b61117 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 @@ -37,10 +37,8 @@ - + Enter Valid Mobile Number. - - @@ -90,7 +88,7 @@ - {{"₹"}} {{loanAmtInWords}} Only + {{"₹"}} {{loanAmtInWords}} Only Enter valid amount. 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 2c8e9b102..a94f9f4ee 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 @@ -259,7 +259,8 @@ export class EditPdMasterComponent implements OnInit { } /** On Key Press Event For Mobile Number */ keyPress(event: any) { - const pattern = /[0-9/ /./-]/; + //const pattern = /[0-9/ /./-]/; + const pattern = /[0-9]/; let inputChar = String.fromCharCode(event.charCode); if (event.keyCode != 8 && !pattern.test(inputChar)) { 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 e06e9f46c..b11ab1d5b 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 @@ -32,7 +32,7 @@
- + {{m_addressType.address_type}} @@ -42,7 +42,7 @@
- +
@@ -83,6 +83,12 @@
+
+ + + +
+
@@ -95,7 +101,6 @@
- @@ -103,7 +108,8 @@
- + + {{"₹"}} {{rentAmtInwords}} Only
@@ -119,17 +125,36 @@
+ + +
+
+ + + Yes + No + + +
+
+ + + +
+
+ +
- - - + + + Yes No
-
+ @@ -144,79 +169,72 @@
--(Customer Behaviour)--> - - - + + + +
+
+

Additional Unit #{{i+1}}

+ - - - - -
-
- {{at.address_type}} -
-
- - - -
- - - -
- + + + {{m_addressType.address_type}} + + + + + + + + + + + + + + + + + + {{ownerShip.name}} + + + + + + + + + + + {{"₹"}} {{premisesRentAmtInwords[i]}} Only + + + + + + + + + +
+ +
+
+
- -
- -

{{i+1}} . {{PremisesLabel[i]}}

- - - - - - - - - {{CL.name}} - - - - - - - - - {{ownerShip.name}} - - - - - - - - - - - - - - -
-
- + + + @@ -195,12 +219,26 @@ - - + + + {{company.company_name | titlecase}} + + + - + + + + + Purchase Year + + Invalid year format + + +
@@ -217,15 +255,15 @@ - + - + - +
@@ -261,7 +299,7 @@ - +
@@ -277,7 +315,7 @@
- {{ asset.name }} + {{ asset.name | titlecase }}
@@ -290,7 +328,7 @@
- {{ prop.name }} + {{ prop.name | titlecase }} @@ -357,11 +395,12 @@
- + + {{"₹"}} {{OtherPremiumPaidInwords[s]}} Only - {{ freqn.name }} + {{ freqn.name | titlecase }} @@ -371,7 +410,8 @@
- + + {{"₹"}} {{OtherSumAssuredInwords[s]}} Only @@ -392,7 +432,7 @@ - {{ ins_type.name }} + {{ ins_type.name | titlecase }} @@ -401,7 +441,8 @@ - + + {{"₹"}} {{OtherAmtInvestInwords[i]}} Only
@@ -426,44 +467,49 @@
- - - + - {{owner.applicant_name}} + {{owner.applicant_name | titlecase}} - + -
-
+ - - - {{relations.name}} - - - + + + {{relations.name | titlecase}} + + + + +
+
+ + + {{"₹"}} {{OtherAssetValueInwords[s]}} Only + - {{data.viewValue}} + {{data.viewValue | titlecase}} - + + {{"₹"}} {{O_emiAmtInwords[s]}} Only
@@ -480,7 +526,7 @@ - {{owner.applicant_name}} + {{owner.applicant_name | titlecase}} @@ -493,12 +539,22 @@ - {{relations.name}} + {{relations.name | titlecase}}
+ + + + Purchase Year + + Invalid year format + + + +
@@ -514,15 +570,15 @@ - + - + - +
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 e6ddfeeb3..cd9c51767 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 @@ -31,7 +31,7 @@ export class AssetsInfoComponent implements OnInit { pageTitle: string ="Assets Details"; //@Input() pdid: number; pdid:string; - businessProfessionName :string; + //businessProfessionName :string; public _assetsQuesFrom: FormGroup; public submitted = false; @@ -47,6 +47,16 @@ export class AssetsInfoComponent implements OnInit { OtherAppxMarketAmtInwords : any = []; emiAmtInwords : any = []; OtherEmiAmtInwords : any = []; + PremiumPaidInwords : any = []; + OtherPremiumPaidInwords: any = []; + SumAssuredInwords: any = []; + OtherSumAssuredInwords: any = []; + AmtInvestInwords: any = []; + OtherAmtInvestInwords: any = []; + AssetValueInwords: any = []; + OtherAssetValueInwords: any = []; + B_emiAmtInwords: any = []; + O_emiAmtInwords: any = []; // public m_assets_type = [ // { // 'id': "1", @@ -173,6 +183,7 @@ public m_investmentType = []; // ] private notifier: NotifierService; + existCompanyList: any =[]; constructor( notifier: NotifierService, private _formBuilder: FormBuilder, @@ -206,9 +217,14 @@ public m_investmentType = []; ngOnInit() { - this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => { - this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ; - }); + // this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => { + // this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ; + // }); + this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ + if(data.dataStatus){ + this.existCompanyList = data.records.filter(val =>val.is_active); + } + }) this.getPdSupplierFormDetails(); this.getM_Assets_Type(); @@ -299,6 +315,8 @@ public m_investmentType = []; getPdSupplierFormDetails() { this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '4').subscribe( data => { + console.log(data); + console.log(data.records); if (data) { if (data.dataStatus) { this.formLoadData(data.records); @@ -314,6 +332,7 @@ public m_investmentType = []; } formLoadData(val) { + console.log(val); if (val !== null) { let value = val; this._assetsQuesFrom = this._formBuilder.group({ @@ -335,7 +354,7 @@ public m_investmentType = []; this.initDetails(), ]), business_assets_details : this._formBuilder.array([ - this.initBusinessDetails(this.businessProfessionName), + this.initBusinessDetails(), ]), assets_form_remark:[''] }); @@ -359,7 +378,7 @@ public m_investmentType = []; name_of_the_owner: [''], other_owner:[''], relation: [''], - //purchase_year: [''], + purchase_year: ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])], //purchase_month: [''], emi: [''], emi_paid: [''], @@ -369,15 +388,15 @@ public m_investmentType = []; }); } - initBusinessDetails(data) { + initBusinessDetails() { return this._formBuilder.group({ business_assets_mode: [''], business_details: this._formBuilder.array([]), business_approximate_market_value: [''], - business_name_of_the_owner: [data], + business_name_of_the_owner: [], //other_owner:[''], //relation:[''], - //purchase_year: [''], + business_purchase_year: ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])], //purchase_month: [''], business_emi: [''], business_emi_paid: [''], @@ -389,9 +408,6 @@ public m_investmentType = []; show: boolean; selectedAssetsType(e: any, i: any,flag : any): void { - console.log(e); - console.log(i); - console.log(flag); let val = i; if(flag == 1){ const arr = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; @@ -538,11 +554,10 @@ public m_investmentType = []; }); } - - - loadPropertyWithData(data) { + loadPropertyWithData(data) { return this._formBuilder.group({ - property_type: [data.property_type] + property_type: [data.property_type], + other_property_type: [data.other_property_type] //property_type:[''] }); } @@ -624,7 +639,7 @@ public m_investmentType = []; name_of_the_owner: [data.name_of_the_owner], other_owner:[data.other_owner || ''], relation: [data.relation || ''], - // purchase_year: [data.purchase_year], + purchase_year: [data.purchase_year], // purchase_month: [data.purchase_month], emi: [data.emi || 0], emi_paid: [data.emi_paid || ''], @@ -635,6 +650,7 @@ public m_investmentType = []; } initBusinessDetailsWithdata(data) { + return this._formBuilder.group({ business_assets_mode: [data.business_assets_mode], business_details: this._formBuilder.array([]), @@ -642,7 +658,7 @@ public m_investmentType = []; business_name_of_the_owner: [data.business_name_of_the_owner], // other_owner:[data.other_owner || ''], // relation: [data.relation || ''], - // purchase_year: [data.purchase_year], + business_purchase_year: [data. business_purchase_year], // purchase_month: [data.purchase_month], business_emi: [data.business_emi || 0], business_emi_paid: [data.business_emi_paid || ''], @@ -654,10 +670,16 @@ public m_investmentType = []; loadDetails: boolean; addAssetsDetailsWithData(supp_data) { - console.log(supp_data); + //console.log(supp_data); var result = Object.keys(supp_data).map(function (key) { return supp_data[key]; }); + result.forEach((datas,index) => { + + this.OtherAppxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(datas.approximate_market_value); + this.OtherEmiAmtInwords[index] = this.pdTrigerService.convertNumberToWords(datas.emi_paid); + + }); if (result.length > 0) { for (let val of result) { let vals = { @@ -666,7 +688,7 @@ public m_investmentType = []; name_of_the_owner: val.name_of_the_owner, other_owner:val.other_owner, relation: val.relation, - // purchase_year: val.purchase_year, + purchase_year: val.purchase_year, // purchase_month: val.purchase_month, emi: val.emi, emi_paid: val.emi_paid, @@ -684,12 +706,16 @@ public m_investmentType = []; addBusinessAssetsDetailsWithData(supp_data) { - console.log(supp_data); - var result = Object.keys(supp_data).map(function (key) { return supp_data[key]; }); + if (result.length > 0) { + result.forEach((datas,index) => { + this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(datas.business_approximate_market_value); + this.emiAmtInwords[index] = this.pdTrigerService.convertNumberToWords(datas.business_emi_paid); + }); + for (let val of result) { let vals = { business_assets_mode: val.business_assets_mode, @@ -697,7 +723,7 @@ public m_investmentType = []; business_name_of_the_owner: val.business_name_of_the_owner, // other_owner: val.other_owner, // relation : val.relation, - // purchase_year: val.purchase_year, + business_purchase_year: val. business_purchase_year, // purchase_month: val.purchase_month, business_emi: val.business_emi, business_emi_paid: val.business_emi_paid, @@ -706,10 +732,6 @@ public m_investmentType = []; business_balance_tenure: val.business_balance_tenure }; - // const control = this._assetsQuesFrom.controls['assets_details']; - // control.push(this.initDetailsWithdata(vals)); - // this.setAssetsDetailsWithData(vals.business_assets_mode, val.details, control.length - 1) - const control = this._assetsQuesFrom.controls['business_assets_details']; control.push(this.initBusinessDetailsWithdata(vals)); this.setBusinessAssetsDetailsWithData(vals.business_assets_mode, val.business_details, control.length - 1) @@ -720,28 +742,41 @@ public m_investmentType = []; setAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void { let val = i; - // var data = Object.keys(datas).map(function (key) { + // let data = Object.keys(datas).map(function (key) { // return datas[key]; // }); - // alert(JSON.stringify(datas)); + //alert('JSON Other Asset'+JSON.stringify(datas)); let data = datas; + const arr = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; arr.controls.splice(0); switch (assets_details_mode) { case '1': { + let array_data : any; + data.forEach((datas,i) => { + array_data = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type }; + }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.loadPropertyWithData(data)); + control.push(this.loadPropertyWithData(array_data)); break; } case '2': { + let array_data : any; + data.forEach((datas,i) => { + array_data = { 'manufacturer_model_four_weeler': datas.manufacturer_model_four_weeler }; + }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.load_Four_WeelerWithData(data)); + control.push(this.load_Four_WeelerWithData(array_data)); break; } case '3': { + let array_data : any; + data.forEach((datas,i) => { + array_data = { 'manufacturer_model_two_weeler': datas.manufacturer_model_two_weeler }; + }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.load_Two_WeelerWithData(data)); + control.push(this.load_Two_WeelerWithData(array_data)); break; } case '4': { @@ -750,23 +785,60 @@ public m_investmentType = []; break; } case '5': { + let array_data : any; + data.forEach((datas,i) => { + array_data = { 'consumer_durable_description': datas.consumer_durable_description }; + }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.loadConsumerDurableDescriptionWithData(data)); + control.push(this.loadConsumerDurableDescriptionWithData(array_data)); break; } case '6': { + let array_data : any; + data.forEach((datas,i) => { + this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid); + this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured); + array_data = { + '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._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.loadInsuranceDescriptionWithData(data)); + control.push(this.loadInsuranceDescriptionWithData(array_data)); break; } case '7': { + let array_data : any; + data.forEach((datas,i) => { + this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest); + array_data = { '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._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.loadInvestDescriptionWithData(data)); + control.push(this.loadInvestDescriptionWithData(array_data)); break; } case '8': { + 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, + 'relation':datas.relation, + 'any_other_asset_value' : datas.any_other_asset_value, + 'any_other_asset_loan' : datas.any_other_asset_loan, + 'other_asset_emi_amt' : datas.other_asset_emi_amt + }; + this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.any_other_asset_value); + this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt); + }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.otherAssetsDescriptionWithData(data)); + control.push(this.otherAssetsDescriptionWithData(array_data)); break; } default: { @@ -776,48 +848,97 @@ public m_investmentType = []; } setBusinessAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void { + let val = i; let data = datas; + const arr = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; arr.controls.splice(0); switch (assets_details_mode) { case '1': { + let business_property_datas : any; + data.forEach((datas,i) => { + business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type }; + }); const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.loadPropertyWithData(data)); + control.push(this.loadPropertyWithData(business_property_datas)); break; } case '2': { + let business_Four_Weeler_datas : any; + data.forEach((datas,i) => { + business_Four_Weeler_datas = { 'manufacturer_model_four_weeler': datas.manufacturer_model_four_weeler }; + }); const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.load_Four_WeelerWithData(data)); + control.push(this.load_Four_WeelerWithData(business_Four_Weeler_datas)); break; } case '3': { + let business_Two_Weeler_datas : any; + data.forEach((datas,i) => { + business_Two_Weeler_datas = { 'manufacturer_model_two_weeler': datas.manufacturer_model_two_weeler }; + }); const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.load_Two_WeelerWithData(data)); + control.push(this.load_Two_WeelerWithData(business_Two_Weeler_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._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.loadConsumerDurableDescriptionWithData(data)); + 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._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.loadInsuranceDescriptionWithData(data)); + 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._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.loadInvestDescriptionWithData(data)); + control.push(this.loadInvestDescriptionWithData(business_InvestDescription_datas)); break; } case '8': { + let array_datas : any; + data.forEach((datas,i) => { + this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value); + this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt); + 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, + 'other_asset_emi_amt' : datas.other_asset_emi_amt + }; + }); const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.otherBusinessAssetsDescriptionWithData(data)); + control.push(this.otherBusinessAssetsDescriptionWithData(array_datas)); break; } default: { @@ -835,7 +956,7 @@ public m_investmentType = []; control.push(this.initDetails()); }else if(flag == 2){ const control = this._assetsQuesFrom.controls['business_assets_details']; - control.push(this.initBusinessDetails(this.businessProfessionName)); + control.push(this.initBusinessDetails()); } } @@ -875,6 +996,7 @@ public m_investmentType = []; /** To Save/Edited Popup Data */ onSubmit() { + console.log(this._assetsQuesFrom.value); this.submitted = true; // stop here if form is invalid @@ -903,7 +1025,7 @@ public m_investmentType = []; val.business_elapsed_tenure = ''; } }); - +console.log(answerFormValues); // Save the data with help of Service this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe( dataresult => { @@ -979,8 +1101,38 @@ inWords(e,i,flag){ case 4 : this.OtherEmiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); break; + case 5 : + this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 6 : + this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 7 : + this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 8 : + this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 9 : + this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 10 : + this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 11 : + this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 12 : + this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 13: + this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + case 14: + this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; default: break; } } -} +} \ No newline at end of file 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 5f49171f5..40ddb996e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.html @@ -95,7 +95,7 @@ - + {{owner.applicant_name}} @@ -106,14 +106,14 @@ - + {{ btLen.lender_name }} @@ -124,7 +124,7 @@ - + {{ prop.name }}

- + - +
@@ -294,7 +294,7 @@
Remarks - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts index 6eba35463..3238505df 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts @@ -149,20 +149,20 @@ export class BankingDetailsComponent implements OnInit { createBankarray() { return this.fb.group({ - applicant_name: ['', Validators.compose([Validators.required])], + applicant_name: [''], other_applicant : [''], - bank_name: ['', Validators.compose([Validators.required])], + bank_name: [''], other_bank: [''], - account_type: ['', Validators.compose([Validators.required])], - //salary: ['', Validators.compose([Validators.required])], - salary: this.pd_cus_segment.substring(0,2) == 'SE' ? [''] : ['', Validators.compose([Validators.required])], - limit: ['', Validators.compose([Validators.required])], - //is_main: ['', Validators.compose([Validators.required])], - //is_main: [this.pd_cus_segment == 'SAL' ? '' : '', Validators.compose([Validators.required])], + account_type: [''], + //salary: [''], + salary: this.pd_cus_segment.substring(0,2) == 'SE' ? [''] : [''], + limit: [''], + //is_main: [''], + //is_main: [this.pd_cus_segment == 'SAL' ? '' : ''], //is_main:[''], - is_main: this.pd_cus_segment == 'SAL' ? [''] : ['', Validators.compose([Validators.required])], - vintage_year: ['', Validators.compose([Validators.required])], - vintage_month: ['', Validators.compose([Validators.required])], + is_main: this.pd_cus_segment == 'SAL' ? [''] : [''], + vintage_year: [''], + vintage_month: [''], }); } @@ -190,9 +190,6 @@ export class BankingDetailsComponent implements OnInit { } bankSubmit() { - if (!this.bankingForm.valid) { - return; - } let records: any = {}; records.pdid = this.pdid; records.formid = '7'; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html new file mode 100644 index 000000000..59b4577a5 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html @@ -0,0 +1,29 @@ +

+
{{pageTitle}}
+
+ + +
+

+ + + + + {{companyList.company_name}} + + +
+ + + {{quesIndex+1}} +
+ {{ formButton.form_name }} +
+
+
+
+
+
+ +
+ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss new file mode 100644 index 000000000..eb88eeecc --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss @@ -0,0 +1,33 @@ +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + } + + .p-text { + color:#e00201 !important; + font-weight: bold; + } + ::ng-deep .mat-card-header-text{ + margin:0px !important; +} +.mat-purple{ + background-color: gray !important; +} + .cdk-global-overlay-wrapper{ + justify-content: center !important; +} + + $base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important; +mat-card .child_mat_card > mat-card { + border-radius: 0px 0px 0px 15px; + box-shadow: $base-card-box-shadow; + transform: scale(0.95); + transition: box-shadow 0.5s, transform 0.5s; + &:hover { + cursor: pointer; + // background-color: #e00201 !important; + transform: scale(1); + box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2); + } + + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts new file mode 100644 index 000000000..ee3eb698a --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BusinessInfoGroupComponent } from './business-info-group.component'; + +describe('BusinessInfoGroupComponent', () => { + let component: BusinessInfoGroupComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BusinessInfoGroupComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BusinessInfoGroupComponent); + 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/business-info-group/business-info-group.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts new file mode 100644 index 000000000..30ecde6c7 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts @@ -0,0 +1,110 @@ +import { Component,OnInit,Inject,Input} from '@angular/core'; +import { NotifierService } from 'angular-notifier'; +import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material'; +/** Service */ +import { PdTrigerService } from './../../../../../pd-service/pd-triger.service'; +import {ActivatedRoute, Router} from "@angular/router"; +import {SupplierInfoComponent} from './../../forms/supplier-info/supplier-info.component'; +import {ClientInfoComponent} from './../../forms/client-info/client-info.component'; +import {StockComponent} from './../../forms/stock/stock.component'; +import {FinancialInfoComponent} from './../../forms/financial-info/financial-info.component'; +import {BusinessInfoComponent} from './../../forms/business-info/business-info.component'; + +@Component({ + selector: 'app-business-info-group', + templateUrl: './business-info-group.component.html', + styleUrls: ['./business-info-group.component.scss'] +}) +export class BusinessInfoGroupComponent implements OnInit { + pageTitle: string ="Business Information"; + existCompanyList: any = []; + pdid: number; + form_id: number; + constructor(notifier: NotifierService, + private route: ActivatedRoute, + private router: Router, + private _pd: PdTrigerService, + @Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialog: MatDialog) { + this.pdid = this.pd_all_details.pdmaster_details.pd_id; + this.form_id = 13; + } + + ngOnInit() { + this.getCompanyListForBusiness(); + } + getCompanyListForBusiness(): void{ + this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ + if(data.dataStatus){ + this.existCompanyList = data.records.filter(val =>val.is_active); + } + }) + } + + // direct form based questions + OnSelectBusinessGroupForms(details: any, company: any) { + this.pd_all_details.company_id =company.company_order_id; + this.pd_all_details.company_name =company.company_name; + if(details.form_id==1){ + const dialogRef = this.dialog.open(SupplierInfoComponent, { + data: this.pd_all_details, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + this.getCompanyListForBusiness(); + }); + } + else if(details.form_id==2){ + const dialogRef = this.dialog.open(ClientInfoComponent, { + data: this.pd_all_details, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + this.getCompanyListForBusiness(); + }); + } + else if(details.form_id==11){ + const dialogRef = this.dialog.open(StockComponent, { + data: this.pd_all_details, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + this.getCompanyListForBusiness(); + }); + } + else if(details.form_id==13){ + const dialogRef = this.dialog.open(BusinessInfoComponent, { + data: this.pd_all_details, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + this.getCompanyListForBusiness(); + }); + } + else if(details.form_id==14){ + const dialogRef = this.dialog.open(FinancialInfoComponent, { + data: this.pd_all_details, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + this.getCompanyListForBusiness(); + }); + } + +} + +} 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 5ce935af8..d19993c86 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 @@ -26,8 +26,8 @@ - {{company | titlecase}} - Others + {{company.company_name}} + @@ -37,7 +37,7 @@ - {{entity.business_entity_type_name | titlecase}} + {{entity.business_entity_type_name}} @@ -102,24 +102,35 @@ [formGroupName]="i"> - + + {{app_par.applicant_name | titlecase}} + Others + - + + + + + formControlName="shareholding">

No of Years in Current Business

- + - + + + + + - @@ -77,8 +77,126 @@ + + + + + Person Relationship + + + + + Name + + + + {{details.value.applicant_name | titlecase}} + + + + Relation + + + + Select + {{member.name + ' of' | titlecase}} + Not Applicable + + + + + + Relationship To + + + + Select + {{appc.applicant_name | titlecase}} + Not Applicable + + + + + + + + + + + + + + + + + + Company/Firm Relationship + + + + + + + + + Applicant + + + + {{appc.applicant_name | titlecase}} + + + + + + Relation + + + Select + + {{comrelShip.name + ' of' | titlecase}} + + Not Applicable + + + + + + Company + + + + Select + + {{comp.company_name}} + + Not Applicable + + + + + + + + + + + + + + + + + + -
+ + {{rel.applicant_name | titlecase}} - + + +
Remarks - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss old mode 100755 new mode 100644 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.spec.ts old mode 100755 new mode 100644 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts old mode 100755 new mode 100644 index 5cd6e6e98..c7ef5161b --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts @@ -4,6 +4,8 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , MatTableDataSource} from '@a import { NotifierService } from 'angular-notifier'; import { PdTrigerService } from './../../../../../pd-service/pd-triger.service'; import {OtherApplicantDetailsComponent} from './../dialogue/other-applicant-details/other-applicant-details.component'; +import { element } from '@angular/core/src/render3/instructions'; +import { ELEMENT_PROBE_PROVIDERS } from '@angular/platform-browser/src/dom/debug/ng_probe'; @Component({ selector: 'app-general-info', templateUrl: './general-info.component.html', @@ -13,10 +15,16 @@ export class GeneralInfoComponent implements OnInit { pageTitle: string ="General Information"; pdid : string; form_id:number; + is_new : boolean; + count : number = 1; private notifier: NotifierService; public _generalForm: FormGroup; displayedColumns = ['applicant_name','is_person_met','is_applicant']; public individualsSource= new MatTableDataSource(); + public relationSource= new MatTableDataSource(); + public CompanySource = new MatTableDataSource(); + secondDisplayedColumns = ['applicant_name','relation','relation_to']; + thridDisplayedColumns = ['applicant_name','company_relationship','relation_to_company']; public pd_applicants_details: any; relationShipList:any=[]; companyRelationShipList:any=[]; @@ -47,8 +55,21 @@ export class GeneralInfoComponent implements OnInit { // update company details this._generalForm.controls['companies'].valueChanges.subscribe(val=>{ let control = this._generalForm.controls['companies']; - this.companyList = control.value.filter(element =>element.company_name); + this.companyList = control.value.filter(element =>element.company_name && element.is_active); }); + + this._generalForm.controls['persons_with_relationships'].valueChanges.subscribe(val=>{ + let control = this._generalForm.controls['persons_with_relationships']; + this.relationSource.data =control.controls; + //this.individualsList = control.value.filter(element =>element.is_applicant===true); + }); + + // change relation with businees update dat sorce table + this._generalForm.controls['company_with_relationships'].valueChanges.subscribe(val=>{ + let ComapnyControl = this._generalForm.controls['company_with_relationships']; + this.CompanySource .data =ComapnyControl.controls; + }); + } // init form @@ -56,11 +77,13 @@ export class GeneralInfoComponent implements OnInit { this._generalForm = this._fb.group({ pdid:this.pdid, formid:this.form_id, - applicant_relation: this._fb.array([]), + //applicant_relation: this._fb.array([]), individuals: this._fb.array([]), companies: this._fb.array([]), + persons_with_relationships: this._fb.array([]), + company_with_relationships: this._fb.array([]), general_remark:'' - }); + }) this.loadFormData(); } // get all master details @@ -70,9 +93,12 @@ export class GeneralInfoComponent implements OnInit { if (data.status == 200) { if(type==1){ this.relationShipList=data.records.filter(item => item.isactive == 1); + + //this.relationShipList.push({'relationship_id':"0",'name':'Not Applicable'}); } if(type==2){ this.companyRelationShipList=data.records.filter(item => item.isactive == 1); + this.companyRelationShipList=data.records.filter(item => item.name != 'Others'); } } @@ -86,13 +112,18 @@ export class GeneralInfoComponent implements OnInit { params.pd_form_id = '18'; let individualsControl = this._generalForm.controls['individuals']; let companyControl = this._generalForm.get('companies') as FormArray; - let relationControl = this._generalForm.controls['applicant_relation']; + //let relationControl = this._generalForm.controls['applicant_relation']; + let personsWithRelationshipsControl = this._generalForm.controls['persons_with_relationships']; + let companyWithRelationshipsControl = this._generalForm.controls['company_with_relationships']; individualsControl.controls = []; - relationControl.controls = []; + //relationControl.controls = []; companyControl.controls = []; + personsWithRelationshipsControl.controls = []; let exist_individuals:any; let exist_companies:any; let exist_relation:any; + let exist_personsWithRelationships:any; + let exist_companyWithRelationships:any; this._pd.retriveForm(params).subscribe(data => { if(data.dataStatus) { this._generalForm.controls['general_remark'].setValue(data.records.general_remark ? data.records.general_remark : ''); @@ -107,63 +138,90 @@ export class GeneralInfoComponent implements OnInit { individualsControl.push(this.createIndividulas(element)) }); } + + // create persons with relationships + exist_personsWithRelationships=Object.keys(data.records.persons_with_relationships).map(function(key) { + return data.records.persons_with_relationships[key]; + }); + + if(exist_personsWithRelationships.length>0){ + exist_personsWithRelationships.forEach(element => { + //individualsControl.push(this.createIndividulas(element)) + personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element)); + }); + } + + exist_companyWithRelationships=Object.keys(data.records.company_with_relationships).map(function(key) { + return data.records.company_with_relationships[key]; + }); + + if(exist_companyWithRelationships.length>0){ + exist_companyWithRelationships.forEach(element => { + //individualsControl.push(this.createIndividulas(element)) + companyWithRelationshipsControl.push(this.createCompaniesRelationshipWithData(element)); + }); + } + // create companies exist_companies = Object.keys(data.records.companies).map(function(key) { return data.records.companies[key]; }); if(exist_companies.length>0){ - exist_companies.forEach(element => { - companyControl.push(this.createCompanies(element)) + exist_companies.forEach((element,cindex) => { + companyControl.push(this.createCompanies(element)); + if(element.is_active==false){ + let control: any = this._generalForm.get('companies') as FormArray; + control.controls[cindex].controls.company_name.clearValidators(); + control.controls[cindex].controls.company_name.updateValueAndValidity(); + } + }); } // create relations - exist_relation = Object.keys(data.records.applicant_relation).map(function(key) { - return data.records.applicant_relation[key]; - }); - if(exist_relation.length>0){ - exist_relation.forEach((element,index) => { - relationControl.push(this.createApplicantRelation(element)); - let innerrelControl:any = relationControl.controls[index].get('multiple_relation') as FormArray; - element.multiple_relation.forEach((innereElement) => { - innerrelControl.push(this.createMultipleRelation(innereElement)); - }); - let innercomrelControl:any = relationControl.controls[index].get('multiple_company_relation') as FormArray; - element.multiple_company_relation.forEach((innerecomElement) => { - innercomrelControl.push(this.createMultipleCompanyRelation(innerecomElement)); - }); - }); - - - - - - } + // exist_relation = Object.keys(data.records.applicant_relation).map(function(key) { + // return data.records.applicant_relation[key]; + // }); + // if(exist_relation.length>0){ + // exist_relation.forEach((element,index) => { + // relationControl.push(this.createApplicantRelation(element)); + // let innerrelControl:any = relationControl.controls[index].get('multiple_relation') as FormArray; + // element.multiple_relation.forEach((innereElement) => { + // innerrelControl.push(this.createMultipleRelation(innereElement)); + // }); + // let innercomrelControl:any = relationControl.controls[index].get('multiple_company_relation') as FormArray; + // element.multiple_company_relation.forEach((innerecomElement) => { + // innercomrelControl.push(this.createMultipleCompanyRelation(innerecomElement)); + // }); + // }); + // } } else { this.pd_applicants_details.forEach((element,key) => { element.is_applicant=true; element.is_person_met=false; + element.is_new=false; element.individuals_order_id = key+1 individualsControl.push(this.createIndividulas(element)); - let relationControl = this._generalForm.controls['applicant_relation']; - let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name, 'individula_order_id':relationControl.controls.length+1}; - relationControl.push(this.createApplicantRelation(applicant_details)); - let mulRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_relation'); - mulRelationControl.push(this.createMultipleRelation(applicant_details)) - let mulCmyRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation'); - mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details)) + personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element)); + //let relationControl = this._generalForm.controls['applicant_relation']; + // let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name, 'individula_order_id':relationControl.controls.length+1}; + // relationControl.push(this.createApplicantRelation(applicant_details)); + // let mulRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_relation'); + // mulRelationControl.push(this.createMultipleRelation(applicant_details)) + // let mulCmyRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation'); + // mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details)) // create companies if(element.company_name!='' && element.company_name!=null){ - let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:element.company_name} + let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:element.company_name,is_active:true} companyControl.push(this.createCompanies(setCompanyValues)) } }); // check company if null update one row if(companyControl.controls.length ==0){ - let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:''} + let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:'',is_active:true} companyControl.push(this.createCompanies(setCompanyValues)) } @@ -178,6 +236,16 @@ export class GeneralInfoComponent implements OnInit { applicant_name: [elementValue.applicant_name], is_applicant:[elementValue.is_applicant], is_person_met:[elementValue.is_person_met], + is_new:[elementValue.is_new], + individuals_order_id: [elementValue.individuals_order_id], + }); + } + createPersonsWithRelationships(elementValue:any){ + return this._fb.group({ + pd_co_applicant_id: [elementValue.pd_co_applicant_id], + applicant_name: [elementValue.applicant_name], + relationship:[elementValue.relationship], + relation_to:[elementValue.relation_to], individuals_order_id: [elementValue.individuals_order_id], }); } @@ -185,21 +253,68 @@ export class GeneralInfoComponent implements OnInit { createCompanies(elementValue:any) { return this._fb.group({ company_order_id: [elementValue.company_order_id], - company_name: [elementValue.company_name,Validators.required], + company_name: [elementValue.company_name], + company_messrs_name: ['M/s'], + is_active: [elementValue.is_active] }); } + // createCompaniesRelationship(elementValue:any) { + // return this._fb.group({ + // applicant_name:[elementValue.applicant_name], + // company_relationship:[elementValue.company_relationship], + // relation_to_company:[elementValue.relation_to_company] + // }); + // } + + createCompaniesRelationship() { + return this._fb.group({ + applicant_name:[''], + company_relationship:[''], + relation_to_company:[''] + }); + } + + createCompaniesRelationshipWithData(elementValue:any) { + return this._fb.group({ + applicant_name:[elementValue.applicant_name], + company_relationship:[elementValue.company_relationship], + relation_to_company:[elementValue.relation_to_company] + }); + } + + // open other family family member details + addCompanyRelationshipDialogue() { + let control: any = this._generalForm.get('company_with_relationships') as FormArray; + //let setValues: any = { applicant_name:'', company_relationship:'',relation_to_company:''}; + control.push(this.createCompaniesRelationship()) + } + + // remove other famil membre + removeCompanyRelationship(indexValues){ + let control: any = this._generalForm.get('company_with_relationships') as FormArray; + control.removeAt(indexValues); + // control.controls[indexValues].controls.company_name.clearValidators(); + // control.controls[indexValues].controls.company_name.updateValueAndValidity(); + //control.removeAt(indexValues); + } + // add more companies addMoreCompanies() { let control: any = this._generalForm.get('companies') as FormArray; - let setValues: any = {company_order_id :control.controls.length+1,company_name:''} + let setValues: any = {company_order_id :control.controls.length+1,company_name:'',is_active:true} control.push(this.createCompanies(setValues)) } // remove companies removeCompanies(indexValues) { + this.count = this.count-1; + console.log('removed Count',this.count); let control: any = this._generalForm.get('companies') as FormArray; - control.removeAt(indexValues); + control.controls[indexValues].controls.is_active.setValue(false); + control.controls[indexValues].controls.company_name.clearValidators(); + control.controls[indexValues].controls.company_name.updateValueAndValidity(); + //control.removeAt(indexValues); } // create applicant form array @@ -227,6 +342,7 @@ export class GeneralInfoComponent implements OnInit { return this._fb.group({ applicant_relation_to: [elementValue.applicant_relation_to], relationship: [elementValue.relationship], + other_relationship:[elementValue.other_relationship] }); } @@ -234,7 +350,7 @@ export class GeneralInfoComponent implements OnInit { addMoreRelation(rindex,mindex) { let control: any = this._generalForm.get('applicant_relation') as FormArray; control = control.controls[rindex].get('multiple_relation') as FormArray; - let setValues: any = {applicant_relation_to :'',relationship:''} + let setValues: any = {applicant_relation_to :'',relationship:'',other_relationship:''} control.push(this.createMultipleRelation(setValues)) } @@ -248,15 +364,16 @@ export class GeneralInfoComponent implements OnInit { // create multiple company relation createMultipleCompanyRelation(elementValue: any) { return this._fb.group({ - company_name: [elementValue.company_name,Validators.required], + company_name: [elementValue.company_name], company_relationship: [elementValue.company_relationship], + company_other_relationship:[elementValue.company_other_relationship] }); } // add more company relation addMoreCompanyRelation(rindex,cindex) { let control: any = this._generalForm.get('applicant_relation') as FormArray; control = control.controls[rindex].get('multiple_company_relation') as FormArray; - let setValues: any = {company_name :'',company_relationship:''} + let setValues: any = {company_name :'',company_relationship:'',company_other_relationship:''} control.push(this.createMultipleCompanyRelation(setValues)) } @@ -269,6 +386,7 @@ export class GeneralInfoComponent implements OnInit { // add more individuals details addMoreIndividuals() { + console.log('Initial Count',this.count); const dialogRef = this.dialog.open(OtherApplicantDetailsComponent, { data: '', width:'40%', @@ -277,17 +395,28 @@ export class GeneralInfoComponent implements OnInit { dialogRef.afterClosed() .subscribe(dataresult => { if(dataresult.data.length>0){ - dataresult.data.forEach(element => { + dataresult.data.forEach((element,index) => { + console.log('Foreach Entry Count',this.count); let individualsControl = this._generalForm.controls['individuals']; + element.pd_co_applicant_id = this.count; + this.count = this.count+1; element.individuals_order_id = individualsControl.controls.length+1; + element.is_new=true; individualsControl.push(this.createIndividulas(element)); - let relationControl = this._generalForm.controls['applicant_relation']; - let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','company_name':'','company_relation':'','individuals_order_id':element.individuals_order_id}; - relationControl.push(this.createApplicantRelation(applicant_details)); - let mulRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_relation'); - mulRelationControl.push(this.createMultipleRelation(applicant_details)) - let mulCmyRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation'); - mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details)) + console.log('Foreach Entry Count with Incremented',this.count); + console.log('Final Count',this.count); + + let relationControl = this._generalForm.controls['persons_with_relationships']; + let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'relationship':'','relation_to':'','individuals_order_id':element.individuals_order_id}; + relationControl.push(this.createPersonsWithRelationships(applicant_details)); + + // let relationControl2 = this._generalForm.controls['applicant_relation']; + // let applicant_details2: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','other_relation':'','company_name':'','company_relation':'','company_other_relation':'','individuals_order_id':element.individuals_order_id}; + // relationControl2.push(this.createApplicantRelation(applicant_details2)); + // let mulRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_relation'); + // mulRelationControl.push(this.createMultipleRelation(applicant_details)) + // let mulCmyRelationControl = relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation'); + // mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details)) }); } @@ -304,21 +433,26 @@ export class GeneralInfoComponent implements OnInit { // submit form details submitGeneralForm(formData:any) { if (this._generalForm.invalid) { + console.log('if',this._generalForm.value); this.validateAllFormFields(this._generalForm); return; } - else if(formData.applicant_relation.length==0){ - this.notifier.notify('warning', 'Please Choose Name of Person Met.!'); - - } + // else if(formData.applicant_relation.length==0){ + // console.log('else if',this._generalForm.value); + // this.notifier.notify('warning', 'Please Choose Name of Person Met.!'); + // } else{ + console.log('else',this._generalForm.value); let saveRecords:any = {} saveRecords.pdid=formData.pdid; saveRecords.formid=formData.formid; saveRecords.individuals=formData.individuals; saveRecords.companies=formData.companies; - saveRecords.applicant_relation=formData.applicant_relation; + saveRecords.persons_with_relationships=formData.persons_with_relationships; + saveRecords.company_with_relationships=formData.company_with_relationships; + //saveRecords.applicant_relation=formData.applicant_relation; saveRecords.general_remark=formData.general_remark; + // console.log(saveRecords); this._pd.savePDFormDetailsWithID(saveRecords).subscribe( dataresult => { if (dataresult.status == 200) { @@ -335,7 +469,19 @@ export class GeneralInfoComponent implements OnInit { }); } } - + + // selectedfrequency(e,i){ + // switch(+e){ + // case 1: this.placeholderName[i] = 'Weekly Instalment Amount'; break; + // case 2: this.placeholderName[i] = 'Daily Instalment Amount'; break; + // case 3: this.placeholderName[i] = 'Annual Instalment Amount'; break; + // case 4: this.placeholderName[i] = 'Hourly Instalment Amount'; break; + // case 5: this.placeholderName[i] = 'EMI Amount'; break; + // case 6: this.placeholderName[i] = 'Quarterly Instalment Amount'; break; + // case 7: this.placeholderName[i] = 'Halfyearly Instalment Amount'; break; + // default : this.placeholderName[i] = ''; break; + // } + // } // validate all form group and form array fields validateAllFormFields(formGroup: any) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.ts index 8530de8d8..6ff4bfdc8 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.ts @@ -82,8 +82,8 @@ export class LenderRepresentativeComponent implements OnInit { } public initRepresentative(): void { this.representativeForm = this.fb.group({ - lender_representative_accompany: ['', Validators.compose([Validators.required])], - representative_remarks: ['', Validators.compose([Validators.required])], + lender_representative_accompany: [''], + representative_remarks: [''], lender_representative_details: this.fb.array([]), }); } @@ -99,8 +99,8 @@ export class LenderRepresentativeComponent implements OnInit { } createLRDetail() { return this.fb.group({ - lender_representative_who_accompanies : ['', Validators.compose([Validators.required])], - lender_representative_carry_loan_files: ['', Validators.compose([Validators.required])], + lender_representative_who_accompanies : [''], + lender_representative_carry_loan_files: [''], }); } 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 a2ba31c75..02c4e8e7b 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 @@ -20,13 +20,13 @@
- - {{"₹"}} {{loanAmtInWords}} Only + + {{"₹"}} {{loanAmtInWords}} Only
- + {{ enduse.name }} -

Mortgage

+

Details of Property being Mortgaged

- + {{ typeprop.property_name }} @@ -169,7 +169,7 @@
+ formControlName="owner_name" (selectionChange)="ownerNameChange($event)" > {{owner.applicant_name}} Others (Please Specify) @@ -180,15 +180,15 @@ - + {{ status.name }} - + @@ -319,7 +319,7 @@ Remarks - +
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 82510bd52..015cce3a0 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 @@ -107,7 +107,6 @@ export class LoanDetailsComponent implements OnInit { }; ngOnInit() { console.clear(); - console.log(this.pd_all_details); this.initloanDetailsForm(); this.getM_EndUseofLoad(); this.getM_sourceofamount(); @@ -119,7 +118,6 @@ export class LoanDetailsComponent implements OnInit { params.pd_form_id = this.form_id; this._pd.retriveForm(params).subscribe(value => { // *ngIf="productAbbr === 'HL' || productAbbr === 'LL' || productAbbr === 'LAP' " - console.log('value', value); if (value.status == 200) { let result = Object.keys(value.records.end_use_group).map(function(key) { return value.records.end_use_group[key]; @@ -178,15 +176,12 @@ export class LoanDetailsComponent implements OnInit { return value.records.source_group[key]; }); - console.log(source); let dbsourcelist : any = []; source.forEach(val => { dbsourcelist.push(val.sources); }); - console.log('sources',dbsourcelist); - this.loanDetailsForm.controls['own_contribution'].setValue(value.records.own_contribution); if(value.records.own_contribution){ this.ownContributionInWords = this._pd.convertNumberToWords(value.records.own_contribution); } @@ -223,12 +218,12 @@ export class LoanDetailsComponent implements OnInit { 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.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); @@ -287,13 +282,11 @@ getM_sourceofamount() { function(data){ if(that.productAbbr != "LAP"){ if(data.group_name == that.productAbbr && data.isactive==1){ - console.log('if data'); return data; } } else if(that.productAbbr == "LAP"){ if(data.sub_group_name == that.subProductName && data.isactive==1){ - console.log('else data'); return data; } } @@ -346,11 +339,11 @@ getM_sourceofamount() { public initloanDetailsForm(): void { this.loanDetailsForm = this.fb.group({ - loan_amount: [this.exist_loan_amt, Validators.compose([Validators.required])], - end_use: ['', Validators.compose([Validators.required])], + loan_amount: [this.exist_loan_amt], + end_use: [''], end_use_other: [''], - is_transfer: ['', Validators.compose([Validators.required])], - //is_topup: ['', Validators.compose([Validators.required])], + is_transfer: [''], + //is_topup: [''], is_topup: [''], balance_transfer_amount: [''], topup_amount: [''], @@ -362,16 +355,16 @@ getM_sourceofamount() { other_source:[''], personal_loan_source:[''], //lender_name_type: [''], - emi_level: ['', Validators.compose([Validators.required])], - property_type: ['', Validators.compose([Validators.required])], + emi_level: [''], + property_type: [''], property_type_others:[''], - owner_name: ['', Validators.compose([Validators.required])], + owner_name: [''], other_owners_name :[''], - construction_status: ['', Validators.compose([Validators.required])], - percentage_of_construction : [''], - emv_per_customer: ['', Validators.compose([Validators.required])], - //value_per_agreement: ['', Validators.compose([Validators.required])], - loandetails_remarks: ['', Validators.compose([Validators.required])], + construction_status: [''], + //percentage_of_construction : [''], + emv_per_customer: [''], + //value_per_agreement: [''], + loandetails_remarks: [''], }); } // endUserChange(event) { @@ -390,9 +383,6 @@ getM_sourceofamount() { event.forEach(option => { let othersData = this.m_endUseofLoad.filter(sub=>sub.subproduct_id==option)[0]; OthersAvaliable = othersData.name.substr(0,6).toLowerCase(); - console.log('other',othersData); - console.log('',OthersAvaliable); - this.endUserList.push({ end_use: option }); }); @@ -404,8 +394,6 @@ getM_sourceofamount() { this.isOtherPurpose = false; } - console.log('e',event); - //this.isOtherPurpose = event.some(e => e == 'others') // this return true or false Only; } @@ -444,7 +432,6 @@ getM_sourceofamount() { // }); } submitLoanDetails() { - console.log('formData', this.loanDetailsForm.value); // if (!this.loanDetailsForm.valid) { // //this.notifier.notify('warning', 'Form Invaild Check all requried Field .!'); // return; @@ -524,13 +511,11 @@ getM_sourceofamount() { }else{ records.personal_loan_source = ''; } records.construction_status = this.loanDetailsForm.controls['construction_status'].value; - records.percentage_of_construction = this.loanDetailsForm.controls['percentage_of_construction'].value; + //records.percentage_of_construction = this.loanDetailsForm.controls['percentage_of_construction'].value; records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value; //records.value_per_agreement = this.loanDetailsForm.controls['value_per_agreement'].value; records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value; - console.log('data', records); this._pd.saveForm(records).subscribe(data => { - console.log('data', data); this.notifier.notify('success', 'Saved Successfully.'); }, error => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); 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 528d8679f..07da3fb2a 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 @@ -142,7 +142,7 @@
Remarks - +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts index 77e17bc98..20d8ddad3 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 @@ -137,17 +137,17 @@ export class NeighbourHoodComponent implements OnInit { let stdcode = elementValue.landline.substr(0,stdcodesearch); let landline = elementValue.landline.substr(+stdcodesearch + 1,8); return this._fb.group({ - reference_name: [elementValue.reference_name, Validators.required], - mobile: [elementValue.mobile,Validators.compose([Validators.required,Validators.minLength(10),Validators.maxLength(10)])], + reference_name: [elementValue.reference_name], + mobile: [elementValue.mobile,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], std_code: [stdcode,Validators.compose([Validators.minLength(2),Validators.maxLength(4)])], landline: [landline,Validators.compose([Validators.minLength(6),Validators.maxLength(8)])], - location:[elementValue.location,Validators.required], - relationship_with:[elementValue.relationship_with,Validators.required], + location:[elementValue.location], + relationship_with:[elementValue.relationship_with], others: [elementValue.others], - year_relation_applicant:[elementValue.year_relation_applicant,Validators.required], - months_relation_applicant:[elementValue.months_relation_applicant,Validators.required], - business_volume_amount:[elementValue.business_volume_amount,Validators.required], - business_volume_unit:[elementValue.business_volume_unit, Validators.required], + year_relation_applicant:[elementValue.year_relation_applicant], + months_relation_applicant:[elementValue.months_relation_applicant], + business_volume_amount:[elementValue.business_volume_amount], + business_volume_unit:[elementValue.business_volume_unit], others_unit : [elementValue.others_unit], reference_final_remarks:[elementValue.reference_final_remarks], specify_final_remark : [elementValue.specify_final_remark], @@ -173,8 +173,8 @@ export class NeighbourHoodComponent implements OnInit { // create neighbourhood form array createNeighbourhood(elementValue:any){ return this._fb.group({ - neighbourhood_name: [elementValue.neighbourhood_name, Validators.required], - do_know: [elementValue.do_know,Validators.required], + neighbourhood_name: [elementValue.neighbourhood_name], + do_know: [elementValue.do_know], how_long_do_know: [elementValue.how_long_do_know], is_applicant_owner: [elementValue.is_applicant_owner], }); 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 71273a104..90b38fce9 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 @@ -38,7 +38,7 @@ + formControlName="source"> {{src.name}}
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 72ba6052e..57dfaafdc 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 @@ -108,32 +108,32 @@ export class RentalInfoComponent implements OnInit { pdid: this.pdid, formid: this.form_id, fk_createdby: this.pdid, - person_met: ['', Validators.compose([Validators.required])], - property_own: ['', Validators.compose([Validators.required])], - nature_property: ['', Validators.compose([Validators.required])], + person_met: [''], + property_own: [''], + nature_property: [''], rental_home: this._fb.array([]) }); } createpropertyArray() { this.propertyList = this._fb.group({ - complete_add: ['', Validators.compose([Validators.required])], - area_of_property: ['', Validators.compose([Validators.required])], - structure_property: ['', Validators.compose([Validators.required])], - total_room: ['', Validators.compose([Validators.required])], - is_rent: ['', Validators.compose([Validators.required])], + complete_add: [''], + area_of_property: [''], + structure_property: [''], + total_room: [''], + is_rent: [''], date_agreement: [''], date_validity: [''], rent_agreement: [''], actual_rent: [''], photo_areegment: [''], - bank: ['', Validators.compose([Validators.required])], - cash: ['', Validators.compose([Validators.required])], - rent_each_floor: ['', Validators.compose([Validators.required])], - total_rent: ['', Validators.compose([Validators.required])], - related_doc_owner: ['', Validators.compose([Validators.required])], - property_photographs: ['', Validators.compose([Validators.required])], - third_party_check: ['', Validators.compose([Validators.required])], + 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; @@ -141,12 +141,12 @@ export class RentalInfoComponent implements OnInit { createTenatsArray() { return this._fb.group({ - name: ['', Validators.compose([Validators.required])], - mobile_no: ['', Validators.compose([Validators.required])], - tenants_seen: ['', Validators.compose([Validators.required])], - tenants_con_owner: ['', Validators.compose([Validators.required])], - staying_since: ['', Validators.compose([Validators.required])], - rent_paid: ['', Validators.compose([Validators.required])], + name: [''], + mobile_no: [''], + tenants_seen: [''], + tenants_con_owner: [''], + staying_since: [''], + rent_paid: [''], }); } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html index 68a1078bd..7aa145080 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html @@ -17,27 +17,30 @@
- -

Manufacturing Details

-
+ +
Manufacturing Details
-

{{a+1}} . Raw Material

+ + Raw Material #{{a+1}} - - Yes - No + + + Add Stock Details + No Stock Observed - + - + - - {{"₹"}} {{M_rawValueInWords}} Only + + {{"₹"}} {{M_rawValueInWords[a]}} Only - + + {{"₹"}} {{M_financialRawValueInWords[a]}} Only @@ -62,45 +66,49 @@ - Please comment on the stock level observed? + Please comment on the stock level observed? - - + +
-

{{b+1}} Finished Goods

+ + Finished Goods #{{b+1}} - - Yes - No + + + Add Stock Details + No Stock Observed - + - + - - {{"₹"}} {{M_goodsValueInWords}} Only + + {{"₹"}} {{M_goodsValueInWords[b]}} Only - + + {{"₹"}} {{M_financialGoodsValueInWords[b]}} Only @@ -109,11 +117,11 @@ - Please comment on the finished goods stock level observed? + Please comment on the finished goods stock level observed? - + + +
-

{{c+1}} Traded Goods

+ + Traded Goods #{{c+1}} - - Yes - No + + Add Stock Details + No Stock Observed - + - + - - {{"₹"}} {{M_tradedGoodsValueInWords}} Only + + {{"₹"}} {{M_tradedGoodsValueInWords[c]}} Only - + + {{"₹"}} {{M_financialTradedGoodsValueInWords[c]}} Only @@ -158,11 +170,11 @@ - Please comment on the Traded Goods stock level observed? + Please comment on the Traded Goods stock level observed? - + + +
@@ -179,36 +193,39 @@ - -

Retail Details

-
+ +
Retail Details
- +
-

{{d+1}} Finished Goods

+ + Finished Goods #{{d+1}} - - Yes - No + + Add Stock Details + No stock observed - + - + - - {{"₹"}} {{R_goodsValueInWords}} Only + + {{"₹"}} {{R_goodsValueInWords[d]}} Only - + + {{"₹"}} {{R_financialGoodsValueInWords[d]}} Only @@ -218,7 +235,7 @@ - Please comment on the finished goods stock level observed? + Please comment on the finished goods stock level observed? @@ -227,37 +244,41 @@ matTooltip="Add More Finished Goods" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" color="primary" *ngIf="d==0"> add + +
-

{{e+1}} Traded Goods

+ + Traded Goods #{{e+1}} - - Yes - No + + Add Stock Details + No Stock Observed - + - + - - {{"₹"}} {{R_tradedGoodsValueInWords}} Only + + {{"₹"}} {{R_tradedGoodsValueInWords[e]}} Only - + + {{"₹"}} {{R_financialTradedGoodsValueInWords[e]}} Only @@ -267,7 +288,7 @@ - Please comment on the Traded Goods stock level observed? + Please comment on the Traded Goods stock level observed? @@ -280,7 +301,9 @@ matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="e>0"> delete + +
@@ -290,35 +313,38 @@ - -

Trading Details

-
+ +
Trading Details
-

{{f+1}} Finished Goods

+ + Finished Goods #{{f+1}} - - Yes - No + + Add Stock Details + No Stock Observed - + - + - - {{"₹"}} {{T_goodsValueInWords}} Only + + {{"₹"}} {{T_goodsValueInWords[f]}} Only - + + {{"₹"}} {{T_financialGoodsValueInWords[f]}} Only @@ -328,11 +354,12 @@ - Please comment on the finished goods stock level observed? + Please comment on the finished goods stock level observed? - + + - - + + + +
-

{{g+1}} Traded Goods

+ + Traded Goods #{{g+1}} - - Yes - No + + Add Stock Details + No stock observed - + - + - - {{"₹"}} {{T_tradedGoodsValueInWords}} Only + + {{"₹"}} {{T_tradedGoodsValueInWords[g]}} Only - + + {{"₹"}} {{T_financialTradedGoodsValueInWords[g]}} Only @@ -378,21 +409,22 @@ - Please comment on the Traded Goods stock level observed? + Please comment on the Traded Goods stock level observed? - - + + - - + + +
@@ -401,9 +433,10 @@ - + +
Service Provider
Service Provider Details Not applicable here !!
@@ -515,7 +548,7 @@
- Remarks + Remarks
@@ -527,7 +560,7 @@
- + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.scss index 27caaf50a..f7e0b7e79 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.scss @@ -16,7 +16,9 @@ // background: #62B013; // color: white; // } - +.highlight { + color: red; + } .paragraph_change { color: #fff !important; background-color: #e00201 !important; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts index e6660afc0..cbd3a7e76 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts @@ -22,21 +22,31 @@ export class StockComponent implements OnInit { pageTitle: string ="Stock Details"; pdid: number; form_id: number; + company_id: string; public stockForms: FormGroup; private notifier: NotifierService; public uomData : any = []; rawmaterial : any; - M_rawValueInWords : any; - - M_goodsValueInWords : any; - R_goodsValueInWords : any; - T_goodsValueInWords : any; + M_rawValueInWords : any = []; + M_financialRawValueInWords : any = []; - M_tradedGoodsValueInWords : any; - R_tradedGoodsValueInWords : any; - T_tradedGoodsValueInWords : any; + M_goodsValueInWords : any = []; + R_goodsValueInWords : any = []; + T_goodsValueInWords : any = []; + + M_financialGoodsValueInWords : any = []; + R_financialGoodsValueInWords : any = []; + T_financialGoodsValueInWords : any = []; + + M_tradedGoodsValueInWords : any = []; + R_tradedGoodsValueInWords : any = []; + T_tradedGoodsValueInWords : any = []; + + M_financialTradedGoodsValueInWords : any = []; + R_financialTradedGoodsValueInWords : any = []; + T_financialTradedGoodsValueInWords : any = []; rawMaterialAccess: boolean; finishedGoodsAccess: boolean; @@ -44,12 +54,14 @@ export class StockComponent implements OnInit { public submitted = false; noRecordsFound: Boolean = false; serviceProviderForm: Boolean = false; + suppliers_raw_materials : any = []; constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService,@Inject(MAT_DIALOG_DATA) public pd_all_details: any) { this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.form_id = 11; + this.company_id = this.pd_all_details.company_id this.notifier = notifier; } public viewerOptions: any = { @@ -82,7 +94,7 @@ export class StockComponent implements OnInit { // }) //this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe( - this._pd.stockFormAccess({pd_id:this.pdid}).subscribe(data => { + this._pd.stockFormAccess({pd_id:this.pdid,company_id:this.company_id}).subscribe(data => { if(data.dataStatus == true){ let datas = data.records; @@ -109,21 +121,18 @@ export class StockComponent implements OnInit { } public initstockForms(record){ - console.log(record); let params: any = {}; params.pd_id = this.pdid; params.pd_form_id = this.form_id; - + params.company_id = this.company_id; this._pd.retriveForm(params).subscribe(value => { if (value.status == 200) { - let dataForm = value.records; - - + let dataForm = value.records; if(dataForm !== undefined) { - console.log(dataForm); this.stockForms = this.fb.group({ pdid: [this.pdid], formid: [this.form_id], + company_id: [this.company_id], stock_remarks: [''], manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), retail_details : this.fb.array([this.retailFormCreation(record)]), @@ -131,8 +140,25 @@ export class StockComponent implements OnInit { }); let arr = record.filter(data => data.type_of_activity_id == 1); - console.log(133,arr.length); if(arr.length > 0) { + this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { + console.log('136',value); + if(value.status == 200){ + this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials; + let manufacturing_temparr = []; + manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials; + manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods; + manufacturing_temparr['manufacturing_traded_goods'] = dataForm.manufacturing_details[0].manufacturing_traded_goods; + this.initManufacturingDetails(manufacturing_temparr); + } + else{ + let manufacturing_temparr = []; + manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials; + manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods; + manufacturing_temparr['manufacturing_traded_goods'] = dataForm.manufacturing_details[0].manufacturing_traded_goods; + this.initManufacturingDetails(manufacturing_temparr); + } + }); // console.log(1,dataForm); // console.log(164,dataForm.manufacturing_details); // console.log(2,dataForm.retail_details); @@ -169,14 +195,7 @@ export class StockComponent implements OnInit { // console.log(163,dataForm.manufacturing_details.manufacturing_raw_materials); // console.log(164,dataForm.manufacturing_details[0]); // console.log(164,dataForm.manufacturing_details[0].manufacturing_raw_materials); - - let manufacturing_temparr = []; - - manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials; - manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods; - manufacturing_temparr['manufacturing_traded_goods'] = dataForm.manufacturing_details[0].manufacturing_traded_goods; - this.initManufacturingDetails(manufacturing_temparr); //this.initManufacturingDetails(dataForm); } @@ -257,6 +276,7 @@ export class StockComponent implements OnInit { this.stockForms = this.fb.group({ pdid: [this.pdid], formid: [this.form_id], + company_id: [this.company_id], stock_remarks: [''], manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), retail_details : this.fb.array([this.retailFormCreation(record)]), @@ -264,7 +284,16 @@ export class StockComponent implements OnInit { }); let arr = record.filter(data => data.type_of_activity_id == 1); if(arr.length > 0) { - this.initManufacturingDetails(null); + this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { + if(value.status == 200){ + this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials; + this.initManufacturingDetails(null); + } + else{ + this.initManufacturingDetails(null); + } + }); + // this.initManufacturingDetails(null); } let arr1 = record.filter(data => data.type_of_activity_id == 2); if(arr1.length > 0) { @@ -292,7 +321,16 @@ export class StockComponent implements OnInit { }); let arr = record.filter(data => data.type_of_activity_id == 1); if(arr.length > 0) { - this.initManufacturingDetails(null); + this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { + if(value.status == 200){ + this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials; + this.initManufacturingDetails(null); + } + else{ + this.initManufacturingDetails(null); + } + }); + } let arr1 = record.filter(data => data.type_of_activity_id == 2); if(arr1.length > 0) { @@ -311,7 +349,7 @@ export class StockComponent implements OnInit { }) // this.stockForms = this.fb.group({ - // stock_remarks: ['', Validators.compose([Validators.required])], + // stock_remarks: [''], // raw_materials: this.fb.array([]), // finished_goods: this.fb.array([]), // traded_goods: this.fb.array([]) @@ -320,11 +358,8 @@ export class StockComponent implements OnInit { manufacturingForm: Boolean = false; manufacturingFormCreation(record) { - console.log(record); let arr = record.filter(data => data.type_of_activity_id == 1); - console.log(arr); if (arr.length > 0) { - console.log(arr.length); this.manufacturingForm = true; return this.fb.group({ manufacturing_raw_materials: this.fb.array([]), @@ -378,14 +413,27 @@ tradingFormCreation(val) { const rawMaterial = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials']; const finishedGoods = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; const tradedGoods = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials']; - + const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials']; if(datas === null){ - // console.log(299,'if'); + if(this.suppliers_raw_materials.length > 0){ + for (let val of this.suppliers_raw_materials) { + let Ref_RawMaterials : any = {'raw_name': val.manufacturing_raw_material_name, + 'stock_observed':'', + 'raw_quantity': '', + 'raw_uom': '', + 'other_uom': '', + 'raw_value': '', + 'rawmaterial_value': '', + 'is_sufficiant_raw': '', + 'rawmaterial_remarks':''}; + rawMaterial.push(this.createRawmaterial(Ref_RawMaterials)); + } + } + else{ rawMaterial.push(this.createRawmaterial(null)); + } finishedGoods.push(this.createGoods(null)); tradedGoods.push(this.createTradedGoods(null)); - } else { // console.log(305,'else') // console.log(377,datas); @@ -395,6 +443,7 @@ tradingFormCreation(val) { // console.log(val); if(val.raw_value){ this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value); + this.M_financialRawValueInWords = this._pd.convertNumberToWords(val.rawmaterial_value); } rawMaterial.push(this.createRawmaterial(val)); } @@ -407,6 +456,7 @@ tradingFormCreation(val) { // console.log(val); if(val.goods_value){ this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); + this.M_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value); } finishedGoods.push(this.createGoods(val)); @@ -420,6 +470,7 @@ tradingFormCreation(val) { // console.log(val); if(val.estimated_traded_goods_value){ this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); + this.M_financialTradedGoodsValueInWords = this._pd.convertNumberToWords(val.traded_goods_value); } tradedGoods.push(this.createTradedGoods(val)); @@ -432,21 +483,6 @@ tradingFormCreation(val) { } } - createRawmaterial2() { - return this.fb.group({ - raw_name: ['', Validators.compose([Validators.required])], - stock_observed:['', Validators.compose([Validators.required])], - raw_quantity: [''], - raw_uom: [''], - other_uom : [''], - raw_value: [''], - rawmaterial_value: [''], - is_sufficiant_raw: [''], - rawmaterial_remarks:[''] - }); - } - - createRawmaterial(records) { // console.log(330,'function in'); if(records === null) { @@ -497,6 +533,7 @@ tradingFormCreation(val) { if(val.goods_value){ this.R_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); + this.R_financialGoodsValueInWords =this._pd.convertNumberToWords(val.finished_goods_value); } finishedGoods.push(this.createGoods(val)); @@ -512,6 +549,7 @@ tradingFormCreation(val) { // console.log(val); if(val.estimated_traded_goods_value){ this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); + this.R_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value); } tradedGoods.push(this.createTradedGoods(val)); @@ -525,8 +563,8 @@ tradingFormCreation(val) { createGoods2() { return this.fb.group({ - goods_name: ['', Validators.compose([Validators.required])], - goods_observed: ['', Validators.compose([Validators.required])], + goods_name: [''], + goods_observed: [''], goods_quantity: [''], goods_value: [''], finished_goods_value: [''], @@ -563,8 +601,8 @@ tradingFormCreation(val) { createTradedGoods2() { return this.fb.group({ - traded_goods_name: ['', Validators.compose([Validators.required])], - traded_goods_observed: ['', Validators.compose([Validators.required])], + traded_goods_name: [''], + traded_goods_observed: [''], traded_goods_quantity: [''], estimated_traded_goods_value: [''], traded_goods_value: [''], @@ -596,6 +634,7 @@ tradingFormCreation(val) { // console.log(val); if(val.goods_value){ this.T_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); + this.T_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value); } finishedGoods.push(this.createGoods(val)); @@ -610,6 +649,7 @@ tradingFormCreation(val) { // console.log(val); if(val.estimated_traded_goods_value){ this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); + this.T_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value); } tradedGoods.push(this.createTradedGoods(val)); } @@ -833,29 +873,50 @@ tradingFormCreation(val) { } /** To Convert Amount into Words */ - inWords(e,flag:number){ + inWords(e,flag:number,i){ switch(flag){ case 1 : - this.M_rawValueInWords = this._pd.convertNumberToWords(e.target.value); + this.M_rawValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; case 2 : - this.M_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.M_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; case 3 : - this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.M_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; case 4 : - this.R_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.R_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; case 5 : - this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.R_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; case 6 : - this.T_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.T_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; case 7 : - this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.T_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 8 : + this.M_financialRawValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 9 : + this.M_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 10 : + this.M_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 11 : + this.R_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 12 : + this.R_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 13 : + this.T_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 14 : + this.T_financialTradedGoodsValueInWords[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/supplier-info/supplier-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts index 4b328836f..62520e33b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts @@ -37,7 +37,7 @@ export class SupplierInfoComponent implements OnInit { //@Input() pdid: number; pdid: string; form_id: number; - + company_id: string; public _supplierQuesFrom: FormGroup; public submitted = false; @@ -51,6 +51,7 @@ export class SupplierInfoComponent implements OnInit { @Inject(MAT_DIALOG_DATA) public pd_all_details: any) { this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.form_id = 1; + this.company_id = this.pd_all_details.company_id this.notifier = notifier; } public viewerOptions: any = { @@ -76,7 +77,7 @@ export class SupplierInfoComponent implements OnInit { noRecordsFound: Boolean = false; errorMessage: any = ''; ngOnInit() { - this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => { + this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid, this.company_id).subscribe(data => { if(data.dataStatus){ // let datas = { // "profession_name": "Others", @@ -116,8 +117,12 @@ export class SupplierInfoComponent implements OnInit { serviceProviderForm: Boolean = false; initFormLoadDetails(record) { + let params: any = {}; + params.pd_id = this.pdid; + params.pd_form_id = this.form_id; + params.company_id = this.company_id; // alert(JSON.stringify(record)); - this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '1').subscribe( + this.pdTrigerService.retriveForm(params).subscribe( data => { if(data.dataStatus){ let dataForm = data.records; @@ -125,6 +130,7 @@ export class SupplierInfoComponent implements OnInit { this._supplierQuesFrom = this._formBuilder.group({ pdid: [this.pdid], formid: ['1'], + company_id: [this.company_id], manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]), trade_details: this._formBuilder.array([this.tradingFormCreation(record)]), supplier_info_form_remark: [dataForm.supplier_info_form_remark || null] @@ -154,6 +160,7 @@ export class SupplierInfoComponent implements OnInit { this._supplierQuesFrom = this._formBuilder.group({ pdid: [this.pdid], formid: ['1'], + company_id: [this.company_id], manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]), trade_details: this._formBuilder.array([this.tradingFormCreation(record)]), supplier_info_form_remark: [dataForm.supplier_info_form_remark || null] diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html index 17292f75b..5210ebc7e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html @@ -26,7 +26,7 @@ {{quesIndex+1}}
--> - +
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 70d19e4b3..4ae08c3ed 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 @@ -26,6 +26,7 @@ import {LoanDetailsComponent} from './forms/loan-details/loan-details.component' import {GeneralInfoComponent} from './forms/general-info/general-info.component'; import {NeighbourHoodComponent} from './forms/neighbour-hood/neighbour-hood.component'; import {FinalRemarksComponent} from './forms/final-remarks/final-remarks.component'; +import { BusinessInfoGroupComponent } from './forms/business-info-group/business-info-group.component'; @Component({ selector: 'app-start-pd', @@ -314,7 +315,7 @@ export class StartPdComponent implements OnInit, OnDestroy { }); }else if(this.selectedFormsCategory.form_id==13){ - const dialogRef = this.dialog.open(BusinessInfoComponent, { + const dialogRef = this.dialog.open(BusinessInfoGroupComponent, { data: this.pdFullDetails, position: { right: '0'}, width:'80%', 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 6d119d0ed..444ea4dba 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 @@ -1,84 +1,149 @@ + - -
- - -
-
-

{{master.lender_full_name}} - {{master.branch_name}}

- {{master.lender_applicant_id}} - {{master.pd_date_of_initiation}} -
-
- - - - - - - -
- - - person{{master.pd_allocated_to | titlecase}} - person{{master.executive_name | titlecase}}/{{master.centralofficer | titlecase}} - person{{master.centralofficer | titlecase}}    - {{master.pd_status | titlecase}}  On {{master.scheduled_on}} - {{master.pd_status | titlecase}} - QC Completed -
- -
-
-
- - -
- -
- - - - - -  {{master.city_name}} / {{master.state_name}}-{{master.pincode}} - -
- - + + +
+
+ + +
+

{{master.lender_short_name}}

+ {{master.branch_name}} +
+ {{master.lender_applicant_id}}
+ {{master.pd_date_of_initiation}}
+
+    + +
+ {{master.pd_allocated_to | titlecase}} + {{master.executive_name | titlecase}}/{{master.centralofficer | titlecase}} + {{master.centralofficer | titlecase}}
+ + {{master.scheduled_on}} +
- - - - -

{{master.pd_contact_person}}   - {{master.pd_contact_mobileno}} - (Lender Contact Details) -

- -

{{master.product_name}} / {{master.subproduct_name}}

-

{{master.pd_type_name}} /  {{master.loan_amount}}

-

{{master.addressline1}}

-

Remarks : {{master.remarks}}

-
- -
-
- - +
+
+ +
+
+
+ +
+
+
+ + + + + +
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+ {{master.product_name}} / {{master.subproduct_name}} +
+
+
+
+
+
+ +
+
+ {{master.loan_amount}} +
+
+
+
+
+
+ +
+
+ {{master.pd_type_name}} +
+
+
+
+
+
+ +
+
+ {{master.addressline1}},
{{master.city_name}},
{{master.state_name}}-{{master.pincode}}
+
+
+
+ +
+
+
+

Lender Contact Details

+ +
+
+   {{master.pd_contact_person}} +
+
+
+
+   {{master.pd_contact_mobileno}} +
+
+
+
+
+
+

Remarks

+ + {{master.remarks}} +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+ +

PD Details

+ + + Applicants
@@ -90,19 +155,19 @@

- +  {{applicant.applicant_name}}     - +  {{applicant.mobile_no}}     - +  +91{{applicant.landline}} -
Main Applicant - {{applicant.relation_name}} + ( Main Applicant ) + ( {{applicant.relation_name}} )

@@ -111,19 +176,16 @@

No Applicant

- -
-
-
- - -
+ + + + Additional Requirements +
-
- +
+ Additional Requirements - @@ -135,75 +197,38 @@

No Additional Requirements

- -
-
-
- - - - -
Documents
-
-
- + + + + Documents + +

No Document

-
- -
-
-
- - - - -
PD History
-
- -
- - - {{master.time}}       - {{master.user}}
{{master.log}}
- -
- -
- -
- - - - -

No History

-
-
-
- -
-
- + + + + + QC Notes
QC Notes

- {{ pdMasterData[0]?.qc_remarks}}

- -
-
-
- + {{ pdMasterData[0]?.qc_remarks}}

+ + + + QC Remarks +
QC Remarks
@@ -220,13 +245,30 @@
{{ pdMasterData[0]?.qc_feedback}} -
- -
-
- -
- +
+
+ + + PD History +
+ + + {{master.time}}  + {{master.user}}
{{master.log}}
+ +
+ +
+
+ + +

No History

+
+
+
+ +
+
- \ No newline at end of file + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss index bdf8de1d6..0c83a24b0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss @@ -8,4 +8,26 @@ } ::ng-deep .body-container{ padding: 0rem !important; -} \ No newline at end of file +} + + +:host { + margin-left: -5px; + margin-right: -5px; + margin-top: -5px; + display: block; +} +.wrapper { + margin: 6px; +} + +.content-data{ + h2{ + font-size: 1.5rem; + } +} +@media(max-width:767px){ + .profile-center{ + text-align: center; + } +} 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 90d398715..eefb41512 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 @@ -89,6 +89,7 @@ import { FinalRemarksComponent } from './list-pd/start-pd/forms/final-remarks/fi import { BusinessOtherFamilyMemberComponent } from './list-pd/start-pd/forms/dialogue/business-other-family-member/business-other-family-member.component'; import { QcReviewComponent } from './list-pd/pd-report/qc-review/qc-review.component'; import { SharedModule } from "app/shared/shared.module"; +import { BusinessInfoGroupComponent } from './list-pd/start-pd/forms/business-info-group/business-info-group.component'; /** * Custom angular notifier options @@ -266,7 +267,7 @@ const pdCustomNotifierOptions: NotifierOptions = { // AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule, // OwlNativeDateTimeModule, // ], - 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], + 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], // exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent], // providers: [PdTrigerService, GetGeometricLocationService], @@ -304,13 +305,13 @@ const pdCustomNotifierOptions: NotifierOptions = { OwlNativeDateTimeModule, ], // declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, AssetsInfoComponent], - 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], + 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], 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}], entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent, - 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], + 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], }) export class ManagePdModule { diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index c7ced0d9d..42efd209c 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -322,15 +322,14 @@ export class PdTrigerService { swapOlderPDReportToLatest(pdId: any): Observable { pdId.fk_createdby = this._aws.getlocale(); - alert(JSON.stringify(pdId)); return this._http.post(this.apiUrl + "swapOlderPDReportToLatest", { "records": pdId }) .pipe( catchError(this.handleError('operation', [])) ) } - getTypeofActivityForSuppliedInfoForm(pd_id: any): Observable { - return this._http.post(this.apiUrl + "getTypeOfActivetyFromBusinessForm", { "records": { "pd_id": pd_id } }) + getTypeofActivityForSuppliedInfoForm(pd_id: any,company_id:any): Observable { + return this._http.post(this.apiUrl + "getTypeOfActivetyFromBusinessForm", { "records": { "pd_id": pd_id,"company_id":company_id } }) .pipe( catchError(this.handleError('operation', [])) )