From 3354370065b959c4e1ed679a18a2612fc57eb01b Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 9 Jan 2019 20:04:54 +0530 Subject: [PATCH 1/2] changes for assest forms --- .../assets-info/assets-info.component.html | 16 ++++-- .../assets-info/assets-info.component.ts | 53 +++++++++++++++---- 2 files changed, 53 insertions(+), 16 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html index 6df10da6f..ce552f7fd 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html @@ -218,14 +218,20 @@ {{"₹"}} {{appxMarketAmtInwords[i]}} Only - - + - {{company.company_name | titlecase}} - + formControlName="business_name_of_the_owner" [compareWith]="compareObjects" required> + + + {{val.name}} + + + + + + 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 cd9c51767..aeaa4a3c8 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 @@ -22,6 +22,7 @@ import { } from '@angular/material'; /** Service */ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; +import { element } from '@angular/core/src/render3/instructions'; @Component({ selector: 'app-assets-info', templateUrl: './assets-info.component.html', @@ -184,6 +185,8 @@ public m_investmentType = []; private notifier: NotifierService; existCompanyList: any =[]; + mergeCompanyApplicant: any=[]; + constructor( notifier: NotifierService, private _formBuilder: FormBuilder, @@ -224,6 +227,24 @@ public m_investmentType = []; if(data.dataStatus){ this.existCompanyList = data.records.filter(val =>val.is_active); } + + let modifyCompanyList : any=[]; + if(this.existCompanyList.length>0){ + modifyCompanyList = this.existCompanyList.map(element => { + return {id:element.company_order_id.toString(),name:element.company_name,group_id:1}; + }); + this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) + + } + + let modifyApplicantList: any=[]; + if(this.applicants.length > 0){ + modifyApplicantList = this.applicants.map(element => { + return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2}; + }); + this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList}) + + } }) this.getPdSupplierFormDetails(); @@ -315,8 +336,6 @@ 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); @@ -332,7 +351,6 @@ public m_investmentType = []; } formLoadData(val) { - console.log(val); if (val !== null) { let value = val; this._assetsQuesFrom = this._formBuilder.group({ @@ -394,6 +412,7 @@ public m_investmentType = []; business_details: this._formBuilder.array([]), business_approximate_market_value: [''], business_name_of_the_owner: [], + business_name_of_the_owner_other: [], //other_owner:[''], //relation:[''], business_purchase_year: ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])], @@ -656,7 +675,7 @@ public m_investmentType = []; business_details: this._formBuilder.array([]), business_approximate_market_value: [data.business_approximate_market_value], business_name_of_the_owner: [data.business_name_of_the_owner], - // other_owner:[data.other_owner || ''], + business_name_of_the_other_owner:[data.business_name_of_the_other_owner || ''], // relation: [data.relation || ''], business_purchase_year: [data. business_purchase_year], // purchase_month: [data.purchase_month], @@ -670,7 +689,6 @@ public m_investmentType = []; loadDetails: boolean; addAssetsDetailsWithData(supp_data) { - //console.log(supp_data); var result = Object.keys(supp_data).map(function (key) { return supp_data[key]; }); @@ -721,7 +739,7 @@ public m_investmentType = []; business_assets_mode: val.business_assets_mode, business_approximate_market_value: val.business_approximate_market_value, business_name_of_the_owner: val.business_name_of_the_owner, - // other_owner: val.other_owner, + business_name_of_the_other_owner: val.business_name_of_the_other_owner, // relation : val.relation, business_purchase_year: val. business_purchase_year, // purchase_month: val.purchase_month, @@ -949,8 +967,6 @@ public m_investmentType = []; /** Add More Asset using Flag Both "Other Asset" And "Business Asset" */ addAssetDetails(e,flag) { - // console.log(flag); - // console.log(e); if(flag == 1){ const control = this._assetsQuesFrom.controls['assets_details']; control.push(this.initDetails()); @@ -994,9 +1010,26 @@ public m_investmentType = []; } } + // compare objects for merge two master table details + compareObjects(o1: any, o2: any) { + if(o1.id == o2.id && o1.group_id == o2.group_id) + return true; + else return false + } + + // check others + checkOthers(values){ + if(values!=null) { + return values.id==0 ? true : false; + } + else { + return false; + } + + } + /** To Save/Edited Popup Data */ onSubmit() { - console.log(this._assetsQuesFrom.value); this.submitted = true; // stop here if form is invalid @@ -1025,7 +1058,6 @@ public m_investmentType = []; val.business_elapsed_tenure = ''; } }); -console.log(answerFormValues); // Save the data with help of Service this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe( dataresult => { @@ -1067,7 +1099,6 @@ console.log(answerFormValues); loanTenureCalc(details ,flag) { if(flag == 1){ - //console.log(details.value); let ElapsedValues; if(details.value.original_loan_tenure != null && details.value.original_loan_tenure != '' && details.value.balance_tenure != null && details.value.balance_tenure != ''){ From b86a7db1103744f8cd6fdecc90d404ab4a45aed2 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 9 Jan 2019 20:05:24 +0530 Subject: [PATCH 2/2] merge : kms --- .../list-pd/add-pd/add-pd.component.html | 31 +++++++++++++------ .../client-info/client-info.component.html | 16 +++++----- .../financial-info.component.html | 14 +++++---- .../start-pd/forms/stock/stock.component.html | 8 ++--- .../supplier-info.component.html | 10 +++--- 5 files changed, 47 insertions(+), 32 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index 47e5a08f1..969ee93fc 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 @@ -15,7 +15,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -38,15 +38,17 @@ - + - + + + @@ -54,7 +56,18 @@ Enter Valid Mobile Number. - + + + + +91 + Enter Valid STD Code Number. + - + + + Enter Valid LandLine Number. + + + Select @@ -67,7 +80,7 @@ - + @@ -82,7 +95,7 @@ - + Select @@ -93,7 +106,7 @@ - + Select @@ -107,7 +120,7 @@ - + {{"₹"}} {{loanAmtInWords}} Only diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html index f7f4bb755..e66657954 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html @@ -15,7 +15,7 @@
-
Raw Material #{{l+1}}
+
Product #{{l+1}}
@@ -94,7 +94,7 @@
- + @@ -128,16 +128,16 @@ -
Service Provider Product Details
+
-
Service Provider Product #{{l+1}}
+
Service Provided #{{l+1}}
- + {{ pm.name }} @@ -174,7 +174,7 @@
-
@@ -207,5 +207,5 @@
{{ errorMessage }}
- \ No newline at end of file + + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html index 3da828bb1..9dab22634 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html @@ -25,7 +25,7 @@
- Starting Financial Year + Enter year from which financials provided Invalid year format @@ -125,10 +125,7 @@ - - - - + +
+ + + +
@@ -149,7 +151,7 @@ -

Actual Values as per Customer

+

Financial as per Customer

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 7aa145080..866d610e5 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 @@ -111,7 +111,7 @@ {{"₹"}} {{M_financialGoodsValueInWords[b]}} Only - + Yes No @@ -229,7 +229,7 @@ - + Yes No @@ -348,7 +348,7 @@ - + Yes No @@ -560,7 +560,7 @@
- + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html index b79948469..b5fa4f3c6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html @@ -50,7 +50,7 @@
-
@@ -77,12 +77,12 @@ - +
- + @@ -135,5 +135,5 @@
{{ errorMessage }}
- \ No newline at end of file + + \ No newline at end of file