diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts index 68e8d57a9..c7541c588 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-applicant/edit-pd-applicant.component.ts @@ -150,9 +150,13 @@ export class EditPdApplicantComponent implements OnInit { // console.log(itemElement.coapplicant_landline); let concat_landline if(itemElement.coapplicant_stdcode != null && itemElement.coapplicant_landline != null){ - let std = itemElement.coapplicant_stdcode == '' ? '' : itemElement.coapplicant_stdcode; - let landline = itemElement.coapplicant_landline == '' ? '' : itemElement.coapplicant_landline; - concat_landline = std+'-'+landline; + if(itemElement.coapplicant_stdcode == '' && itemElement.coapplicant_landline == ''){ + concat_landline = null; + }else{ + let std = itemElement.coapplicant_stdcode == '' ? '' : itemElement.coapplicant_stdcode; + let landline = itemElement.coapplicant_landline == '' ? '' : itemElement.coapplicant_landline; + concat_landline = std+'-'+landline; + } }else if(itemElement.coapplicant_stdcode == '' && itemElement.coapplicant_landline == ''){ concat_landline = null; }else{ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html index e06e9f46c..76ae7e05c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html @@ -32,7 +32,7 @@
- + {{m_addressType.address_type}} @@ -42,7 +42,7 @@
- +
@@ -83,6 +83,12 @@
+
+ + + +
+
@@ -95,7 +101,6 @@
- @@ -103,7 +108,8 @@
- + + {{"₹"}} {{rentAmtInwords}} Only
@@ -119,17 +125,36 @@
+ + +
+
+ + + Yes + No + + +
+
+ + + +
+
+ +
- - - + + + Yes No
-
+ @@ -176,7 +201,7 @@ - +
@@ -209,7 +234,8 @@ - + + {{"₹"}} {{premisesRentAmtInwords[i]}} Only + { + console.log(item); + console.log(index); + //this.premisesRentAmtInwords[index] = this._pd.convertNumberToWords(item.premises_rent_amt); + }); + this.selectedValue(this.bussiness_address_type,this.additional_premises); if (data.records.locality_others) { this.addressForm.controls.locality_others.setValue(data.records.locality_others); @@ -181,12 +207,15 @@ export class AddressComponent implements OnInit { locality_others: [''], pd_location: ['', Validators.compose([Validators.required])], comment_locality: ['', Validators.compose([Validators.required])], + other_comment_locality : [''], //customer_behaviour: ['', Validators.compose([Validators.required])], //neighbourhood: this.fb.array([]), address_form_remark:[''], address_ownership:[''], other_ownership:[''], rent_amt:[''], + other_premises_bussiness_activity : [''], + bussiness_activity_remark:[''], bussiness_activity:[''], business_years:[''], business_month:[''], @@ -199,10 +228,13 @@ export class AddressComponent implements OnInit { this.locality = this.addressForm.controls['locality']; this.pdLocation = this.addressForm.controls['pd_location']; this.commentlocality = this.addressForm.controls['comment_locality']; + this.other_comment_locality = this.addressForm.controls['other_comment_locality']; //this.customerBehaviour = this.addressForm.controls['customer_behaviour']; this.ownership = this.addressForm.controls['address_ownership']; this.other_ownership = this.addressForm.controls['other_ownership']; this.rent_amt = this.addressForm.controls['rent_amt']; + this.other_premises_bussiness_activity = this.addressForm.controls['other_premises_bussiness_activity'], + this.bussiness_activity_remark = this.addressForm.controls['bussiness_activity_remark'], this.bussinessActivity = this.addressForm.controls['bussiness_activity']; this.business_years = this.addressForm.controls['business_years']; this.business_month = this.addressForm.controls['business_month']; @@ -303,12 +335,15 @@ export class AddressComponent implements OnInit { } records.pd_location = this.pdLocation.value; records.comment_locality = this.commentlocality.value; + records.other_comment_locality = this.other_comment_locality.value; //records.customer_behaviour = this.commentlocality.value; //records.neighbourhood = this.addressForm.controls.neighbourhood.value; records.address_form_remark = this.addressForm.controls.address_form_remark.value; records.address_ownership = this.ownership.value; records.other_ownership = this.other_ownership.value; records.rent_amt = this.rent_amt.value; + records.other_premises_bussiness_activity = this.other_premises_bussiness_activity.value; + records.bussiness_activity_remark = this.bussiness_activity_remark.value; records.bussiness_activity = this.bussinessActivity.value; records.business_years = this.business_years.value; records.business_month = this.business_month.value; @@ -323,7 +358,7 @@ export class AddressComponent implements OnInit { } } - console.log('this.addressForm.controls.additional_premises.value',this.addressForm.controls.additional_premises.value); + // console.log('this.addressForm.controls.additional_premises.value',this.addressForm.controls.additional_premises.value); this.addressForm.controls.additional_premises.value.forEach((val,index)=> { @@ -348,7 +383,7 @@ export class AddressComponent implements OnInit { records.formid = '5'; // records.fk_createdby = '250'; - console.log(JSON.stringify(records)); + // console.log(JSON.stringify(records)); this._pd.saveForm(records).subscribe(data => { @@ -364,6 +399,10 @@ export class AddressComponent implements OnInit { // this.formPremisesCityArray.push({city: option}); // }); // } + selectedAddressType(e: any){ + // console.log(e); + this.placeholderName = 'Was any business activity seen at the '+e+' during PD visit?'; + } SelectedPremises($event){ let premisesData = $event.source.value; @@ -516,4 +555,15 @@ export class AddressComponent implements OnInit { event.preventDefault(); } } + + inWords(e,i){ + console.log(e); + console.log(i); + if(i != ''){ + this.premisesRentAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); + } + else if(i == '' ){ + this.rentAmtInwords = this._pd.convertNumberToWords(e.target.value); + } + } } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts index fd418e308..d5b07223c 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 @@ -554,11 +554,10 @@ public m_investmentType = []; }); } - - - loadPropertyWithData(data) { + loadPropertyWithData(data) { return this._formBuilder.group({ - property_type: [data.property_type] + property_type: [data.property_type], + other_property_type: [data.other_property_type] //property_type:[''] }); } @@ -743,28 +742,41 @@ public m_investmentType = []; setAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void { let val = i; - // var data = Object.keys(datas).map(function (key) { + // let data = Object.keys(datas).map(function (key) { // return datas[key]; // }); - // alert(JSON.stringify(datas)); + //alert('JSON Other Asset'+JSON.stringify(datas)); let data = datas; + const arr = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; arr.controls.splice(0); switch (assets_details_mode) { case '1': { + let array_data : any; + data.forEach((datas,i) => { + array_data = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type }; + }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.loadPropertyWithData(data)); + control.push(this.loadPropertyWithData(array_data)); break; } case '2': { + let array_data : any; + data.forEach((datas,i) => { + array_data = { 'manufacturer_model_four_weeler': datas.manufacturer_model_four_weeler }; + }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.load_Four_WeelerWithData(data)); + control.push(this.load_Four_WeelerWithData(array_data)); break; } case '3': { + let array_data : any; + data.forEach((datas,i) => { + array_data = { 'manufacturer_model_two_weeler': datas.manufacturer_model_two_weeler }; + }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.load_Two_WeelerWithData(data)); + control.push(this.load_Two_WeelerWithData(array_data)); break; } case '4': { @@ -773,34 +785,60 @@ public m_investmentType = []; break; } case '5': { + let array_data : any; + data.forEach((datas,i) => { + array_data = { 'consumer_durable_description': datas.consumer_durable_description }; + }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.loadConsumerDurableDescriptionWithData(data)); + control.push(this.loadConsumerDurableDescriptionWithData(array_data)); break; } case '6': { + let array_data : any; data.forEach((datas,i) => { this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid); this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured); + array_data = { + 'premium_paid': datas.premium_paid, + 'frequency_mode': datas.frequency_mode, + 'other_frequency_mode':datas.other_frequency_mode, + 'sum_assured': datas.sum_assured, + 'members_coverd': datas.members_coverd + }; }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.loadInsuranceDescriptionWithData(data)); + control.push(this.loadInsuranceDescriptionWithData(array_data)); break; } case '7': { + let array_data : any; data.forEach((datas,i) => { this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest); + array_data = { 'investments_type': datas.investments_type, + 'other_investments_type' : datas.other_investments_type, + 'amount_of_invest': datas.amount_of_invest, + 'bank_name': datas.bank_name }; }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.loadInvestDescriptionWithData(data)); + control.push(this.loadInvestDescriptionWithData(array_data)); break; } case '8': { + let array_data : any; data.forEach((datas,i) => { - this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value); + array_data = { 'any_other_assets': datas.any_other_assets, + 'name_of_the_owner':datas.name_of_the_owner, + 'other_owner':datas.other_owner, + 'relation':datas.relation, + 'any_other_asset_value' : datas.any_other_asset_value, + 'any_other_asset_loan' : datas.any_other_asset_loan, + 'other_asset_emi_amt' : datas.other_asset_emi_amt + }; + this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.any_other_asset_value); this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt); }); const control = (this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; - control.push(this.otherAssetsDescriptionWithData(data)); + control.push(this.otherAssetsDescriptionWithData(array_data)); break; } default: { @@ -810,60 +848,97 @@ public m_investmentType = []; } setBusinessAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void { - console.log(datas); + let val = i; let data = datas; + const arr = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; arr.controls.splice(0); switch (assets_details_mode) { case '1': { + let business_property_datas : any; + data.forEach((datas,i) => { + business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type }; + }); const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.loadPropertyWithData(data)); + control.push(this.loadPropertyWithData(business_property_datas)); break; } case '2': { + let business_Four_Weeler_datas : any; + data.forEach((datas,i) => { + business_Four_Weeler_datas = { 'manufacturer_model_four_weeler': datas.manufacturer_model_four_weeler }; + }); const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.load_Four_WeelerWithData(data)); + control.push(this.load_Four_WeelerWithData(business_Four_Weeler_datas)); break; } case '3': { + let business_Two_Weeler_datas : any; + data.forEach((datas,i) => { + business_Two_Weeler_datas = { 'manufacturer_model_two_weeler': datas.manufacturer_model_two_weeler }; + }); const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.load_Two_WeelerWithData(data)); + control.push(this.load_Two_WeelerWithData(business_Two_Weeler_datas)); break; } case '4': { break; } case '5': { + let business_ConsumerDurableDescription_datas : any; + data.forEach((datas,i) => { + business_ConsumerDurableDescription_datas = { 'consumer_durable_description': datas.consumer_durable_description }; + }); const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.loadConsumerDurableDescriptionWithData(data)); + control.push(this.loadConsumerDurableDescriptionWithData(business_ConsumerDurableDescription_datas)); break; } case '6': { + let business_InsuranceDescription_datas : any; data.forEach((datas,i) => { this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid); this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured); + business_InsuranceDescription_datas = { + 'premium_paid': datas.premium_paid, + 'frequency_mode': datas.frequency_mode, + 'other_frequency_mode':datas.other_frequency_mode, + 'sum_assured': datas.sum_assured, + 'members_coverd': datas.members_coverd + }; }); const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.loadInsuranceDescriptionWithData(data)); + control.push(this.loadInsuranceDescriptionWithData(business_InsuranceDescription_datas)); break; } case '7': { + let business_InvestDescription_datas : any; data.forEach((datas,i) => { this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest); + business_InvestDescription_datas = { 'investments_type': datas.investments_type, + 'other_investments_type' : datas.other_investments_type, + 'amount_of_invest': datas.amount_of_invest, + 'bank_name': datas.bank_name }; }); const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.loadInvestDescriptionWithData(data)); + control.push(this.loadInvestDescriptionWithData(business_InvestDescription_datas)); break; } case '8': { + let array_datas : any; data.forEach((datas,i) => { this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value); this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt); + array_datas = { + 'any_other_assets': datas.any_other_assets, + 'any_other_asset_value' : datas.any_other_asset_value, + 'any_other_asset_loan' : datas.any_other_asset_loan, + 'other_asset_emi_amt' : datas.other_asset_emi_amt + }; }); const control = (this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; - control.push(this.otherBusinessAssetsDescriptionWithData(data)); + control.push(this.otherBusinessAssetsDescriptionWithData(array_datas)); break; } default: { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html index ef48af123..3da828bb1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html @@ -26,12 +26,12 @@
Starting Financial Year - + Invalid year format @@ -60,7 +60,7 @@ - + No differents in Sales in FY {{details.get('financial_year').value}} over Sales in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} @@ -109,7 +109,7 @@ - + No differents in Profit in FY {{details.get('financial_year').value}} over Profit in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} @@ -121,7 +121,7 @@ - + @@ -181,7 +181,7 @@ - + No differents in Sales in FY {{details.get('estimate_year').value}} over Sales in FY {{financialForm.controls.estimated_value['controls'][i-1].get('estimate_year').value}} @@ -225,7 +225,7 @@
- + No differents in Profit in FY {{details.get('estimate_year').value}} over Profit in FY {{financialForm.controls.estimated_value['controls'][i-1].get('estimate_year').value}} 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 8858a3f4f..0904b395e 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 @@ -100,6 +100,7 @@ export class FinancialInfoComponent implements OnInit { return value.records.estimated_value[key]; }); if (result.length > 0) { + 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); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html index 0c7ce91d7..1f2a2a3d3 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html @@ -58,7 +58,7 @@ - Companies + Company/Firm
@@ -90,7 +90,7 @@
- + Select {{rel.applicant_name | titlecase}} @@ -98,6 +98,7 @@ + Select @@ -117,7 +118,7 @@
-

Company Relationship

+

Company/Firm Relationship

diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts index 40597ea7d..4461cf6b4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts @@ -345,7 +345,24 @@ export class GeneralInfoComponent implements OnInit { }); } } - + selectedApplicant(e,applicant_name){ + console.log(e); + console.log(e.value); + console.log(e.viewValue); + console.log(applicant_name); + } + // selectedfrequency(e,i){ + // switch(+e){ + // case 1: this.placeholderName[i] = 'Weekly Instalment Amount'; break; + // case 2: this.placeholderName[i] = 'Daily Instalment Amount'; break; + // case 3: this.placeholderName[i] = 'Annual Instalment Amount'; break; + // case 4: this.placeholderName[i] = 'Hourly Instalment Amount'; break; + // case 5: this.placeholderName[i] = 'EMI Amount'; break; + // case 6: this.placeholderName[i] = 'Quarterly Instalment Amount'; break; + // case 7: this.placeholderName[i] = 'Halfyearly Instalment Amount'; break; + // default : this.placeholderName[i] = ''; break; + // } + // } // validate all form group and form array fields validateAllFormFields(formGroup: any) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html index a2ba31c75..6002270aa 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 @@ -21,7 +21,7 @@
- {{"₹"}} {{loanAmtInWords}} Only + {{"₹"}} {{loanAmtInWords}} Only
@@ -66,7 +66,7 @@
- {{"₹"}} {{balTxrfAmtInWords}} Only + {{"₹"}} {{balTxrfAmtInWords}} Only - {{"₹"}} {{topUpAmtInWords}} Only + {{"₹"}} {{topUpAmtInWords}} Only @@ -99,7 +99,7 @@ - {{"₹"}} {{ownContributionInWords}} Only + {{"₹"}} {{ownContributionInWords}} Only @@ -135,7 +135,7 @@ - {{"₹"}} {{emiAmtInWords}} Only + {{"₹"}} {{emiAmtInWords}} Only @@ -200,12 +200,12 @@ - {{"₹"}} {{emvAmtInWords}} Only + {{"₹"}} {{emvAmtInWords}} Only diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html index 949f141f1..7aa145080 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html @@ -17,27 +17,30 @@
- + +
Manufacturing Details
-

{{a+1}} . Raw Material

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

{{b+1}} Finished Goods

+ + Finished Goods #{{b+1}} - - Yes - No + + + Add Stock Details + No Stock Observed - + - + - - {{"₹"}} {{M_goodsValueInWords}} Only + + {{"₹"}} {{M_goodsValueInWords[b]}} Only - + + {{"₹"}} {{M_financialGoodsValueInWords[b]}} Only @@ -113,7 +121,7 @@ - + + +
-

{{c+1}} Traded Goods

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

Retail Details

-
+ +
Retail Details
-

{{d+1}} Finished Goods

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

{{e+1}} Traded Goods

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

Trading Details

-
+ +
Trading Details
-

{{f+1}} Finished Goods

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

{{g+1}} Traded Goods

+ + Traded Goods #{{g+1}} - - Yes - No + + Add Stock Details + No stock observed - + - + - - {{"₹"}} {{T_tradedGoodsValueInWords}} Only + + {{"₹"}} {{T_tradedGoodsValueInWords[g]}} Only - + + {{"₹"}} {{T_financialTradedGoodsValueInWords[g]}} Only @@ -378,21 +409,22 @@ - Please comment on the Traded Goods stock level observed? + Please comment on the Traded Goods stock level observed? - - + + - - + + +
@@ -401,9 +433,10 @@ - + +
Service Provider
Service Provider Details Not applicable here !!
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 494ceaf1f..a21ee4ad0 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 @@ -29,15 +29,24 @@ export class StockComponent implements OnInit { rawmaterial : any; - M_rawValueInWords : any; - - M_goodsValueInWords : any; - R_goodsValueInWords : any; - T_goodsValueInWords : any; + M_rawValueInWords : any = []; + M_financialRawValueInWords : any = []; - M_tradedGoodsValueInWords : any; - R_tradedGoodsValueInWords : any; - T_tradedGoodsValueInWords : any; + M_goodsValueInWords : any = []; + R_goodsValueInWords : any = []; + T_goodsValueInWords : any = []; + + M_financialGoodsValueInWords : any = []; + R_financialGoodsValueInWords : any = []; + T_financialGoodsValueInWords : any = []; + + M_tradedGoodsValueInWords : any = []; + R_tradedGoodsValueInWords : any = []; + T_tradedGoodsValueInWords : any = []; + + M_financialTradedGoodsValueInWords : any = []; + R_financialTradedGoodsValueInWords : any = []; + T_financialTradedGoodsValueInWords : any = []; rawMaterialAccess: boolean; finishedGoodsAccess: boolean; @@ -45,6 +54,7 @@ export class StockComponent implements OnInit { public submitted = false; noRecordsFound: Boolean = false; serviceProviderForm: Boolean = false; + suppliers_raw_materials : any = []; constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, private router: Router, @@ -117,9 +127,7 @@ export class StockComponent implements OnInit { params.company_id = this.company_id; this._pd.retriveForm(params).subscribe(value => { if (value.status == 200) { - let dataForm = value.records; - - + let dataForm = value.records; if(dataForm !== undefined) { this.stockForms = this.fb.group({ pdid: [this.pdid], @@ -133,6 +141,24 @@ export class StockComponent implements OnInit { let arr = record.filter(data => data.type_of_activity_id == 1); if(arr.length > 0) { + this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { + console.log('136',value); + if(value.status == 200){ + this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials; + let manufacturing_temparr = []; + manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials; + manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods; + manufacturing_temparr['manufacturing_traded_goods'] = dataForm.manufacturing_details[0].manufacturing_traded_goods; + this.initManufacturingDetails(manufacturing_temparr); + } + else{ + let manufacturing_temparr = []; + manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials; + manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods; + manufacturing_temparr['manufacturing_traded_goods'] = dataForm.manufacturing_details[0].manufacturing_traded_goods; + this.initManufacturingDetails(manufacturing_temparr); + } + }); // console.log(1,dataForm); // console.log(164,dataForm.manufacturing_details); // console.log(2,dataForm.retail_details); @@ -169,14 +195,7 @@ export class StockComponent implements OnInit { // console.log(163,dataForm.manufacturing_details.manufacturing_raw_materials); // console.log(164,dataForm.manufacturing_details[0]); // console.log(164,dataForm.manufacturing_details[0].manufacturing_raw_materials); - - let manufacturing_temparr = []; - - manufacturing_temparr['manufacturing_raw_materials'] = dataForm.manufacturing_details[0].manufacturing_raw_materials; - manufacturing_temparr['manufacturing_finished_goods'] = dataForm.manufacturing_details[0].manufacturing_finished_goods; - manufacturing_temparr['manufacturing_traded_goods'] = dataForm.manufacturing_details[0].manufacturing_traded_goods; - this.initManufacturingDetails(manufacturing_temparr); //this.initManufacturingDetails(dataForm); } @@ -265,7 +284,16 @@ export class StockComponent implements OnInit { }); let arr = record.filter(data => data.type_of_activity_id == 1); if(arr.length > 0) { - this.initManufacturingDetails(null); + this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { + if(value.status == 200){ + this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials; + this.initManufacturingDetails(null); + } + else{ + this.initManufacturingDetails(null); + } + }); + // this.initManufacturingDetails(null); } let arr1 = record.filter(data => data.type_of_activity_id == 2); if(arr1.length > 0) { @@ -293,7 +321,16 @@ export class StockComponent implements OnInit { }); let arr = record.filter(data => data.type_of_activity_id == 1); if(arr.length > 0) { - this.initManufacturingDetails(null); + this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { + if(value.status == 200){ + this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials; + this.initManufacturingDetails(null); + } + else{ + this.initManufacturingDetails(null); + } + }); + } let arr1 = record.filter(data => data.type_of_activity_id == 2); if(arr1.length > 0) { @@ -376,14 +413,27 @@ tradingFormCreation(val) { const rawMaterial = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_raw_materials']; const finishedGoods = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_finished_goods']; const tradedGoods = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials']; - + const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['main_raw_materials']; if(datas === null){ - // console.log(299,'if'); + if(this.suppliers_raw_materials.length > 0){ + for (let val of this.suppliers_raw_materials) { + let Ref_RawMaterials : any = {'raw_name': val.manufacturing_raw_material_name, + 'stock_observed':'', + 'raw_quantity': '', + 'raw_uom': '', + 'other_uom': '', + 'raw_value': '', + 'rawmaterial_value': '', + 'is_sufficiant_raw': '', + 'rawmaterial_remarks':''}; + rawMaterial.push(this.createRawmaterial(Ref_RawMaterials)); + } + } + else{ rawMaterial.push(this.createRawmaterial(null)); + } finishedGoods.push(this.createGoods(null)); tradedGoods.push(this.createTradedGoods(null)); - } else { // console.log(305,'else') // console.log(377,datas); @@ -393,6 +443,7 @@ tradingFormCreation(val) { // console.log(val); if(val.raw_value){ this.M_rawValueInWords = this._pd.convertNumberToWords(val.raw_value); + this.M_financialRawValueInWords = this._pd.convertNumberToWords(val.rawmaterial_value); } rawMaterial.push(this.createRawmaterial(val)); } @@ -405,6 +456,7 @@ tradingFormCreation(val) { // console.log(val); if(val.goods_value){ this.M_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); + this.M_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value); } finishedGoods.push(this.createGoods(val)); @@ -418,6 +470,7 @@ tradingFormCreation(val) { // console.log(val); if(val.estimated_traded_goods_value){ this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); + this.M_financialTradedGoodsValueInWords = this._pd.convertNumberToWords(val.traded_goods_value); } tradedGoods.push(this.createTradedGoods(val)); @@ -430,21 +483,6 @@ tradingFormCreation(val) { } } - createRawmaterial2() { - return this.fb.group({ - raw_name: ['', Validators.compose([Validators.required])], - stock_observed:['', Validators.compose([Validators.required])], - raw_quantity: [''], - raw_uom: [''], - other_uom : [''], - raw_value: [''], - rawmaterial_value: [''], - is_sufficiant_raw: [''], - rawmaterial_remarks:[''] - }); - } - - createRawmaterial(records) { // console.log(330,'function in'); if(records === null) { @@ -495,6 +533,7 @@ tradingFormCreation(val) { if(val.goods_value){ this.R_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); + this.R_financialGoodsValueInWords =this._pd.convertNumberToWords(val.finished_goods_value); } finishedGoods.push(this.createGoods(val)); @@ -510,6 +549,7 @@ tradingFormCreation(val) { // console.log(val); if(val.estimated_traded_goods_value){ this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); + this.R_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value); } tradedGoods.push(this.createTradedGoods(val)); @@ -594,6 +634,7 @@ tradingFormCreation(val) { // console.log(val); if(val.goods_value){ this.T_goodsValueInWords = this._pd.convertNumberToWords(val.goods_value); + this.T_financialGoodsValueInWords = this._pd.convertNumberToWords(val.finished_goods_value); } finishedGoods.push(this.createGoods(val)); @@ -608,6 +649,7 @@ tradingFormCreation(val) { // console.log(val); if(val.estimated_traded_goods_value){ this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(val.estimated_traded_goods_value); + this.T_financialTradedGoodsValueInWords =this._pd.convertNumberToWords(val.traded_goods_value); } tradedGoods.push(this.createTradedGoods(val)); } @@ -831,29 +873,50 @@ tradingFormCreation(val) { } /** To Convert Amount into Words */ - inWords(e,flag:number){ + inWords(e,flag:number,i){ switch(flag){ case 1 : - this.M_rawValueInWords = this._pd.convertNumberToWords(e.target.value); + this.M_rawValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; case 2 : - this.M_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.M_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; case 3 : - this.M_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.M_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; case 4 : - this.R_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.R_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; case 5 : - this.R_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.R_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; case 6 : - this.T_goodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.T_goodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; case 7 : - this.T_tradedGoodsValueInWords = this._pd.convertNumberToWords(e.target.value); + this.T_tradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 8 : + this.M_financialRawValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 9 : + this.M_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 10 : + this.M_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 11 : + this.R_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 12 : + this.R_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 13 : + this.T_financialGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); + break; + case 14 : + this.T_financialTradedGoodsValueInWords[i] = this._pd.convertNumberToWords(e.target.value); break; default: break;