From b652f09ca560cc14ad938137a67c72aeeeb383d6 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Mar 2019 12:08:24 +0530 Subject: [PATCH 1/6] Ri multistoried_building_details changes --- .../rental-verification.component.html | 104 +++++++++- .../rental-verification.component.scss | 7 +- .../rental-verification.component.ts | 192 ++++++++++++++---- 3 files changed, 250 insertions(+), 53 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html index 4f8281d89..15876acca 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html @@ -178,7 +178,7 @@ - + Type of Units as per Loan Applicants @@ -193,19 +193,109 @@ Specify Other Unit Type - - No of Floors - - - + Tot No of Units - + + No of Floors + + + + + Total Area Given on Rent + + + + + + + Unit of Measurement + + + {{unitM.name}} + + + + + + Other Unit of Measurement + + + + + + + + + + + Floor Level Name + + + + + + No of Units + + + + Is Rent Same for All Units + + Yes + No + + + + + +
+ + +
+
+ + Rent per Unit + + {{"₹"}} {{fUnits.value.rent_per_unit | numberToWords}} Only + + + + Amount + + {{"₹"}} {{fUnits.value.amount | numberToWords}} Only + + +
+
+
+ + +
+
+ + Rent Unit {{fu+1}} + + {{"₹"}} {{fUnits.value.amount | numberToWords}} Only + +
+
+
+
+ + + + +
+
+
+ + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss index 2fd9cea87..f250e9787 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss @@ -9,6 +9,9 @@ justify-content: center !important; } .align-margin { - margin-left: 4%; - margin-right: 4%; + margin-left: 2%; + margin-right: 2%; +} +.rent-unit { + margin-left: 2%; } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts index 27fef38fe..0d690b7eb 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts @@ -152,9 +152,13 @@ export class RentalVerificationComponent implements OnInit { }); // observe unit type changes - this._rentalForm.controls['unit_type'].valueChanges.subscribe(val => { + this._rentalForm.controls['unit_type'].valueChanges.subscribe(val => { val.id==1 ? this._rentalForm.addControl('other_unit_type', new FormControl('', Validators.required)) : this._rentalForm.removeControl('other_unit_type'); - val.group_id==1 && val.id==7 ? this._rentalForm.addControl('no_floor', new FormControl('')) : val.group_id==2 && val.id==7 ? this._rentalForm.addControl('no_floor', new FormControl('')) : this._rentalForm.removeControl('no_floor'); + val.group_id==1 && val.id==6 ? this._rentalForm.removeControl('no_units') : val.group_id==2 && val.id==7 ? this._rentalForm.removeControl('no_units') : this._rentalForm.addControl('no_units', new FormControl('')); + val.group_id==1 && val.id==6 ? this._rentalForm.addControl('no_floor', new FormControl('',Validators.required)) : val.group_id==2 && val.id==7 ? this._rentalForm.addControl('no_floor', new FormControl('',Validators.required)) : this._rentalForm.removeControl('no_floor'); + val.group_id==1 && val.id==6 ? this._rentalForm.addControl('multistoried_total_area', new FormControl('',Validators.required)) : val.group_id==2 && val.id==7 ? this._rentalForm.addControl('multistoried_total_area', new FormControl('',Validators.required)) : this._rentalForm.removeControl('multistoried_total_area'); + val.group_id==1 && val.id==6 ? this._rentalForm.addControl('multistoried_uom', new FormControl('',Validators.required)) : val.group_id==2 && val.id==7 ? this._rentalForm.addControl('multistoried_uom', new FormControl('',Validators.required)) : this._rentalForm.removeControl('multistoried_uom'); + val.group_id==1 && val.id==6 ? '' : val.group_id==2 && val.id==7 ? '' : this._rentalForm.setControl('multistoried_building_details', this._fb.array([])); }); // observe visit address @@ -206,6 +210,7 @@ export class RentalVerificationComponent implements OnInit { nature_property: ['',Validators.required], unit_type:['',Validators.required], no_units:[''], + multistoried_building_details: this._fb.array([]), property_unit_details : this._fb.array([]), done_third_party_check :['',Validators.required], rental_remark: [''], @@ -267,7 +272,24 @@ loadFormData(){ rentalVal.formid = this.form_id; rentalVal.other_name_person_type ? this._rentalForm.addControl('other_name_person_type', new FormControl('', Validators.required)): this._rentalForm.removeControl('other_name_person_type'); rentalVal.other_sighted_documents ? this._rentalForm.addControl('other_sighted_documents', new FormControl('', Validators.required)) : this._rentalForm.removeControl('other_sighted_documents'); - + + //get Multistoried Building Details + if(data.records.multistoried_building_details){ + let selectedMultistoriedBuilding = Object.keys(data.records.multistoried_building_details).map(function (key) { + return data.records.multistoried_building_details[key]; + }); + if(selectedMultistoriedBuilding.length>0){ + let control: any = this._rentalForm.controls['multistoried_building_details']; + selectedMultistoriedBuilding.forEach((floorElement,floorIndex)=>{ + control.push(this.createFloorDetails('')); + let unitControl = control.controls[floorIndex]; + unitControl= unitControl.controls['floor_unit_details']; + floorElement.floor_unit_details.forEach((unitElement,unitIndex) => { + floorElement.unit_rent_difference_options=="0" ? unitControl.push(this.createFloorUnitDetails(2)) : unitControl.push(this.createFloorUnitDetails(1)); + }); + }); + } + } // get property unit details if(data.records.property_unit_details){ let selectedUnitDetails = Object.keys(data.records.property_unit_details).map(function (key) { @@ -439,6 +461,10 @@ generateTenantOptions(value:any,index:number){ value.unit_measurement.id=="1" ? control.controls[index].addControl('other_unit_measurement', new FormControl('', Validators.required)) : control.controls[index].removeControl('other_unit_measurement'); } +// generate multistoried other uom +generateMultistoriedOtherUOM(value: any){ + value.multistoried_uom.id=="1" ? this._rentalForm.addControl('multistoried_other_uom', new FormControl('', Validators.required)) : this._rentalForm.removeControl('multistoried_other_uom'); +} // generate Rent AgreementSeen generateRentAgreementSeen(value: any,index:number){ let control: any = this._rentalForm.controls['property_unit_details']; @@ -657,50 +683,128 @@ else { } // generate floor rows -// generateFloor(e:any): void{ -// let control = this._rentalForm.controls['floor_details']; -// if(e.target.value && Math.round(e.target.value)!=0){ +generateFloor(e:any): void{ + let control = this._rentalForm.controls['multistoried_building_details']; + if(e.target.value && Math.round(e.target.value)!=0){ -// if(Math.round(e.target.value) > this._rentalForm.value.floor_details.length){ -// let rowValue = Math.round(e.target.value)-this._rentalForm.value.floor_details.length; -// for(let i=rowValue;i>0;i--){ -// control.push(this.createFloorDetails('')); -// } -// } -// else if(Math.round(e.target.value) < this._rentalForm.value.floor_details.length){ -// let rowValue = this._rentalForm.value.floor_details.length-Math.round(e.target.value); -// for(let i=rowValue;i>0;i--){ -// control.removeAt(this._rentalForm.value.floor_details.length-1); -// } -// } -// } -// else if(e.target.value && Math.round(e.target.value)==0){ -// control.controls = []; -// control.setValue([]); -// } -// else{ -// control.controls = []; -// control.setValue([]); -// } -// e.stopPropagation(); -// } + if(Math.round(e.target.value) > this._rentalForm.value.multistoried_building_details.length){ + let rowValue = Math.round(e.target.value)-this._rentalForm.value.multistoried_building_details.length; + for(let i=rowValue;i>0;i--){ + control.push(this.createFloorDetails('')); + } + } + else if(Math.round(e.target.value) < this._rentalForm.value.multistoried_building_details.length){ + let rowValue = this._rentalForm.value.multistoried_building_details.length-Math.round(e.target.value); + for(let i=rowValue;i>0;i--){ + control.removeAt(this._rentalForm.value.multistoried_building_details.length-1); + } + } + } + else if(e.target.value && Math.round(e.target.value)==0){ + control.controls = []; + control.setValue([]); + } + else{ + control.controls = []; + control.setValue([]); + } + e.stopPropagation(); +} // create floor details -// createFloorDetails(details){ -// if(details){ -// return this._fb.group({ -// floor_level: [this._rentalForm.value.floor_details.length==0 ? 'Ground Floor' : this._rentalForm.value.floor_details.length+' Floor', Validators.compose([Validators.required])], -// no_units_on_floor: ['', Validators.compose([Validators.required])], -// }); -// } -// else{ -// return this._fb.group({ -// floor_level: [this._rentalForm.value.floor_details.length==0 ? 'Ground Floor' : this._rentalForm.value.floor_details.length+' Floor', Validators.compose([Validators.required])], -// no_units_in_floor: ['', Validators.compose([Validators.required])], -// }); -// } - -// } +createFloorDetails(details){ + if(details){ + return this._fb.group({ + floor_level: [this._rentalForm.value.multistoried_building_details.length==0 ? 'Ground Floor' : this._rentalForm.value.multistoried_building_details.length+' Floor', Validators.compose([Validators.required])], + no_units_in_floor: ['', Validators.compose([Validators.required])], + unit_rent_difference_options : ['', Validators.compose([Validators.required])], + floor_unit_details : this._fb.array([]), + }); + } + else{ + return this._fb.group({ + floor_level: [this._rentalForm.value.multistoried_building_details.length==0 ? 'Ground Floor' : this._rentalForm.value.multistoried_building_details.length+' Floor', Validators.compose([Validators.required])], + no_units_in_floor: ['', Validators.compose([Validators.required])], + unit_rent_difference_options : ['', Validators.compose([Validators.required])], + floor_unit_details : this._fb.array([]), + }); + } + +} + +// generate floor unit details +generateFloorUnit(values:any, index:number){ + let control: any = this._rentalForm.controls['multistoried_building_details']; + control = control.controls[index]; + control= control.controls['floor_unit_details']; + if(values.no_units_in_floor>0 && values.unit_rent_difference_options=="0"){ + if(Math.round(values.no_units_in_floor) > control.value.length){ + let rowValue = Math.round(values.no_units_in_floor)-control.value.length; + for(let i=rowValue;i>0;i--){ + control.push(this.createFloorUnitDetails(2)); + } + } + else if(Math.round(values.no_units_in_floor) < control.value.length){ + let rowValue = control.value.length-Math.round(values.no_units_in_floor); + for(let i=rowValue;i>0;i--){ + control.removeAt(control.value.length-1); + } + } + else if(Math.round(values.no_units_in_floor)==0){ + control.controls = []; + control.setValue([]); + } + else{ + control.controls = []; + control.setValue([]); + } + + } + else if(values.no_units_in_floor>0 && values.unit_rent_difference_options=="1") { + control.controls = []; + control.setValue([]); + control.push(this.createFloorUnitDetails(1)); + this.calculateSameRentAmt(control.value,index); + } + else { + control.controls = []; + control.setValue([]); + } + +} + +// create floor unit details +createFloorUnitDetails(type:number){ + if(type==1){ + return this._fb.group({ + rent_per_unit: ['', Validators.compose([Validators.required])], + amount: ['', Validators.compose([Validators.required])], + }); + } + else if(type==2){ + return this._fb.group({ + amount: ['', Validators.compose([Validators.required])], + }); + } + +} +// calculate same rent amount +calculateSameRentAmt(values: any, index: number){ + if(values.unit_rent_difference_options=="1"){ + let control: any = this._rentalForm.controls['multistoried_building_details']; + control = control.controls[index]; + control= control.controls['floor_unit_details']; + if(control.value[control.value.length-1].rent_per_unit>0 && values.no_units_in_floor>0){ + control.controls[control.value.length-1].controls['amount'].setValue(control.value[control.value.length-1].rent_per_unit * values.no_units_in_floor); + } + else{ + control.controls[control.value.length-1].controls['amount'].setValue(''); + + } + } + +} + // compare objects for merge two master table details compareObjects(o1: any, o2: any) { if(o1.id == o2.id && o1.group_id == o2.group_id) From 7748eee03037e65d77187c53c0d8b360075346e5 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Mar 2019 12:09:09 +0530 Subject: [PATCH 2/6] merge : kms --- .../assets-info/assets-info.component.html | 26 +-- .../assets-info/assets-info.component.ts | 73 +------ .../banking-details.component.html | 7 +- .../banking-details.component.ts | 18 -- .../business-assets-info.component.html | 25 +-- .../business-assets-info.component.ts | 34 +--- .../business-banking-details.component.html | 5 +- .../business-banking-details.component.ts | 20 +- .../business-info.component.html | 7 +- .../business-info/business-info.component.ts | 20 +- .../current-loan/current-loan.component.html | 20 +- .../current-loan/current-loan.component.ts | 18 +- .../family-details.component.html | 9 +- .../family-details.component.ts | 27 +-- .../financial-info.component.html | 101 +++++++-- .../financial-info.component.ts | 192 +++++++++--------- .../loan-details/loan-details.component.html | 35 ++-- .../loan-details/loan-details.component.ts | 44 ++-- .../neighbour-hood.component.html | 5 +- .../neighbour-hood.component.ts | 10 +- .../other-income/other-income.component.html | 3 +- .../other-income/other-income.component.ts | 8 +- .../start-pd/forms/stock/stock.component.ts | 2 - .../pd-pipes/number-to-words.pipe.ts | 186 +++++++++++------ .../pd-service/pd-triger.service.ts | 126 ++++++------ 25 files changed, 479 insertions(+), 542 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 ca44c17d1..8237438d9 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 @@ -173,11 +173,8 @@
- - {{"₹"}} - {{OtherPremiumPaidInwords[s]}} Only - + + {{"₹"}} {{detail.get('premium_paid').value | numberToWords}} Only - - {{"₹"}} - {{OtherSumAssuredInwords[s]}} Only + + {{"₹"}} {{detail.get('sum_assured').value | numberToWords}} Only @@ -239,12 +234,8 @@ - - - - {{"₹"}} - {{OtherAmtInvestInwords[i]}} Only + OnlyNumber type="text" autocomplete="off"> + {{"₹"}} {{detail.get('amount_of_invest').value | numberToWords}} Only
@@ -305,9 +296,8 @@ - {{"₹"}} - {{OtherAppxMarketAmtInwords[i]}} Only + OnlyNumber type="text" autocomplete="off"> + {{"₹"}} {{sup.get('approximate_market_value').value | numberToWords}} Only 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 e84d93773..d33507767 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 @@ -51,21 +51,7 @@ export class AssetsInfoComponent implements OnInit { public m_any_asset_loan_type = [{ 'value': "yes", 'viewValue': "Yes" }, { 'value': "no", 'viewValue': "No" }, { 'value': "nan", 'viewValue': "NA" }] - // appxMarketAmtInwords : any = []; - OtherAppxMarketAmtInwords: any = []; - // emiAmtInwords : any = []; - OtherEmiAmtInwords: any = []; - // PremiumPaidInwords : any = []; - OtherPremiumPaidInwords: any = []; - // SumAssuredInwords: any = []; - OtherSumAssuredInwords: any = []; - // AmtInvestInwords: any = []; - OtherAmtInvestInwords: any = []; - // AssetValueInwords: any = []; - OtherAssetValueInwords: any = []; - // B_emiAmtInwords: any = []; - O_emiAmtInwords: any = []; - + public m_propertyType = []; public m_investmentType = []; @@ -625,7 +611,7 @@ export class AssetsInfoComponent implements OnInit { // }); // } // this.isOtherOwner[index] = Avaliablity == 0 ? true : false; - this.OtherAppxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.approximate_market_value); + this.setRequiredValidation(datas.name_of_the_owner, index, '', 4); }); } @@ -655,7 +641,7 @@ export class AssetsInfoComponent implements OnInit { // 'any_other_asset_value' : datas.any_other_asset_value, // 'any_other_asset_loan' : datas.any_other_asset_loan, }; - this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.any_other_asset_value); + }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; control.push(this.otherAssetsDescriptionWithData(array_data)); @@ -706,8 +692,7 @@ export class AssetsInfoComponent implements OnInit { 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, @@ -723,7 +708,6 @@ export class AssetsInfoComponent implements OnInit { 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, @@ -944,55 +928,6 @@ export class AssetsInfoComponent implements OnInit { } - /** Amount InWords */ - inWords(e, i, flag) { - switch (flag) { - case 1: - // this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - break; - case 2: - this.OtherAppxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - break; - case 3: - // this.emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - break; - 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; - } - } } 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 5f313ecb7..3bce61856 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 @@ -155,11 +155,14 @@ - + + + {{"₹"}} {{itemrow.get('limit').value | numberToWords}} Only
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/banking-details/banking-details.component.ts index 4ad73fbe7..f663f42bd 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 @@ -45,8 +45,6 @@ export class BankingDetailsComponent implements OnInit { salaryField: boolean; OtherFlag: any = []; limitCaseFlag: any = []; - amtInwords: any = []; - emiAmtInwords: any = []; existCompanyList: any = []; mergeCompanyApplicant: any = []; @@ -149,7 +147,6 @@ export class BankingDetailsComponent implements OnInit { control.push(this.createBankarray()); } else { result.forEach((datas, index) => { - this.amtInwords[index] = this._pd.convertNumberToWords(+datas.limit); // this.selectedBorrower(datas.applicant_name,index); this.selectedAccTypeChanges(+datas.account_type, index) @@ -342,19 +339,4 @@ export class BankingDetailsComponent implements OnInit { itemrow.controls.vintage_month.setValue(Math.floor(converted_month)); } - - /** Amount InWords */ - inWords(e, i, flag) { - switch (flag) { - case 1: - this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - case 2: - this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - default: - break; - } - } - } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html index c38fd1f94..4e75d9dc1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html @@ -91,11 +91,9 @@ - - {{"₹"}} - {{RentAmtInwordsForAddress[i]}} Only - Monthly Rent Amount Required + + {{"₹"}} {{itemrow.get('business_monthly_rented_amt').value | numberToWords}} Only + Monthly Rent Amount Required @@ -103,9 +101,8 @@ - {{"₹"}} - {{appxMarketAmtInwordsForAddress[i]}} Only + OnlyNumber type="text" autocomplete="off"> + {{"₹"}} {{itemrow.get('business_approximate_market_value').value | numberToWords}} Only @@ -289,10 +286,9 @@ - - {{"₹"}} - {{RentAmtInwords[i]}} Only + + {{"₹"}} {{sup.get('business_monthly_rented_amt').value | numberToWords}} Only Monthly Rent Amount Required
@@ -300,9 +296,8 @@
- {{"₹"}} - {{appxMarketAmtInwords[i]}} Only + OnlyNumber type="text" autocomplete="off"> + {{"₹"}} {{sup.get('business_approximate_market_value').value | numberToWords}} Only diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts index ca1f903a8..865719bf9 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts @@ -63,12 +63,6 @@ export class BusinessAssetsInfoComponent implements OnInit { mergeCompanyApplicant: any = []; endUserList = []; - /**Declaration of amount in words */ - appxMarketAmtInwords: any = []; - appxMarketAmtInwordsForAddress: any = []; - RentAmtInwords: any = []; - RentAmtInwordsForAddress: any = []; - /**Constructor of the class */ constructor( notifier: NotifierService, @@ -582,8 +576,7 @@ console.clear(); }); if (result.length > 0) { result.forEach((datas, index) => { - this.RentAmtInwordsForAddress[index] = this.pdTrigerService.convertNumberToWords(datas.business_monthly_rented_amt); - this.appxMarketAmtInwordsForAddress[index] = this.pdTrigerService.convertNumberToWords(datas.business_approximate_market_value); + let Avaliablity = 1; if (datas.business_name_of_the_owner.length > 0) { @@ -639,8 +632,7 @@ console.clear(); if (result.length > 0) { result.forEach((datas, index) => { - this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value); - this.RentAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_monthly_rented_amt); + let Avaliablity = 1; if (datas.business_name_of_the_owner.length > 0) { @@ -996,27 +988,7 @@ console.clear(); this.placeholderName = 'Was any business activity seen at the ' + e + ' during PD visit?'; } - /** Amount InWords */ - inWords(e, i, flag) { - switch (flag) { - case 1: - this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - break; - case 8: - this.RentAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - break; - case 9: - this.RentAmtInwordsForAddress[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - break; - case 10: - this.appxMarketAmtInwordsForAddress[i] = this.pdTrigerService.convertNumberToWords(e.target.value); - break; - default: - break; - } - - } - + /** For Docs Tab */ public viewerOptions: any = { navbar: false, diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html index ca2995d5d..fa7cce6a8 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html @@ -90,9 +90,8 @@ - {{"₹"}} - {{amtInwords[i]}} Only + formControlName="limit" OnlyNumber type="text"> + {{"₹"}} {{itemrow.get('limit').value | numberToWords}} Only
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts index 0c34fbeae..acd5e3bd6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts @@ -46,8 +46,6 @@ export class BusinessBankingDetailsComponent implements OnInit { salaryField: boolean; OtherFlag: any = []; limitCaseFlag: any = []; - amtInwords: any = []; - emiAmtInwords: any = []; existCompanyList: any = []; mergeCompanyApplicant: any = []; @@ -146,11 +144,11 @@ export class BusinessBankingDetailsComponent implements OnInit { control.push(this.createBankarray()); } else { result.forEach((datas, index) => { - this.amtInwords[index] = this._pd.convertNumberToWords(+datas.limit); + // this.selectedBorrower(datas.applicant_name,index); this.selectedAccTypeChanges(+datas.account_type, index) - // this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi); + control.push(this.createBankarray()); }); this.bankingForm.controls.itemRows.setValue(result); @@ -356,20 +354,6 @@ export class BusinessBankingDetailsComponent implements OnInit { } - /** Amount InWords */ - inWords(e, i, flag) { - switch (flag) { - case 1: - this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - case 2: - this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - default: - break; - } - } - setRequiredValidation(value, item, flag) { if (flag == 1) { 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 6b85828b2..408ab90d5 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 @@ -1510,10 +1510,15 @@
+ {{"₹"}} {{businessForm.controls['employees_appx_salary'].value | numberToWords}} Only + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts index b326cb500..a0dd3f9ae 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts @@ -66,7 +66,7 @@ export class BusinessInfoComponent implements OnInit { //sourceNames: any = {"Private Limited Company": 'Director / Shareholder Details',"Proprietorship": 'Proprietor Details', "Sole Proprietorship": 'Proprietor Details',"Partnership": 'Partner Details',"Limited Liability Partnership (LLP)": 'Partner Details',"One Person Company (OPC)": 'Director Details',"Hindu Undivided Family (HUF)": 'Karta Details',"Society": 'Member Details',"Cooperative": 'Member Details',"Trust": 'Trustee Details',"Public Ltd Company": 'Director / Shareholder Details','Individual':'Self',"Others": 'Other Enitity Details'}; sourceNames: { [k: string]: any } = {}; maxDate: any; - // InvestedAmountInWords:any; + public relationSource = new MatTableDataSource(); displayedColumns = ['title', 'family_member_name', 'relation', 'relation_to', 'relationship_with_company', 'started_business']; generalExistEntityType: string; @@ -79,7 +79,6 @@ export class BusinessInfoComponent implements OnInit { monthErrorMessage: any = []; errorMessageForExistTotalWorkExperience: any = []; ExportFlag: boolean = false; - appxSalaryAmtInwords: any; isreadonlyyear: any = []; isreadonlymonth: any = []; ManufacturingUnChecked: boolean; @@ -225,9 +224,9 @@ export class BusinessInfoComponent implements OnInit { businessVal.formid = this.form_id; businessVal.company_id = this.company_id; businessVal.fk_createdby = this.pdid; - if (businessVal.employees_appx_salary) { - this.appxSalaryAmtInwords = this._pd.convertNumberToWords(businessVal.employees_appx_salary); - } + + + //businessVal.designation = DesgnArray; businessVal.partners = PartnrArray; businessVal.documents = DocArray; @@ -1669,10 +1668,6 @@ export class BusinessInfoComponent implements OnInit { } } - /** To Convert Amount into Words */ - // inWords(e){ - // this.InvestedAmountInWords = this._pd.convertNumberToWords(e); - // } checkTotalEmployee(FormData) { this.businessForm.controls['employees_total'].setValue((+FormData.value.employees_permanent || 0) + (+FormData.value.employees_temporary || 0)); @@ -1841,13 +1836,6 @@ export class BusinessInfoComponent implements OnInit { } - inWords(e, flag) { - switch (flag) { - case 1: - this.appxSalaryAmtInwords = this._pd.convertNumberToWords(e.target.value); - break; - } - } changePOSMachinesAvailablity(e, flag) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html index 752cad88a..6bd06ad7e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.html @@ -62,10 +62,8 @@
- {{"₹"}} - {{amtInwords[i]}} Only + formControlName="loan_amount" OnlyNumber type="text"> + {{"₹"}} {{details.get('loan_amount').value | numberToWords}} Only + - - {{"₹"}} - {{emiAmtInwords[i]}} Only + formControlName="emi" OnlyNumber type="text"> + {{"₹"}} {{details.get('emi').value | numberToWords}} Only + + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts index 2c8b310a0..8ff714826 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/current-loan/current-loan.component.ts @@ -37,9 +37,7 @@ export class CurrentLoanComponent implements OnInit { placeholderName: any = []; IDXval: any; OtherFlag: any = []; - amtInwords: any = []; labelArr: any = []; - emiAmtInwords: any = []; dataFromAssets: any = []; existCompanyList: any = []; mergeCompanyApplicant: any = []; @@ -135,8 +133,6 @@ export class CurrentLoanComponent implements OnInit { const control = this.currentLoanForm.controls['loan_details']; if (result.length > 0) { result.forEach((val, index) => { - this.amtInwords[index] = this._pd.convertNumberToWords(val.loan_amount); - this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi); this.selectedfrequency(val.frequency, index); //this.selectedLoanTakenBy(val.loan_taken_by,index); @@ -562,19 +558,7 @@ export class CurrentLoanComponent implements OnInit { }) }); } - /** Amount InWords */ - inWords(e, i, flag) { - switch (flag) { - case 1: - this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - case 2: - this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - default: - break; - } - } + setRequiredValidation(value, item, flag) { if (flag == 1) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html index 775a11f2c..dd0c2a3e9 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html @@ -102,9 +102,8 @@ - {{"₹"}} - {{RentAmount[i]}} Only + OnlyNumber type="text"> + {{"₹"}} {{sup.get('rent').value | numberToWords}} Only
@@ -109,10 +114,16 @@ + {{"₹"}} {{details.get('financial_net_profit').value | numberToWords}} Only + + + - + {{"₹"}} {{details.get('financial_net_loss').value | numberToWords}} Only + +
+ + {{"₹"}} {{details.get('estimate_sales_from').value | numberToWords}} Only + + + + {{"₹"}} {{details.get('estimate_sales_to').value | numberToWords}} Only + + + {{"₹"}} {{details.get('estimate_sales_average').value | numberToWords}} Only + +
@@ -293,37 +326,55 @@ + {{"₹"}} {{details.get('estimate_profit_margin').value | numberToWords}} Only + +
+ {{"₹"}} {{details.get('estimate_net_profit_from').value | numberToWords}} Only + + + {{"₹"}} {{details.get('estimate_net_profit_to').value | numberToWords}} Only + + - + {{"₹"}} {{details.get('estimate_net_profit').value | numberToWords}} Only + +
@@ -344,13 +395,22 @@ + {{"₹"}} {{details.get('estimate_loss_margin').value | numberToWords}} Only + +
+ + {{"₹"}} {{details.get('financial_annual_sale').value | numberToWords}} Only + @@ -358,11 +418,16 @@ {{AV_netLossAmtFrmInwords[i]}} Only - + {{"₹"}} {{details.get('estimate_net_loss_to').value | numberToWords}} Only + + + {{"₹"}} {{details.get('estimate_net_loss').value | numberToWords}} Only + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts index 7bf734f8a..3b04c3da8 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts @@ -47,26 +47,26 @@ export class FinancialInfoComponent implements OnInit { customerCommentsFlag :boolean; //Array for Amount Inwords - FY_annualSalesInwords : any = []; - FY_netProfitAmtInwords : any = []; - FY_netLossAmtInwords : any = []; - AV_SalesInwords : any = []; - AV_annualSalesInwords : any = []; - AV_marginProfitAmtInwords : any = []; - AV_netProfitAmtInwords : any = []; - AV_marginLossAmtInwords : any = []; - AV_netLossAmtInwords : any = []; + // FY_annualSalesInwords : any = []; + // FY_netProfitAmtInwords : any = []; + // FY_netLossAmtInwords : any = []; + // AV_SalesInwords : any = []; + // AV_annualSalesInwords : any = []; + // AV_marginProfitAmtInwords : any = []; + // AV_netProfitAmtInwords : any = []; + // AV_marginLossAmtInwords : any = []; + // AV_netLossAmtInwords : any = []; //isreadonly for edit(no of year Fields and Starting Years ) isReadOnly : boolean = false; EditAble: boolean = true; isDisplay : boolean ; - AV_netProfitAmtFrmInwords: any = []; - AV_netProfitAmtToInwords: any = []; - AV_netLossAmtFrmInwords: any = []; - AV_netLossAmtToInwords: any = []; - AV_SalesFrmInwords: any = []; - AV_SalesToInwords: any = []; + // AV_netProfitAmtFrmInwords: any = []; + // AV_netProfitAmtToInwords: any = []; + // AV_netLossAmtFrmInwords: any = []; + // AV_netLossAmtToInwords: any = []; + // AV_SalesFrmInwords: any = []; + // AV_SalesToInwords: any = []; av : any =[{id:6, name:'Letter of Credit'}, {id:2, name:'Bank Guarantee'}, {id:3, name:'Cash Credit Limit'}, @@ -145,9 +145,9 @@ export class FinancialInfoComponent implements OnInit { this.customerCommentsFlag = result.length == 1 ? false : true; result.forEach((val,index) => { //financial_date.push(this.createDate()); - this.FY_annualSalesInwords[index] = this._pd.convertNumberToWords(val.financial_annual_sale); - this.FY_netProfitAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_profit); - this.FY_netLossAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_loss); + // this.FY_annualSalesInwords[index] = this._pd.convertNumberToWords(val.financial_annual_sale); + // this.FY_netProfitAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_profit); + // this.FY_netLossAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_loss); financial_date.push(this.createDate('')); }); retriveData.date_per_financial = result; @@ -166,17 +166,17 @@ export class FinancialInfoComponent implements OnInit { if (result_val.length > 0) { result_val.forEach((val,index) => { - this.AV_SalesInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_average)); - this.AV_SalesFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_from)); - this.AV_SalesToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_to)); - this.AV_marginProfitAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); - this.AV_netProfitAmtFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); - this.AV_netProfitAmtToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); - this.AV_netProfitAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_net_profit)); - this.AV_marginLossAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_loss_margin)); - this.AV_netLossAmtFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); - this.AV_netLossAmtToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); - this.AV_netLossAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_net_loss)); + // this.AV_SalesInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_average)); + // this.AV_SalesFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_from)); + // this.AV_SalesToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_to)); + // this.AV_marginProfitAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); + // this.AV_netProfitAmtFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); + // this.AV_netProfitAmtToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); + // this.AV_netProfitAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_net_profit)); + // this.AV_marginLossAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_loss_margin)); + // this.AV_netLossAmtFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); + // this.AV_netLossAmtToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); + // this.AV_netLossAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_net_loss)); estimated_val.push(this.createValue('')); }); retriveData.estimated_value = result_val; @@ -1091,11 +1091,11 @@ export class FinancialInfoComponent implements OnInit { if(lower > higer){ details.controls.estimate_sales_average.setValue(higer!= Infinity ? higer.toFixed(2):0); - this.AV_SalesInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + // this.AV_SalesInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); } else{ details.controls.estimate_sales_average.setValue(lower!= Infinity ? lower.toFixed(2):0); - this.AV_SalesInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + // this.AV_SalesInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); } } @@ -1162,7 +1162,7 @@ export class FinancialInfoComponent implements OnInit { if (r == true) { details.controls.estimate_profit_margin.setValue(Profit_Average!= Infinity ? Math.round(Profit_Average):0); details.controls.estimate_profit_margin_percent.setValue(consi_profit_percent.toFixed(2)); - this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average)); + // this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average)); }else{ details.controls.estimate_profit_range_to.setValue(''); details.controls.estimate_profit_margin.setValue(''); @@ -1173,7 +1173,7 @@ export class FinancialInfoComponent implements OnInit { details.controls.estimate_profit_margin.setValue(Profit_Average!= Infinity ? Math.round(Profit_Average):0); details.controls.estimate_profit_margin_percent.setValue(consi_profit_percent.toFixed(2)); - this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average)); + // this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average)); // details.controls.estimate_profit_margin.setValue(Math.round(Profit_Average)); // details.controls.estimate_profit_margin_percent.setValue(profit_percent.toFixed(2)); @@ -1246,13 +1246,13 @@ export class FinancialInfoComponent implements OnInit { details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0); let Profit_percent = (higer/+sales_average)*100; details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); - this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); } else{ details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0); let Profit_percent = (lower/+sales_average)*100; details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); - this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); } } else if(estimate_net_profit_from > 5000000 || estimate_net_profit_from <= 10000000){ @@ -1276,13 +1276,13 @@ export class FinancialInfoComponent implements OnInit { details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0); let Profit_percent = (higer/+sales_average)*100; details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); - this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); } else{ details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0); let Profit_percent = (lower/+sales_average)*100; details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); - this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); } } @@ -1306,13 +1306,13 @@ export class FinancialInfoComponent implements OnInit { details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0); let Profit_percent = (higer/sales_average)*100; details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); - this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); } else{ details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0); let Profit_percent = (lower/sales_average)*100; details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); - this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); } } else{ @@ -1321,13 +1321,13 @@ export class FinancialInfoComponent implements OnInit { details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0); let Profit_percent = (higer/sales_average)*100; details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); - this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); } else{ details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0); let Profit_percent = (lower/sales_average)*100; details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); - this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); } } @@ -1395,7 +1395,7 @@ export class FinancialInfoComponent implements OnInit { details.controls.estimate_loss_margin.setValue(loss_Average!= Infinity ? Math.round(loss_Average):0); details.controls.estimate_loss_margin_percent.setValue(consi_loss_percent.toFixed(2)); - this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average)); + // this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average)); }else{ details.controls.estimate_loss_range_to.setValue(''); details.controls.estimate_loss_margin.setValue(''); @@ -1406,7 +1406,7 @@ export class FinancialInfoComponent implements OnInit { details.controls.estimate_loss_margin.setValue(loss_Average!= Infinity ? Math.round(loss_Average):0); details.controls.estimate_loss_margin_percent.setValue(+consi_loss_percent.toFixed(2)); - this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average)); + // this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average)); } } @@ -1487,13 +1487,13 @@ export class FinancialInfoComponent implements OnInit { details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0); let loss_percent = (higer/+sales_average)*100; details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); - this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); } else{ details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0); let loss_percent = (lower/+sales_average)*100; details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); - this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); } } @@ -1517,13 +1517,13 @@ export class FinancialInfoComponent implements OnInit { details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0); let loss_percent = (+higer/+sales_average)*100; details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); - this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); } else{ details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0); let loss_percent = (+lower/+sales_average)*100; details.controls.estimate_net_profit_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); - this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); } } else if(estimate_net_loss_from > 10000000){ @@ -1546,13 +1546,13 @@ export class FinancialInfoComponent implements OnInit { details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0); let loss_percent = (higer/+sales_average)*100; details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); - this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); } else{ details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0); let loss_percent = (+lower/+sales_average)*100; details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); - this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); } } @@ -1562,13 +1562,13 @@ export class FinancialInfoComponent implements OnInit { details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0); let loss_percent = (+higer/+sales_average)*100; details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); - this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); } else{ details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0); let loss_percent = (+lower/+sales_average)*100; details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); - this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); } } @@ -1702,51 +1702,51 @@ export class FinancialInfoComponent implements OnInit { } /** To Convert Amount into Words */ - inWords(e,i,flag:number){ +// inWords(e,i,flag:number){ - switch(flag){ - case 1 : - this.FY_annualSalesInwords[i] = this._pd.convertNumberToWords(e.target.value); - // this.placeholderName[i] = 'Weekly Instalment Amount'; break; - break; - case 2 : - this.FY_netProfitAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); - //alert('Fin net Profit'+this.FY_netProfitAmtInwords[i]); - break; - case 3 : - this.FY_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); - // alert('Fin net Loss'+this.FY_netLossAmtInwords[i]); - break; - case 4 : - this.AV_annualSalesInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - case 5 : - this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - case 6 : - this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - case 7 : - this.AV_netProfitAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - case 8 : - this.AV_netProfitAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - case 9 : - this.AV_netLossAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - case 10 : - this.AV_netLossAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - case 11 : - this.AV_SalesFrmInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - case 12 : - this.AV_SalesToInwords[i] = this._pd.convertNumberToWords(e.target.value); - break; - default: - break; - } -} +// switch(flag){ +// case 1 : +// this.FY_annualSalesInwords[i] = this._pd.convertNumberToWords(e.target.value); +// // this.placeholderName[i] = 'Weekly Instalment Amount'; break; +// break; +// case 2 : +// this.FY_netProfitAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); +// //alert('Fin net Profit'+this.FY_netProfitAmtInwords[i]); +// break; +// case 3 : +// this.FY_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); +// // alert('Fin net Loss'+this.FY_netLossAmtInwords[i]); +// break; +// case 4 : +// this.AV_annualSalesInwords[i] = this._pd.convertNumberToWords(e.target.value); +// break; +// case 5 : +// this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); +// break; +// case 6 : +// this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); +// break; +// case 7 : +// this.AV_netProfitAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value); +// break; +// case 8 : +// this.AV_netProfitAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value); +// break; +// case 9 : +// this.AV_netLossAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value); +// break; +// case 10 : +// this.AV_netLossAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value); +// break; +// case 11 : +// this.AV_SalesFrmInwords[i] = this._pd.convertNumberToWords(e.target.value); +// break; +// case 12 : +// this.AV_SalesToInwords[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/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 8f6ac1460..999773b6c 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 @@ -24,10 +24,12 @@ - {{"₹"}} - {{loanAmtInWords}} Only + + {{"₹"}} {{ loanDetailsForm.controls['loan_amount'].value | numberToWords }} Only + Loan Tenure applied for? @@ -68,9 +70,9 @@ - {{"₹"}} - {{balTxrfAmtInWords}} Only + (change)="loanCalc()" autocomplete="off"> + {{"₹"}} {{ loanDetailsForm.controls['balance_transfer_amount'].value | numberToWords }} Only + @@ -89,10 +91,9 @@ - {{"₹"}} - {{topUpAmtInWords}} Only + {{"₹"}} {{ loanDetailsForm.controls['topup_amount'].value | numberToWords }} Only @@ -114,10 +115,10 @@ - {{"₹"}} - {{ownContributionInWords}} Only + {{"₹"}} {{ loanDetailsForm.controls['own_contribution'].value | numberToWords }} Only + @@ -142,9 +143,8 @@ - {{"₹"}} - {{emiAmtInWords}} Only + OnlyNumber type="text" autocomplete="off"> + {{"₹"}} {{ loanDetailsForm.controls['emi_level'].value | numberToWords }} Only @@ -212,10 +212,9 @@ - {{"₹"}} - {{emvAmtInWords}} Only + {{"₹"}} {{ loanDetailsForm.controls['emv_per_customer'].value | numberToWords }} Only 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 4e3639c78..d02a1833e 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 @@ -75,16 +75,6 @@ export class LoanDetailsComponent implements OnInit { existCompanyList: any = []; companies: any = []; - /* Declaration of Variables For Amount IN words */ - loanAmtInWords: any; - balTxrfAmtInWords: any; - valAsPerAgmtInWords: any; - ownContributionInWords: any; - topUpAmtInWords: any; - emiAmtInWords: any; - emvAmtInWords: any; - - /** Constructor Of the Class */ constructor(notifier: NotifierService, private fb: FormBuilder, @@ -102,7 +92,7 @@ export class LoanDetailsComponent implements OnInit { this.productID = this.pd_all_details.pdmaster_details.fk_product_id; this.subProductName = this.pd_all_details.pdmaster_details.subproduct_name; this.exist_loan_amt = this.pd_all_details.pdmaster_details.loan_amount != '' ? this.pd_all_details.pdmaster_details.loan_amount : ''; - this.loanAmtInWords = this._pd.convertNumberToWords(this.exist_loan_amt); + // this.loanAmtInWords = this._pd.convertNumberToWords(this.exist_loan_amt); this.form_id = 10; this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.notifier = notifier; @@ -192,7 +182,7 @@ export class LoanDetailsComponent implements OnInit { this.loanDetailsForm.controls['loan_amount'].setValue(value.records.loan_amount); - if (value.records.loan_amount) { this.loanAmtInWords = this._pd.convertNumberToWords(value.records.loan_amount); } + // if (value.records.loan_amount) { this.loanAmtInWords = this._pd.convertNumberToWords(value.records.loan_amount); } this.loanDetailsForm.controls['loan_tenure'].setValue(value.records.loan_tenure); this.loanDetailsForm.controls['sub_product'].setValue(value.records.sub_product || null); @@ -204,11 +194,11 @@ export class LoanDetailsComponent implements OnInit { if (value.records.balance_transfer_amount) { this.loanDetailsForm.controls['balance_transfer_amount'].setValue(value.records.balance_transfer_amount); - this.balTxrfAmtInWords = this._pd.convertNumberToWords(value.records.balance_transfer_amount); + // this.balTxrfAmtInWords = this._pd.convertNumberToWords(value.records.balance_transfer_amount); } if (value.records.topup_amount) { this.loanDetailsForm.controls['topup_amount'].setValue(value.records.topup_amount); - this.topUpAmtInWords = this._pd.convertNumberToWords(value.records.topup_amount); + // this.topUpAmtInWords = this._pd.convertNumberToWords(value.records.topup_amount); if (value.records.topup_amount > 0) { this.loanDetailsForm.controls['end_use_topup'].setValue(value.records.end_use_topup); if (value.records.end_use_topup == 1) { @@ -243,7 +233,7 @@ export class LoanDetailsComponent implements OnInit { }); this.loanDetailsForm.controls['own_contribution'].setValue(value.records.own_contribution); - if (value.records.own_contribution) { this.ownContributionInWords = this._pd.convertNumberToWords(value.records.own_contribution); } + // if (value.records.own_contribution) { this.ownContributionInWords = this._pd.convertNumberToWords(value.records.own_contribution); } this.loanDetailsForm.controls['source'].setValue(dbsourcelist); this.sourceChange(dbsourcelist); @@ -257,7 +247,7 @@ export class LoanDetailsComponent implements OnInit { if (value.records.emi_level) { this.loanDetailsForm.controls['emi_level'].setValue(value.records.emi_level); - this.emiAmtInWords = this._pd.convertNumberToWords(value.records.emi_level); + // this.emiAmtInWords = this._pd.convertNumberToWords(value.records.emi_level); } this.loanDetailsForm.controls['property_type'].setValue(value.records.property_type); @@ -275,7 +265,7 @@ export class LoanDetailsComponent implements OnInit { 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); + // this.emvAmtInWords = this._pd.convertNumberToWords(value.records.emv_per_customer); } } @@ -541,25 +531,25 @@ export class LoanDetailsComponent implements OnInit { inWords(e, flag: number) { switch (flag) { case 1: - this.loanAmtInWords = this._pd.convertNumberToWords(e.target.value); + // this.loanAmtInWords = this._pd.convertNumberToWords(e.target.value); break; case 2: - this.balTxrfAmtInWords = this._pd.convertNumberToWords(e.target.value); + // this.balTxrfAmtInWords = this._pd.convertNumberToWords(e.target.value); break; case 3: - this.valAsPerAgmtInWords = this._pd.convertNumberToWords(e.target.value); + // this.valAsPerAgmtInWords = this._pd.convertNumberToWords(e.target.value); break; case 4: - this.ownContributionInWords = this._pd.convertNumberToWords(e.target.value); + // this.ownContributionInWords = this._pd.convertNumberToWords(e.target.value); break; case 5: - this.topUpAmtInWords = this._pd.convertNumberToWords(e.target.value); + // this.topUpAmtInWords = this._pd.convertNumberToWords(e.target.value); break; case 6: - this.emiAmtInWords = this._pd.convertNumberToWords(e.target.value); + // this.emiAmtInWords = this._pd.convertNumberToWords(e.target.value); break; case 7: - this.emvAmtInWords = this._pd.convertNumberToWords(e.target.value); + // this.emvAmtInWords = this._pd.convertNumberToWords(e.target.value); break; default: break; @@ -593,14 +583,14 @@ export class LoanDetailsComponent implements OnInit { if (loanAmount >= BtAmount) { topupAmt = loanAmount - BtAmount; this.loanDetailsForm.controls['topup_amount'].setValue(topupAmt); - this.topUpAmtInWords = this._pd.convertNumberToWords(topupAmt); + // this.topUpAmtInWords = this._pd.convertNumberToWords(topupAmt); } else { this.notifier.notify('warning', 'Balances Transfer Amount is greater than Loan Amount Please check.!'); this.loanDetailsForm.controls['balance_transfer_amount'].setValue(''); - this.balTxrfAmtInWords = ''; + // this.balTxrfAmtInWords = ''; this.loanDetailsForm.controls['topup_amount'].setValue(''); - this.topUpAmtInWords = ''; + // this.topUpAmtInWords = ''; } } } 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 0823ed11a..d1fdfef8c 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 @@ -168,9 +168,8 @@ - {{"₹"}} - {{amtInwords[r]}} Only + formControlName="business_volume_amount" type="text" OnlyNumber type="text"> + {{"₹"}} {{ reference.controls.business_volume_amount.value | numberToWords}} Only 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 e95cf5cf5..da8a55c1c 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 @@ -38,7 +38,7 @@ export class NeighbourHoodComponent implements OnInit { existCompanyList: any =[]; mergeCompanyApplicant: any=[]; isOrganisationOwner: any=[]; - amtInwords : any = []; + // amtInwords : any = []; // isOtherApplicant: any = []; constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef) { @@ -148,7 +148,7 @@ export class NeighbourHoodComponent implements OnInit { if(exist_ref_details.length>0){ /**&& data.records.check_type==1 */ exist_ref_details.forEach((element,index) => { if(element.business_volume_amount != null){ - this.inWords(element.business_volume_amount,index); + // this.inWords(element.business_volume_amount,index); } // this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount); referencecheckControl.push(this.createReerenceCheck(element)); @@ -477,9 +477,9 @@ checkOthers(values){ // } /** Amount InWords */ - inWords(e,i){ - this.amtInwords[i] = this._pd.convertNumberToWords(e); -} +// inWords(e,i){ +// this.amtInwords[i] = this._pd.convertNumberToWords(e); +// } compareObjects(o1: any, o2: any) { if(o1.id == o2.id && o1.group_id == o2.group_id) 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 cf77dff53..234e71d7f 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 @@ -97,8 +97,7 @@ - {{"₹"}} - {{amtInwords[i]}} Only + {{"₹"}} {{ details.get('amount').value | numberToWords}} Only diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts index f191ff155..379312724 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts @@ -50,7 +50,7 @@ export class OtherIncomeComponent implements OnInit { private notifier: NotifierService; frequencyData: any = []; sourceData: any = []; - amtInwords: any = []; + applicants: any = []; incomeEarnedBy: any = []; existCompanyList: any = []; @@ -150,7 +150,7 @@ export class OtherIncomeComponent implements OnInit { }); if (result.length > 0) { result.forEach((val, index) => { - this.amtInwords[index] = this._pd.convertNumberToWords(val.amount); + // this.getOtherIncomeEarnedBy(val.income_earned_by,index); control.push(this.createDetail()); this.getOtherIncomeEarnedBy(val.income_earned_by, index); @@ -275,10 +275,6 @@ export class OtherIncomeComponent implements OnInit { }); } - /** Amount InWords */ - inWords(e, i) { - this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value); - } Toview() { // alert('Rental Info '); 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 050a9fe1f..7c77961a1 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 @@ -755,8 +755,6 @@ export class StockComponent implements OnInit { checkComments(value, flag, index) { - - if (flag == 1) { this.ManufacturingCounterArray[index] = value == "yes" ? 1 : 0; this.not_stock_of_rm[index] = value == "stock not required to be maintained" ? 1 : 0; diff --git a/ng6-seed/src/app/personal-discussion/pd-pipes/number-to-words.pipe.ts b/ng6-seed/src/app/personal-discussion/pd-pipes/number-to-words.pipe.ts index 2b7796b98..3c0a7a7de 100644 --- a/ng6-seed/src/app/personal-discussion/pd-pipes/number-to-words.pipe.ts +++ b/ng6-seed/src/app/personal-discussion/pd-pipes/number-to-words.pipe.ts @@ -4,68 +4,130 @@ import { Pipe, PipeTransform } from '@angular/core'; name: 'numberToWords' }) export class NumberToWordsPipe implements PipeTransform { + transform(amount: any): any{ + var sglDigit = ["Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"], + dblDigit = ["Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"], + tensPlace = ["", "Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"], + + handle_tens = function(dgt, prevDgt) { + return 0 == dgt ? "" : " " + (1 == dgt ? dblDigit[prevDgt] : tensPlace[dgt]) + }, + handle_utlc = function(dgt, nxtDgt, denom) { + return (0 != dgt && 1 != nxtDgt ? " " + sglDigit[dgt] : "") + (0 != nxtDgt || dgt > 0 ? " " + denom : "") + }; - transform(amount: any): any { - let words: any = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen', 'Twenty']; - words[30] = 'Thirty'; - words[40] = 'Forty'; - words[50] = 'Fifty'; - words[60] = 'Sixty'; - words[70] = 'Seventy'; - words[80] = 'Eighty'; - words[90] = 'Ninety'; - amount = amount.toString(); - let atemp = amount.split("."); - let number = atemp[0].split(",").join(""); - let n_length = number.length; - let words_string = ""; - let value: any; - if (n_length <= 9) { - var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0); - var received_n_array = new Array(); - for (var i = 0; i < n_length; i++) { - received_n_array[i] = number.substr(i, 1); - } - for (var i = 9 - n_length, j = 0; i < 9; i++ , j++) { - n_array[i] = received_n_array[j]; - } - for (var i = 0, j = 1; i < 9; i++ , j++) { - if (i == 0 || i == 2 || i == 4 || i == 7) { - if (n_array[i] == 1) { - n_array[j] = 10 + (+n_array[j]); - n_array[i] = 0; - } - } - } - value = ""; - for (var i = 0; i < 9; i++) { - if (i == 0 || i == 2 || i == 4 || i == 7) { - value = n_array[i] * 10; - } else { - value = n_array[i]; - } - if (value != 0) { - words_string += words[value] + " "; - } - if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) { - words_string += "Crores, "; - } - if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) { - words_string += "Lakhs, "; - } - if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) { - words_string += "Thousand, "; - } - if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) { - words_string += "Hundred and "; - } else if (i == 6 && value != 0) { - words_string += "Hundred "; - } - } - words_string = words_string.split(" ").join(" "); - words_string=(words_string.length > 2 && words_string.charAt(words_string.length-2)==',') ? words_string.slice(0, -2) : words_string; - } - return words_string; - } + var str = "", + digitIdx = 0, + digit = 0, + nxtDigit = 0, + words = []; + if (amount += "", isNaN(parseInt(amount))) str = ""; + else if (parseInt(amount) > 0 && amount.length <= 10) { + for (digitIdx = amount.length - 1; digitIdx >= 0; digitIdx--) + switch (digit = amount[digitIdx] - 0, nxtDigit = digitIdx > 0 ? amount[digitIdx - 1] - 0 : 0, amount.length - digitIdx - 1) { + case 0: + words.push(handle_utlc(digit, nxtDigit, "")); + break; + case 1: + words.push(handle_tens(digit, amount[digitIdx + 1])); + break; + case 2: + words.push(0 != digit ? " " + sglDigit[digit] + " Hundred" + (0 != amount[digitIdx + 1] && 0 != amount[digitIdx + 2] ? " and" : "") : ""); + break; + case 3: + words.push(handle_utlc(digit, nxtDigit, "Thousand")); + break; + case 4: + words.push(handle_tens(digit, amount[digitIdx + 1])); + break; + case 5: + words.push(handle_utlc(digit, nxtDigit, "Lakh")); + break; + case 6: + words.push(handle_tens(digit, amount[digitIdx + 1])); + break; + case 7: + words.push(handle_utlc(digit, nxtDigit, "Crore")); + break; + case 8: + words.push(handle_tens(digit, amount[digitIdx + 1])); + break; + case 9: + words.push(0 != digit ? " " + sglDigit[digit] + " Hundred" + (0 != amount[digitIdx + 1] || 0 != amount[digitIdx + 2] ? " and" : " Crore") : "") + // break; + // case 10: + // words.push(0 != digit ? " " + sglDigit[digit] + " Lakh" + (0 != price[digitIdx + 1] || 0 != price[digitIdx + 2] ? " and" : " Hundred" + (0 != price[digitIdx + 1] || 0 != price[digitIdx + 2] || 0 != price[digitIdx + 3] ? " and" : " Crore")) + // : "") + // break; + } + str = words.reverse().join("") + } else str = ""; + return str + + } + +//References +// transform(amount: any): any { +// let words: any = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen', 'Twenty']; +// words[30] = 'Thirty'; +// words[40] = 'Forty'; +// words[50] = 'Fifty'; +// words[60] = 'Sixty'; +// words[70] = 'Seventy'; +// words[80] = 'Eighty'; +// words[90] = 'Ninety'; +// amount = amount.toString(); +// let atemp = amount.split("."); +// let number = atemp[0].split(",").join(""); +// let n_length = number.length; +// let words_string = ""; +// let value: any; +// if (n_length <= 9) { +// var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0); +// var received_n_array = new Array(); +// for (var i = 0; i < n_length; i++) { +// received_n_array[i] = number.substr(i, 1); +// } +// for (var i = 9 - n_length, j = 0; i < 9; i++ , j++) { +// n_array[i] = received_n_array[j]; +// } +// for (var i = 0, j = 1; i < 9; i++ , j++) { +// if (i == 0 || i == 2 || i == 4 || i == 7) { +// if (n_array[i] == 1) { +// n_array[j] = 10 + (+n_array[j]); +// n_array[i] = 0; +// } +// } +// } +// value = ""; +// for (var i = 0; i < 9; i++) { +// if (i == 0 || i == 2 || i == 4 || i == 7) { +// value = n_array[i] * 10; +// } else { +// value = n_array[i]; +// } +// if (value != 0) { +// words_string += words[value] + " "; +// } +// if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) { +// words_string += "Crores, "; +// } +// if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) { +// words_string += "Lakhs, "; +// } +// if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) { +// words_string += "Thousand, "; +// } +// if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) { +// words_string += "Hundred and "; +// } else if (i == 6 && value != 0) { +// words_string += "Hundred "; +// } +// } +// words_string = words_string.split(" ").join(" "); +// words_string=(words_string.length > 2 && words_string.charAt(words_string.length-2)==',') ? words_string.slice(0, -2) : words_string; +// } +// return words_string; +// } } 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 48d4062fc..4220f0963 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 @@ -412,69 +412,69 @@ export class PdTrigerService { // str += (n[5] != 0) ? ((str != '') ? 'and ' : '') + (a[Number(n[5])] || b[n[5][0]] + ' ' + a[n[5][1]]) + 'only ' : ''; // return str; // } - - convertNumberToWords(amount) { - //let words : any = new Array(); - let words: any = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen', 'Twenty']; - words[30] = 'Thirty'; - words[40] = 'Forty'; - words[50] = 'Fifty'; - words[60] = 'Sixty'; - words[70] = 'Seventy'; - words[80] = 'Eighty'; - words[90] = 'Ninety'; - amount = amount.toString(); - let atemp = amount.split("."); - let number = atemp[0].split(",").join(""); - let n_length = number.length; - let words_string = ""; - let value: any; - if (n_length <= 9) { - var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0); - var received_n_array = new Array(); - for (var i = 0; i < n_length; i++) { - received_n_array[i] = number.substr(i, 1); - } - for (var i = 9 - n_length, j = 0; i < 9; i++ , j++) { - n_array[i] = received_n_array[j]; - } - for (var i = 0, j = 1; i < 9; i++ , j++) { - if (i == 0 || i == 2 || i == 4 || i == 7) { - if (n_array[i] == 1) { - n_array[j] = 10 + (+n_array[j]); - n_array[i] = 0; - } - } - } - value = ""; - for (var i = 0; i < 9; i++) { - if (i == 0 || i == 2 || i == 4 || i == 7) { - value = n_array[i] * 10; - } else { - value = n_array[i]; - } - if (value != 0) { - words_string += words[value] + " "; - } - if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) { - words_string += "Crores "; - } - if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) { - words_string += "Lakhs "; - } - if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) { - words_string += "Thousand "; - } - if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) { - words_string += "Hundred and "; - } else if (i == 6 && value != 0) { - words_string += "Hundred "; - } - } - words_string = words_string.split(" ").join(" "); - } - return words_string; - } + + // convertNumberToWords(amount) { + // //let words : any = new Array(); + // let words: any = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen', 'Twenty']; + // words[30] = 'Thirty'; + // words[40] = 'Forty'; + // words[50] = 'Fifty'; + // words[60] = 'Sixty'; + // words[70] = 'Seventy'; + // words[80] = 'Eighty'; + // words[90] = 'Ninety'; + // amount = amount.toString(); + // let atemp = amount.split("."); + // let number = atemp[0].split(",").join(""); + // let n_length = number.length; + // let words_string = ""; + // let value: any; + // if (n_length <= 9) { + // var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0); + // var received_n_array = new Array(); + // for (var i = 0; i < n_length; i++) { + // received_n_array[i] = number.substr(i, 1); + // } + // for (var i = 9 - n_length, j = 0; i < 9; i++ , j++) { + // n_array[i] = received_n_array[j]; + // } + // for (var i = 0, j = 1; i < 9; i++ , j++) { + // if (i == 0 || i == 2 || i == 4 || i == 7) { + // if (n_array[i] == 1) { + // n_array[j] = 10 + (+n_array[j]); + // n_array[i] = 0; + // } + // } + // } + // value = ""; + // for (var i = 0; i < 9; i++) { + // if (i == 0 || i == 2 || i == 4 || i == 7) { + // value = n_array[i] * 10; + // } else { + // value = n_array[i]; + // } + // if (value != 0) { + // words_string += words[value] + " "; + // } + // if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) { + // words_string += "Crores "; + // } + // if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) { + // words_string += "Lakhs "; + // } + // if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) { + // words_string += "Thousand "; + // } + // if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) { + // words_string += "Hundred and "; + // } else if (i == 6 && value != 0) { + // words_string += "Hundred "; + // } + // } + // words_string = words_string.split(" ").join(" "); + // } + // return words_string; + // } // save additional requirements saveAdditionalRequirements(saveData: any): Observable { From f832225a0e2578ae9ca66a7dbf297850ce015d34 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Mar 2019 12:16:06 +0530 Subject: [PATCH 3/6] Ri changes --- .../forms/rental-verification/rental-verification.component.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss index f250e9787..a0bc3dbf1 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss @@ -14,4 +14,5 @@ } .rent-unit { margin-left: 2%; + margin-top: 2%; } From fd69b0bfd485c234c3ad02839a8c11b45e975628 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Mar 2019 12:19:09 +0530 Subject: [PATCH 4/6] Ri changes --- .../forms/rental-verification/rental-verification.component.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss index a0bc3dbf1..f250e9787 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss @@ -14,5 +14,4 @@ } .rent-unit { margin-left: 2%; - margin-top: 2%; } From 9da5f8351769012ecc64db9f59525312fad82c3c Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Mar 2019 13:43:37 +0530 Subject: [PATCH 5/6] Ri changes --- .../rental-verification.component.html | 22 +++++++---- .../rental-verification.component.scss | 4 ++ .../rental-verification.component.ts | 37 ++++++++++++++----- 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html index 15876acca..d9454d6b6 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.html @@ -261,15 +261,14 @@
Rent per Unit - + {{"₹"}} {{fUnits.value.rent_per_unit | numberToWords}} Only - Amount - + Total Rent Amount + {{"₹"}} {{fUnits.value.amount | numberToWords}} Only -
@@ -280,18 +279,27 @@
Rent Unit {{fu+1}} - - {{"₹"}} {{fUnits.value.amount | numberToWords}} Only + + {{"₹"}} {{fUnits.value.rent_per_unit | numberToWords}} Only
- + +
+ + Total Rent Amount + + {{"₹"}} {{floor.value.floor_rent_amount | numberToWords}} Only + +
+ +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss index f250e9787..ff417d52d 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss @@ -14,4 +14,8 @@ } .rent-unit { margin-left: 2%; + margin-top: 1%; +} +.total-rent-amt{ + margin-left: 2%; } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts index 0d690b7eb..8b191e58a 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.ts @@ -719,6 +719,7 @@ createFloorDetails(details){ no_units_in_floor: ['', Validators.compose([Validators.required])], unit_rent_difference_options : ['', Validators.compose([Validators.required])], floor_unit_details : this._fb.array([]), + floor_rent_amount: [''], }); } else{ @@ -727,6 +728,7 @@ createFloorDetails(details){ no_units_in_floor: ['', Validators.compose([Validators.required])], unit_rent_difference_options : ['', Validators.compose([Validators.required])], floor_unit_details : this._fb.array([]), + floor_rent_amount: [''], }); } @@ -758,13 +760,14 @@ generateFloorUnit(values:any, index:number){ control.controls = []; control.setValue([]); } + this.calculateFloorRentAmt(values,index); } else if(values.no_units_in_floor>0 && values.unit_rent_difference_options=="1") { control.controls = []; control.setValue([]); control.push(this.createFloorUnitDetails(1)); - this.calculateSameRentAmt(control.value,index); + this.calculateFloorRentAmt(values,index); } else { control.controls = []; @@ -778,30 +781,46 @@ createFloorUnitDetails(type:number){ if(type==1){ return this._fb.group({ rent_per_unit: ['', Validators.compose([Validators.required])], - amount: ['', Validators.compose([Validators.required])], + amount: [''], }); } else if(type==2){ return this._fb.group({ - amount: ['', Validators.compose([Validators.required])], + rent_per_unit: ['', Validators.compose([Validators.required])], }); } } // calculate same rent amount -calculateSameRentAmt(values: any, index: number){ +calculateFloorRentAmt(values: any, index: number){ if(values.unit_rent_difference_options=="1"){ let control: any = this._rentalForm.controls['multistoried_building_details']; - control = control.controls[index]; - control= control.controls['floor_unit_details']; - if(control.value[control.value.length-1].rent_per_unit>0 && values.no_units_in_floor>0){ - control.controls[control.value.length-1].controls['amount'].setValue(control.value[control.value.length-1].rent_per_unit * values.no_units_in_floor); + let unitcontrol = control.controls[index]; + unitcontrol= unitcontrol.controls['floor_unit_details']; + if(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit>0 && values.no_units_in_floor>0){ + unitcontrol.controls[unitcontrol.value.length-1].controls['amount'].setValue(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor); + control.controls[index].controls['floor_rent_amount'].setValue(unitcontrol.value[unitcontrol.value.length-1].rent_per_unit * values.no_units_in_floor); } else{ - control.controls[control.value.length-1].controls['amount'].setValue(''); + unitcontrol.controls[unitcontrol.value.length-1].controls['amount'].setValue(''); + control.controls[index].controls['floor_rent_amount'].setValue(''); } } + else if(values.unit_rent_difference_options=="0"){ + let control: any = this._rentalForm.controls['multistoried_building_details']; + let unitcontrol = control.controls[index]; + unitcontrol= unitcontrol.controls['floor_unit_details']; + // console.log(unitcontrol) + let getunitValues = unitcontrol.value.filter(val=>val.rent_per_unit!=''); + if(getunitValues.length>0){ + control.controls[index].controls['floor_rent_amount'].setValue(getunitValues.map(mval=>mval.rent_per_unit).reduce((acc, val) => Number(acc) + Number(val), 0)); + } + else{ + control.controls[index].controls['floor_rent_amount'].setValue(''); + + } + } } From b17ceef935430e05b4f31bcd85194e4c251379a8 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 26 Mar 2019 13:49:56 +0530 Subject: [PATCH 6/6] RI changes --- .../rental-verification/rental-verification.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss index ff417d52d..13b8a16c4 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-verification/rental-verification.component.scss @@ -17,5 +17,5 @@ margin-top: 1%; } .total-rent-amt{ - margin-left: 2%; + margin-left: 1%; }