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 106b35c4e..eeae9ec63 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 @@ -12,292 +12,7 @@ - - -
-
- - -
-
-
- - -
-
- - - {{ asset.name | titlecase }} - - -
- -
- - -
-
-
-
- - - - {{ prop.name | titlecase }} - - - - - - -
-
-
-
- - -
-
-
-
- - - - - - - -
-
-
-
- - - -
-
-
- - - -
- - - - -
-
-
-
- - -
-
-
-
- - - -
-
-
-
- - -
-
-
-
- - - - {{"₹"}} {{PremiumPaidInwords[s]}} Only - - - - - {{ freqn.name | titlecase }} - - - - - - -
- -
- - - {{"₹"}} {{SumAssuredInwords[s]}} Only - - - - - -
-
-
-
- - -
-
-
-
-
- - - {{ ins_type.name | titlecase }} - - - - - - - - {{"₹"}} {{AmtInvestInwords[s]}} Only - - - - -
-
-
-
-
- -
-
-
-
- - - -
- -
- - - - {{"₹"}} {{AssetValueInwords[s]}} Only - - - - - {{data.viewValue | titlecase}} - - - - - - {{"₹"}} {{B_emiAmtInwords[s]}} Only - - -
- -
-
-
- -
- - - -
- - - {{"₹"}} {{appxMarketAmtInwords[i]}} Only - - - - - - - {{val.name}} - - - - - - - - -
- - - - - - - Vintage - - - - - - - Purchase Year - - - - - - -
- - - - Yes - No - - -
-
- - - - - - - - -
-
- - - - -
-
-
-
- - - -
- - - -
-
-
-
-
- +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts index ed4fdeeb0..16a9a412c 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 @@ -29,7 +29,7 @@ import { element } from '@angular/core/src/render3/instructions'; styleUrls: ['./assets-info.component.scss'] }) export class AssetsInfoComponent implements OnInit { - pageTitle: string ="Assets Details"; + pageTitle: string ="Other Assets Details"; //@Input() pdid: number; pdid:string; //businessProfessionName :string; @@ -37,7 +37,7 @@ export class AssetsInfoComponent implements OnInit { public _assetsQuesFrom: FormGroup; public submitted = false; public m_assets_type = []; - //public m_relation = []; + public applicants: any; otherEmiamtFlag : boolean = false; businessEmiAmtFlag : boolean = false; @@ -58,131 +58,13 @@ export class AssetsInfoComponent implements OnInit { OtherAssetValueInwords: any = []; B_emiAmtInwords: any = []; O_emiAmtInwords: any = []; - // public m_assets_type = [ - // { - // 'id': "1", - // 'name': "Property" - // }, - // { - // 'id': "2", - // 'name': "Four Wheeler" - // }, - // { - // 'id': "3", - // 'name': "Two Wheeler" - // }, - // { - // 'id': "4", - // 'name': "Jewellery" - // }, - // { - // 'id': "5", - // 'name': "Consumer Durable" - // }, - // { - // 'id': "6", - // 'name': "Insurance" - // }, - // { - // 'id': "7", - // 'name': "Investments" - // }, - // { - // 'id': "8", - // 'name': "Others" - // } - // ] - -public m_propertyType = []; - - // public m_propertyType = [ - // { - // 'id': "1", - // 'name': 'Residential' - // }, - // { - // 'id': "2", - // 'name': 'Commercial' - // }, - // { - // 'id': "3", - // 'name': 'Industrial' - // }, - // { - // 'id': "4", - // 'name': 'Land' - // } - // ]; - -//public m_insuranceType = []; - - // public m_insuranceType = [{ - // 'id': "1", - // 'name': 'Life' - // }, { - // 'id': "2", - // 'name': 'Health' - // }] - -public m_investmentType = []; - - // public m_investmentType = [{ - // 'id': "1", - // 'name': 'FD' - // }, { - // 'id': "2", - // 'name': 'RD' - // }, { - // 'id': "3", - // 'name': 'Mutual Funds' - // }, { - // 'id': "4", - // 'name': 'PPF' - // }, { - // 'id': "5", - // 'name': 'Shares' - // }, { - // 'id': "6", - // 'name': 'Others' - // }] - - public m_freqOfPurchase = []; - - // public m_freqOfPurchase = [ - // { - // 'id': "1", - // 'name': 'Daily' - // }, - // { - // 'id': "2", - // 'name': 'Weekly' - // }, - // { - // 'id': "3", - // 'name': 'Monthly' - // }, - // { - // 'id': "4", - // 'name': 'Every 3 months' - // }, - // { - // 'id': "5", - // 'name': 'Half yearly' - // }, - // { - // 'id': "6", - // 'name': 'Yearly' - // }, - // { - // 'id': "7", - // 'name': 'As and when required' - // }, - // { - // 'id': "8", - // 'name': 'Others' - // } - // ] + + public m_propertyType = []; + + public m_investmentType = []; + public m_freqOfPurchase = []; + private notifier: NotifierService; existCompanyList: any =[]; mergeCompanyApplicant: any=[]; @@ -358,11 +240,11 @@ public m_investmentType = []; assets_details: this._formBuilder.array([ // this.initDetails(), ]), - business_assets_details : this._formBuilder.array([]), + // business_assets_details : this._formBuilder.array([]), assets_form_remark:[value.assets_form_remark || 'check'] }); this.addAssetsDetailsWithData(value.assets_details); - this.addBusinessAssetsDetailsWithData(value.business_assets_details); + // this.addBusinessAssetsDetailsWithData(value.business_assets_details); } else { this._assetsQuesFrom = this._formBuilder.group({ pdid: [this.pdid], @@ -370,9 +252,9 @@ public m_investmentType = []; assets_details: this._formBuilder.array([ this.initDetails(), ]), - business_assets_details : this._formBuilder.array([ - this.initBusinessDetails(), - ]), + // business_assets_details : this._formBuilder.array([ + // this.initBusinessDetails(), + // ]), assets_form_remark:[''] }); } @@ -402,22 +284,6 @@ public m_investmentType = []; }); } - initBusinessDetails() { - return this._formBuilder.group({ - business_assets_mode: [''], - business_details: this._formBuilder.array([]), - business_approximate_market_value: [''], - business_name_of_the_owner: [], - business_name_of_the_other_owner: [], - //other_owner:[''], - //relation:[''], - business_vintage: [''], - business_purchase_year: ['',Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])], - //purchase_month: [''], - business_emi: [''], - }); - } - show: boolean; selectedAssetsType(e: any, i: any,flag : any): void { let val = i; @@ -425,64 +291,57 @@ public m_investmentType = []; const arr = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; arr.controls.splice(0); } - else if(flag == 2){ - const arr = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray; - arr.controls.splice(0); - } + // else if(flag == 2){ + // const arr = ; + // arr.controls.splice(0); + // } switch (e.value) { case '1': { let val = i; - const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray - : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; control.push(this.loadProperty()); break; } case '2': { - const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray - : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; + control.push(this.load_Four_Weeler()); break; } case '3': { - const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray - : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; + control.push(this.loadEquipmentManufacturingDescription()); break; } case '4': { - const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray - : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; + //control.push(this.loadJwellDescription()); break; } case '5': { - const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray - : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; + control.push(this.loadConsumerDurableDescription()); break; } case '6': { - const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray - : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; + control.push(this.loadInsuranceDescription()); break; } case '7': { - const control = (flag == 1) ? (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray - : (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; + control.push(this.loadInvestDescription()); break; } case '8': { - if(flag == 1){ const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray ; control.push(this.otherAssetsDescription()); - } - else if (flag == 2){ - const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.otherBusinessAssetsDescription()); - } break; } default: { @@ -712,38 +571,6 @@ public m_investmentType = []; this.loadDetails = true; } - addBusinessAssetsDetailsWithData(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); - }); - - for (let val of result) { - let vals = { - 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, - business_name_of_the_other_owner: val.business_name_of_the_other_owner, - // relation : val.relation, - business_purchase_year: val. business_purchase_year, - business_vintage : val.business_vintage, - // purchase_month: val.purchase_month, - business_emi: val.business_emi, - }; - - 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) - } - } - //this.loadDetails = true; - } - setAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void { let val = i; // let data = Object.keys(datas).map(function (key) { @@ -849,112 +676,12 @@ 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(business_property_datas)); - break; - } - case '2': { - let business_Four_Weeler_datas : any; - data.forEach((datas,i) => { - business_Four_Weeler_datas = { 'manufacturer_model_vehicle': datas.manufacturer_model_vehicle }; - }); - const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.load_Four_WeelerWithData(business_Four_Weeler_datas)); - break; - } - case '3': { - let equipment_manufacturing_description_datas : any; - data.forEach((datas,i) => { - equipment_manufacturing_description_datas= { 'equipment_manufacturing_description': datas.equipment_manufacturing_description }; - }); - const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.loadEquipmentManufacturingDescriptionWithData(equipment_manufacturing_description_datas)); - break; - } - case '4': { - break; - } - case '5': { - let business_ConsumerDurableDescription_datas : any; - data.forEach((datas,i) => { - business_ConsumerDurableDescription_datas = { 'consumer_durable_description': datas.consumer_durable_description }; - }); - const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.loadConsumerDurableDescriptionWithData(business_ConsumerDurableDescription_datas)); - break; - } - case '6': { - let business_InsuranceDescription_datas : any; - data.forEach((datas,i) => { - this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid); - this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured); - business_InsuranceDescription_datas = { - 'premium_paid': datas.premium_paid, - 'frequency_mode': datas.frequency_mode, - 'other_frequency_mode':datas.other_frequency_mode, - 'sum_assured': datas.sum_assured, - 'members_coverd': datas.members_coverd - }; - }); - const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.loadInsuranceDescriptionWithData(business_InsuranceDescription_datas)); - break; - } - case '7': { - let business_InvestDescription_datas : any; - data.forEach((datas,i) => { - this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest); - business_InvestDescription_datas = { 'investments_type': datas.investments_type, - 'other_investments_type' : datas.other_investments_type, - 'amount_of_invest': datas.amount_of_invest, - 'bank_name': datas.bank_name }; - }); - const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - 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); - array_datas = { - 'any_other_assets': datas.any_other_assets, - 'any_other_asset_value' : datas.any_other_asset_value, - 'any_other_asset_loan' : datas.any_other_asset_loan, - }; - }); - const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.otherBusinessAssetsDescriptionWithData(array_datas)); - break; - } - default: { - break; - } - } - } - + /** Add More Asset using Flag Both "Other Asset" And "Business Asset" */ addAssetDetails(e,flag) { if(flag == 1){ const control = this._assetsQuesFrom.controls['assets_details']; control.push(this.initDetails()); - }else if(flag == 2){ - const control = this._assetsQuesFrom.controls['business_assets_details']; - control.push(this.initBusinessDetails()); } } @@ -963,9 +690,6 @@ public m_investmentType = []; if(flag == 1){ const control = this._assetsQuesFrom.controls['assets_details']; control.removeAt(i); - }else if(flag == 2){ - const control = this._assetsQuesFrom.controls['business_assets_details']; - control.removeAt(i); } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html new file mode 100644 index 000000000..191a4d2fc --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html @@ -0,0 +1,399 @@ +
+ +

+
+ {{pageTitle}} +
+
+ +
+

+ + + + + + +
+
+ + +
+
+
+ + +
+
+ + + {{ asset.name | titlecase }} + + +
+ +
+ + +
+
+
+
+ + + + {{ prop.name | titlecase }} + + + + + + +
+
+
+
+ + +
+
+
+
+ + + + + +
+
+
+
+ + +
+
+
+ +
+ + + + +
+
+
+
+ + + + + + + + +
+
+
+
+ + + +
+ +
+ + + + {{"₹"}} {{AssetValueInwords[s]}} Only + + + + + {{data.viewValue | titlecase}} + + + + + +
+ +
+
+
+ +
+ + + +
+ + + + {{"₹"}} {{appxMarketAmtInwords[i]}} Only + + + + {{applicants | json}} + + + + {{ status.applicant_name }} + + + + + +
+ + + + + + Vintage + + + + + + Purchase Year + + + + + + + +
+ + + + Yes + No + + +
+
+ +
+
+ + + + +
+
+
+
+
+
+
+
+
+
+ + + + + +
+
+ + +
+ + Remarks + + +
+
+ + +
+
+
+ +
Loading....
+ \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss new file mode 100644 index 000000000..2f381258f --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss @@ -0,0 +1,142 @@ +.paragraph_change { + color: #fff !important; + background-color: #e00201 !important; + } + .mat-form-field-appearance-legacy .mat-hint{ + color:rgba(0, 0, 0, 0.8) !important; +} + .mat-card-content { + background-color: white; + } + .mat-card-actions { + background-color: white; + } + ::ng-deep .cdk-global-overlay-wrapper{ + justify-content: center !important; +} + + mat-form-field { + margin: 0 2%; + } + $base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important; + $product-bg-color-hover: rgba(103, 58, 183, 0.7); + .p-list-main { + background: white; + margin: auto; + position: relative; + overflow: hidden !important; + border-radius: 10px 10px 10px 10px; + box-shadow: $base-card-box-shadow; + transform: scale(0.95); + transition: box-shadow 0.5s, transform 0.5s; + &:hover { + transform: scale(1); + box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2); + } + .p-list { + position: relative; + .top { + height: 100%; + width: 100%; + // background: url(https://s-media-cache-ak0.pinimg.com/736x/49/80/6f/49806f3f1c7483093855ebca1b8ae2c4.jpg) no-repeat center center; + -webkit-background-size: 100%; + -moz-background-size: 100%; + -o-background-size: 100%; + background-size: 100%; + } + .bottom { + width: 200%; + height: 15%; + transition: transform 0.5s; + h1 { + margin: 0; + padding: 0; + } + p { + margin: 0; + padding: 0; + } + .left { + height: 100%; + width: 50%; + background: #f4f4f4; + position: relative; + float: left; + .details { + padding: 5px; + float: left; + // width: calc(70% - 40px); + } + + } + .right { + width: 50%; + background: #A6CDDE; + color: white; + float: right; + height: 200%; + overflow: hidden; + .details { + padding: 20px; + float: right; + width: calc(70% - 40px); + } + + + } + } + } + + } + +// .loading { +// position: fixed; +// z-index: 999; +// height: 2em; +// width: 2em; +// overflow: show; +// margin: auto; +// top: 0; +// left: 0; +// bottom: 0; +// right: 0; +// } + +// /* Transparent Overlay */ +// .loading:before { +// content: ''; +// display: block; +// position: fixed; +// top: 0; +// left: 0; +// width: 100%; +// height: 100%; +// background-color: rgba(0,0,0,0.3); +// } + +// /* :not(:required) hides these rules from IE9 and below */ +// .loading:not(:required) { +// /* hide "loading..." text */ +// font: 0/0 a; +// color: transparent; +// text-shadow: none; +// background-color: transparent; +// border: 0; +// } + +// .loading:not(:required):after { +// content: ''; +// display: block; +// font-size: 10px; +// width: 1em; +// height: 1em; +// margin-top: -0.5em; +// -webkit-animation: spinner 1500ms infinite linear; +// -moz-animation: spinner 1500ms infinite linear; +// -ms-animation: spinner 1500ms infinite linear; +// -o-animation: spinner 1500ms infinite linear; +// animation: spinner 1500ms infinite linear; +// border-radius: 0.5em; +// -webkit-box-shadow: rgba(0, 0, 0, 0.75) 1.5em 0 0 0, rgba(0, 0, 0, 0.75) 1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) 0 1.5em 0 0, rgba(0, 0, 0, 0.75) -1.1em 1.1em 0 0, rgba(0, 0, 0, 0.5) -1.5em 0 0 0, rgba(0, 0, 0, 0.5) -1.1em -1.1em 0 0, rgba(0, 0, 0, 0.75) 0 -1.5em 0 0, rgba(0, 0, 0, 0.75) 1.1em -1.1em 0 0; +// box-shadow: rgba(0, 0, 0, 0.75) 1.5em 0 0 0, rgba(0, 0, 0, 0.75) 1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) 0 1.5em 0 0, rgba(0, 0, 0, 0.75) -1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) -1.5em 0 0 0, rgba(0, 0, 0, 0.75) -1.1em -1.1em 0 0, rgba(0, 0, 0, 0.75) 0 -1.5em 0 0, rgba(0, 0, 0, 0.75) 1.1em -1.1em 0 0; +// } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.spec.ts new file mode 100644 index 000000000..9dbfd0e6a --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BusinessAssetsInfoComponent } from './business-assets-info.component'; + +describe('BusinessAssetsInfoComponent', () => { + let component: BusinessAssetsInfoComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ BusinessAssetsInfoComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(BusinessAssetsInfoComponent); + 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-assets-info/business-assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts new file mode 100644 index 000000000..12c0f2cb9 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts @@ -0,0 +1,699 @@ +import { Component,OnInit,Inject,Input } from '@angular/core'; + +import { FormBuilder, FormGroup, Validators, FormArray,} from '@angular/forms'; + +import { NotifierService } from 'angular-notifier'; + +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material'; + +/** Service */ +import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; + +@Component({ + selector: 'app-business-assets-info', + templateUrl: './business-assets-info.component.html', + styleUrls: ['./business-assets-info.component.scss'] +}) +export class BusinessAssetsInfoComponent implements OnInit { + + pageTitle: string ="Business Assets"; + pdid:string; + + public _businessAssetsQuesFrom: FormGroup; + public submitted = false; + public m_assets_type = []; + public applicants: any; + + // businessEmiAmtFlag : boolean = false; + public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"}, + {'value': "no",'viewValue': "No"}, + {'value': "nan",'viewValue': "NA"}] + appxMarketAmtInwords : any = []; + // emiAmtInwords : any = []; + // PremiumPaidInwords : any = []; + // SumAssuredInwords: any = []; + // AmtInvestInwords: any = []; + AssetValueInwords: any = []; + // B_emiAmtInwords: any = []; + public m_propertyType = []; + // public m_investmentType = []; + // public m_freqOfPurchase = []; + private notifier: NotifierService; + existCompanyList: any =[]; + mergeCompanyApplicant: any=[]; + currentYear:any=new Date().getFullYear(); + + public viewerOptions: any = { + navbar: false, + toolbar: { + zoomIn: 4, + zoomOut: 4, + oneToOne: 4, + reset: 4, + prev: 4, + play: { + show: 4, + size: 'large', + }, + next: 4, + rotateLeft: 4, + rotateRight: 4, + flipHorizontal: 4, + flipVertical: 4, + } + }; + company_id: any; + + constructor( + notifier: NotifierService, + private _formBuilder: FormBuilder, + private pdTrigerService: PdTrigerService, + private dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public pd_all_details: any) { + this.pdid = this.pd_all_details.pdmaster_details.pd_id; + this.applicants = this.pd_all_details.pdapplicants_detials; + this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'}); + this.company_id =this.pd_all_details.company_id; + this.notifier = notifier; + } + + + ngOnInit() { + + // 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===true && val.is_company_applicant===true); + } + + let modifyCompanyList : any=[]; + if(this.existCompanyList.length>0){ + modifyCompanyList = this.existCompanyList.map(element => { + return {id:element.company_order_id.toString(),name:element.company_name,group_id:1}; + }); + this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) + } + 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(); + this.getM_Assets_Type(); + this.getM_PropertyType(); + // this.getM_InvestmentType(); + // this.getM_FreqOfPurchase(); + } + + /** Assets Type For Dropdown List */ + getM_Assets_Type() { + this.pdTrigerService.getAllMasterDatas('ASSETTYPE').subscribe( + data => { + this.m_assets_type = data.records.filter(data => data.isactive == 1 && data.flag == 1); + }, + error => { + this.notifier.notify('warning', 'No Category Records Found.!'); + // this.m_assets_type = "No Category Records Found."; + } + ) + } + + /** Property Type For Dropdown List */ + getM_PropertyType() { + this.pdTrigerService.getAllMasterDatas('PROPERTIES').subscribe( + data => { + this.m_propertyType = data.records.filter(data => data.isactive == 1); + }, + error => { + this.notifier.notify('warning', 'No Category Records Found.!'); + // this.m_assets_type = "No Category Records Found."; + } + ) + } + + // getM_InvestmentType() { + // this.pdTrigerService.getAllMasterDatas('INVESTMENTTYPE').subscribe( + // data => { + // this.m_investmentType = data.records.filter(data => data.isactive == 1); + // }, + // error => { + // this.notifier.notify('warning', 'No Category Records Found.!'); + // // this.m_assets_type = "No Category Records Found."; + // } + // ) + // } + + // getM_FreqOfPurchase() { + // this.pdTrigerService.getAllMasterDatas('FREQUENCY').subscribe( + // data => { + // this.m_freqOfPurchase = data.records.filter(data => data.isactive == 1); + // }, + // error => { + // this.notifier.notify('warning', 'No Category Records Found.!'); + // // this.m_assets_type = "No Category Records Found."; + // } + // ) + // } + + //Get Data Based on PDID and FORMID + apiLoadFinish: boolean = false; + getPdSupplierFormDetails() { + this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '22').subscribe( + data => { + if (data) { + if (data.dataStatus) { + this.formLoadData(data.records); + } else { + this.formLoadData(null); + } + this.apiLoadFinish = true; + } else { + // this.noRecordFound = true; + } + } + ); + } + + //load Form Data + formLoadData(val) { + if (val !== null) { + let value = val; + this._businessAssetsQuesFrom = this._formBuilder.group({ + pdid: [this.pdid], + formid: ['22'], + company_id : [this.company_id], + business_assets_details : this._formBuilder.array([]), + business_assets_form_remark:[value.business_assets_form_remark || 'check'] + }); + this.addBusinessAssetsDetailsWithData(value.business_assets_details); + } else { + this._businessAssetsQuesFrom = this._formBuilder.group({ + pdid: [this.pdid], + formid: ['22'], + company_id : [this.company_id], + business_assets_details : this._formBuilder.array([ + this.initBusinessDetails(), + ]), + business_assets_form_remark:[''] + }); + } + this.loadDetails = true; + } + + // convenience getter for easy access to form fields + get f() { return this._businessAssetsQuesFrom.controls; } + + // get f_assets_details() { + // return this._businessAssetsQuesFrom.get('assets_details'); + // } + + // Dynamic Form field creation Functionality : START ===> + initBusinessDetails() { + return this._formBuilder.group({ + business_assets_mode: [''], + business_details: this._formBuilder.array([]), + business_approximate_market_value: [''], + business_name_of_the_owner: [], + business_name_of_the_other_owner: [], + business_vintage: [''], + business_purchase_year: ['',Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])], + business_emi: [''], + }); + } + + show: boolean; + selectedAssetsType(e: any, i: any): void { + let val = i; + const arr = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray; + arr.controls.splice(0); + + switch (e.value) { + case '2': { + let val = i; + const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + control.push(this.loadProperty()); + break; + } + case '3': { + const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + control.push(this.load_Four_Weeler()); + break; + } + case '4': { + const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + control.push(this.loadEquipmentManufacturingDescription()); + break; + } + // case '5': { + // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + // //control.push(this.loadJwellDescription()); + // break; + // } + // case '8': { + // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + // control.push(this.loadConsumerDurableDescription()); + // break; + // } + // case '6': { + // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + // control.push(this.loadInsuranceDescription()); + // break; + // } + // case '7': { + // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + // control.push(this.loadInvestDescription()); + // break; + // } + case '1': { + const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + control.push(this.otherBusinessAssetsDescription()); + break; + } + default: { + break; + } + } + } + + + loadProperty() { + return this._formBuilder.group({ + property_type: [''], + other_property_type: [''] + }); + } + + // loadJwellDescription() { + // return this._formBuilder.group({ + // jwell_description: [''] + // }); + // } + + // loadConsumerDurableDescription() { + // return this._formBuilder.group({ + // consumer_durable_description: [''] + // }); + // } + + loadEquipmentManufacturingDescription() { + return this._formBuilder.group({ + equipment_manufacturing_description: [''] + }); + } + + otherBusinessAssetsDescription() { + return this._formBuilder.group({ + any_other_assets: [''], + any_other_asset_value : [''], + any_other_asset_loan : [''], + }); + } + + // loadInsuranceDescription() { + // return this._formBuilder.group({ + // //insurance_type: [''], + // premium_paid: [''], + // frequency_mode: [''], + // other_frequency_mode:[''], + // sum_assured: [''], + // members_coverd: [''] + // }); + // } + + // loadInvestDescription() { + // return this._formBuilder.group({ + // investments_type: [''], + // other_investments_type:[''], + // amount_of_invest: [], + // bank_name: [''] + // }); + // } + + load_Four_Weeler() { + return this._formBuilder.group({ + manufacturer_model_vehicle: [''] + }); + } + + // load_Two_Weeler() { + // return this._formBuilder.group({ + // manufacturer_model_vehicle: [''] + // }); + // } + + loadPropertyWithData(data) { + return this._formBuilder.group({ + property_type: [data.property_type], + other_property_type: [data.other_property_type] + //property_type:[''] + }); + } + + // loadJwellDescriptionWithData(data) { + // return this._formBuilder.group({ + // jwell_description: [data.jwell_description] + // }); + // } + + // loadConsumerDurableDescriptionWithData(data) { + // return this._formBuilder.group({ + // consumer_durable_description: [data.consumer_durable_description] + // }); + // } + + loadEquipmentManufacturingDescriptionWithData(data) { + return this._formBuilder.group({ + equipment_manufacturing_description: [data.equipment_manufacturing_description] + }); + } + + otherBusinessAssetsDescriptionWithData(data) { + return this._formBuilder.group({ + any_other_assets: [data.any_other_assets], + any_other_asset_value : [data.any_other_asset_value], + any_other_asset_loan : [data.any_other_asset_loan], + }); + } + + + // loadInsuranceDescriptionWithData(data) { + // return this._formBuilder.group({ + // //insurance_type: [data.insurance_type], + // premium_paid: [data.premium_paid], + // frequency_mode: [data.frequency_mode], + // other_frequency_mode:[data.other_frequency_mode], + // sum_assured: [data.sum_assured], + // members_coverd: [data.members_coverd] + // }); + // } + + // loadInvestDescriptionWithData(data) { + // return this._formBuilder.group({ + // investments_type: [data.investments_type], + // other_investments_type : [data.other_investments_type], + // amount_of_invest: [data.amount_of_invest], + // bank_name: [data.bank_name] + // }); + // } + + load_Four_WeelerWithData(data) { + return this._formBuilder.group({ + manufacturer_model_vehicle: [data.manufacturer_model_vehicle] + }); + } + + // load_Two_WeelerWithData(data) { + // return this._formBuilder.group({ + // manufacturer_model_vehicle: [data.manufacturer_model_vehicle] + // }); + // } + + initBusinessDetailsWithdata(data) { + + let formGroup= this._formBuilder.group({ + business_assets_mode: [data.business_assets_mode], + 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], + business_name_of_the_other_owner:[data.business_name_of_the_other_owner || ''], + // relation: [data.relation || ''], + business_vintage: [data. business_vintage], + business_purchase_year: [data. business_purchase_year,Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])], + // purchase_month: [data.purchase_month], + business_emi: [data.business_emi || ''], + }); + return formGroup; + } + + loadDetails: boolean; + + addBusinessAssetsDetailsWithData(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); + }); + + for (let val of result) { + let vals = { + 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, + business_name_of_the_other_owner: val.business_name_of_the_other_owner, + business_purchase_year: val. business_purchase_year, + business_vintage : val.business_vintage, + business_emi: val.business_emi, + }; + + const control = this._businessAssetsQuesFrom.controls['business_assets_details']; + control.push(this.initBusinessDetailsWithdata(vals)); + this.setBusinessAssetsDetailsWithData(vals.business_assets_mode, val.business_details, control.length - 1) + } + } + this.loadDetails = true; + } + + setBusinessAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void { + + let val = i; + let data = datas; + + const arr = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + arr.controls.splice(0); + + switch (assets_details_mode) { + case '2': { + let business_property_datas : any; + data.forEach((datas,i) => { + business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type }; + }); + const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + control.push(this.loadPropertyWithData(business_property_datas)); + break; + } + case '3': { + let business_Four_Weeler_datas : any; + data.forEach((datas,i) => { + business_Four_Weeler_datas = { 'manufacturer_model_vehicle': datas.manufacturer_model_vehicle }; + }); + const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + control.push(this.load_Four_WeelerWithData(business_Four_Weeler_datas)); + break; + } + case '4': { + let equipment_manufacturing_description_datas : any; + data.forEach((datas,i) => { + equipment_manufacturing_description_datas= { 'equipment_manufacturing_description': datas.equipment_manufacturing_description }; + }); + const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + control.push(this.loadEquipmentManufacturingDescriptionWithData(equipment_manufacturing_description_datas)); + break; + } + // case '4': { + // break; + // } + // case '5': { + // let business_ConsumerDurableDescription_datas : any; + // data.forEach((datas,i) => { + // business_ConsumerDurableDescription_datas = { 'consumer_durable_description': datas.consumer_durable_description }; + // }); + // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + // control.push(this.loadConsumerDurableDescriptionWithData(business_ConsumerDurableDescription_datas)); + // break; + // } + // case '6': { + // let business_InsuranceDescription_datas : any; + // data.forEach((datas,i) => { + // this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid); + // this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured); + // business_InsuranceDescription_datas = { + // 'premium_paid': datas.premium_paid, + // 'frequency_mode': datas.frequency_mode, + // 'other_frequency_mode':datas.other_frequency_mode, + // 'sum_assured': datas.sum_assured, + // 'members_coverd': datas.members_coverd + // }; + // }); + // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + // control.push(this.loadInsuranceDescriptionWithData(business_InsuranceDescription_datas)); + // break; + // } + // case '7': { + // let business_InvestDescription_datas : any; + // data.forEach((datas,i) => { + // this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest); + // business_InvestDescription_datas = { 'investments_type': datas.investments_type, + // 'other_investments_type' : datas.other_investments_type, + // 'amount_of_invest': datas.amount_of_invest, + // 'bank_name': datas.bank_name }; + // }); + // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + // control.push(this.loadInvestDescriptionWithData(business_InvestDescription_datas)); + // break; + // } + case '1': { + let array_datas : any; + data.forEach((datas,i) => { + this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value); + array_datas = { + 'any_other_assets': datas.any_other_assets, + 'any_other_asset_value' : datas.any_other_asset_value, + 'any_other_asset_loan' : datas.any_other_asset_loan, + }; + }); + const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; + control.push(this.otherBusinessAssetsDescriptionWithData(array_datas)); + break; + } + default: { + break; + } + } + } + + /** Add More Asset using Flag Both "Other Asset" And "Business Asset" */ + addAssetDetails(e) { + + const control = this._businessAssetsQuesFrom.controls['business_assets_details']; + control.push(this.initBusinessDetails()); + + } + + /** To remove The Added Asset using Flag Both "Other Asset" And "Business Asset" */ + removeAssetsDetails(i: number) { + + const control = this._businessAssetsQuesFrom.controls['business_assets_details']; + control.removeAt(i); + + } + + public paymentModeTextBox: number; + selectedPM(e) { + this.paymentModeTextBox = e.value; + // this.f.supplier_details.controls.get('payment_mode_value'); + } + + public freqPurchaseTextBox: number; + selectedFreqPurchase(e) { + this.freqPurchaseTextBox = e.value; + } + // // compare objects for merge two master table details + // compareObjects(o1: any, o2: any) { + // if(o1.id == o2.id && o1.group_id == o2.group_id) + // return true; + // else return false + // } + + // // check others + checkOthers(values){ + if(values!=null) { + return values.id==0 ? true : false; + } + else { + return false; + } + + } + + // calculate vintage and purchase {} + calculateVintagePurchase(value: any, controlKey: any,type: number){ + if(type==1){ + let control: any = this._businessAssetsQuesFrom.controls['business_assets_details']; + control.controls[controlKey].controls['business_purchase_year'].setValue(value!='' ? parseInt(this.currentYear)-parseInt(value) : ''); + } + else if(type==2) { + let control: any = this._businessAssetsQuesFrom.controls['business_assets_details']; + value!='' && value<=this.currentYear ? control.controls[controlKey].controls['business_purchase_year'].setValue(value) : control.controls[controlKey].controls['business_purchase_year'].setValue(''); + value!='' && value<=this.currentYear ? control.controls[controlKey].controls['business_vintage'].setValue(parseInt(this.currentYear)-parseInt(value)) : control.controls[controlKey].controls['business_vintage'].setValue('') + } + } + + /** To Save/Edited Popup Data */ + onSubmit() { + this.submitted = true; + + // stop here if form is invalid + if (this._businessAssetsQuesFrom.invalid) { + this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); + return; + } else { + var answerFormValues = this._businessAssetsQuesFrom.value; + //To Remove The "Null" With Key also + Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); + // Save the data with help of Service + this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe( + dataresult => { + if(dataresult.status == 200) { + this.notifier.notify('success', 'Saved Successfully.'); + setTimeout(() =>{ + this.dialogRef.close(); + },3000); + } + else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); + } + } + + /** To Reset Popup Data */ + onReset() { + const arr = this._businessAssetsQuesFrom.controls.business_assets_details; + arr.controls.splice(0); + this.getPdSupplierFormDetails(); + } + + /** On Key Press Event For Number only Accepting */ + keyPress(event: any) { + const pattern = /[0-9\-\.\ ]/; + + let inputChar = String.fromCharCode(event.charCode); + if (event.keyCode != 8 && !pattern.test(inputChar)) { + event.preventDefault(); + } + } + + /** Amount InWords */ + inWords(e,i,flag){ + switch(flag){ + case 1 : + this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + // case 2 : + // this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + // break; + // case 3 : + // this.emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + // break; + // case 4 : + // this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + // break; + // case 5 : + // this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + // break; + case 6 : + this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; + // case 7 : + // this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + // break; + default: + break; + } + +} + +} 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 index 20245d4b5..b75abc822 100644 --- 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 @@ -9,6 +9,7 @@ import {ClientInfoComponent} from './../../forms/client-info/client-info.compone 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'; +import { BusinessAssetsInfoComponent } from './../../forms/business-assets-info/business-assets-info.component'; @Component({ selector: 'app-business-info-group', @@ -116,6 +117,18 @@ export class BusinessInfoGroupComponent implements OnInit { this.getCompanyListForBusiness(); }); } + else if(details.form_id==22){ + const dialogRef = this.dialog.open(BusinessAssetsInfoComponent, { + 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/stock/stock.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts index 4b23b98ec..308563dbc 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 @@ -99,8 +99,9 @@ export class StockComponent implements OnInit { // }) //this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe( - this._pd.stockFormAccess({pd_id:this.pdid,company_id:this.company_id}).subscribe(data => { - + + this._pd.stockFormAccess(this.pdid,this.company_id).subscribe(data => { + console.log(data); if(data.dataStatus == true){ let datas = data.records; if(datas.type_of_activity != undefined){ 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 b6fd635e6..c715e62ad 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 @@ -27,6 +27,7 @@ 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'; +import { BusinessAssetsInfoComponent } from './forms/business-assets-info/business-assets-info.component'; @Component({ selector: 'app-start-pd', @@ -417,6 +418,19 @@ export class StartPdComponent implements OnInit, OnDestroy { // this.notifier.notify('success', 'Successfully allocated.!'); this.loadTemplates(this.startPD); }); + }else + if(this.selectedFormsCategory.form_id==22){ + const dialogRef = this.dialog.open(BusinessAssetsInfoComponent, { + data: this.pdFullDetails, + position: { right: '0'}, + width:'80%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.notifier.notify('success', 'Successfully allocated.!'); + this.loadTemplates(this.startPD); + }); } 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 c358f634a..01bd42905 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 @@ -91,6 +91,7 @@ import { QcReviewComponent } from './list-pd/pd-report/qc-review/qc-review.compo import { SharedModule } from "app/shared/shared.module"; import { BusinessInfoGroupComponent } from './list-pd/start-pd/forms/business-info-group/business-info-group.component'; import { SearchRelationPipe } from './../pd-pipes/search-relation.pipe'; +import { BusinessAssetsInfoComponent } from './list-pd/start-pd/forms/business-assets-info/business-assets-info.component'; /** * Custom angular notifier options @@ -268,7 +269,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, BusinessInfoGroupComponent, SearchRelationPipe], + declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, BusinessAssetsInfoComponent], // exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent], // providers: [PdTrigerService, GetGeometricLocationService], @@ -311,7 +312,7 @@ const pdCustomNotifierOptions: NotifierOptions = { {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, + entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent, ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent], }) 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 1e32065f9..f6afb25e4 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 @@ -461,9 +461,12 @@ export class PdTrigerService { ) } - stockFormAccess(pdid: any): Observable { - - return this._http.post(this.apiUrl + "getTypeOfActivetyFromBusinessForm", { "records": pdid }) + /** For Stock Details + * To Get The Products With TypeofActivity From Business + **/ + stockFormAccess(pdid: any,companyid: any): Observable { + // - { "pd_id":"104","company_id":"1"} + return this._http.post(this.apiUrl + "getProductsWithTypeofActivityFromBusiness", { "records": { "pd_id" : pdid , "company_id":companyid} }) .pipe( catchError(this.handleError('operation', [])) )