From d0792f3482de6e0c0ce77df404469af66a1c748a Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 4 Feb 2019 18:12:03 +0530 Subject: [PATCH] merge : kms --- .../list-pd/add-pd/add-pd.component.html | 3 +- .../list-pd/add-pd/add-pd.component.ts | 22 +- .../edit-pd-applicant.component.ts | 73 ++- .../edit-pd-master.component.html | 5 + .../edit-pd-master.component.ts | 14 +- .../forms/address/address.component.html | 4 +- .../forms/address/address.component.ts | 7 +- .../assets-info/assets-info.component.html | 14 +- .../banking-details.component.html | 13 +- .../banking-details.component.ts | 16 +- .../business-assets-info.component.html | 37 +- .../business-assets-info.component.scss | 9 +- .../business-assets-info.component.spec.ts | 0 .../business-assets-info.component.ts | 32 +- .../business-banking-details.component.html | 2 +- .../business-banking-details.component.scss | 0 ...business-banking-details.component.spec.ts | 0 .../business-banking-details.component.ts | 1 + .../business-info-group.component.html | 0 .../business-info-group.component.scss | 0 .../business-info-group.component.spec.ts | 0 .../business-info-group.component.ts | 2 +- .../business-info.component.html | 210 ++++--- .../business-info/business-info.component.ts | 220 ++++++- .../client-info/client-info.component.html | 69 ++- .../client-info/client-info.component.ts | 22 +- .../current-loan/current-loan.component.html | 16 +- .../current-loan/current-loan.component.ts | 150 +++-- .../other-applicant-details.component.html | 9 +- .../other-applicant-details.component.ts | 64 +- .../family-details.component.html | 45 +- .../family-details.component.ts | 42 +- .../final-remarks.component.html | 24 +- .../final-remarks/final-remarks.component.ts | 8 + .../financial-info.component.html | 113 ++-- .../financial-info.component.ts | 570 ++++++++---------- .../general-info/general-info.component.html | 21 +- .../general-info/general-info.component.scss | 0 .../general-info.component.spec.ts | 0 .../general-info/general-info.component.ts | 38 +- .../loan-details/loan-details.component.html | 35 +- .../loan-details/loan-details.component.scss | 6 + .../loan-details/loan-details.component.ts | 52 +- .../neighbour-hood.component.html | 5 +- .../neighbour-hood.component.ts | 4 +- .../other-income/other-income.component.html | 4 +- .../rental-info/rental-info.component.html | 10 +- .../start-pd/forms/stock/stock.component.html | 276 +-------- .../start-pd/forms/stock/stock.component.ts | 474 ++++----------- .../supplier-info.component.html | 51 +- .../supplier-info/supplier-info.component.ts | 22 +- .../list-pd/start-pd/start-pd.component.html | 1 + .../list-pd/view-pd/view-pd.component.html | 4 +- .../list-pd/view-pd/view-pd.component.ts | 1 + .../pd-pipes/search-relation.pipe.spec.ts | 0 .../pd-pipes/search-relation.pipe.ts | 0 .../entity-edit-list-tat.component.html | 0 57 files changed, 1463 insertions(+), 1357 deletions(-) mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.spec.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.html mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.scss mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.spec.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.spec.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/pd-pipes/search-relation.pipe.spec.ts mode change 100644 => 100755 ng6-seed/src/app/personal-discussion/pd-pipes/search-relation.pipe.ts mode change 100644 => 100755 ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-list-tat.component.html diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index 84726cfcf..53af6fa0f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -178,7 +178,8 @@ - + + Enter Valid Pincode. diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index f69ffd8e8..25d14d8da 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -95,7 +95,7 @@ export class AddPdComponent implements OnInit, OnDestroy { fk_city: [null], fk_state: [null],   pincode : [null],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */ - other_pincode:[null], + other_pincode:[null,Validators.compose([Validators.minLength(6),Validators.maxLength(6)])], remarks:[null],   // allocation_type: [null],   // sub_allocation_type: [null], @@ -168,6 +168,7 @@ export class AddPdComponent implements OnInit, OnDestroy { this.subProductList= this.productList.filter(item => item.product_id == productID); this.subProductList=this.subProductList[0].subproducts; + this.subProductList = this.subProductList.filter(item => item.is_others == 0); } // get city list details based on state id @@ -209,8 +210,9 @@ export class AddPdComponent implements OnInit, OnDestroy { data => { if (data.status == 200) { this.titleList=data.records.filter(val=>val.isactive==1); - let index1 = this.titleList.map(data => data.name).indexOf("Master"); - this.titleList.splice(index1, 1); + // console.log(this.titleList); + // let index1 = this.titleList.map(data => data.name).indexOf("Master"); + // this.titleList.splice(index1, 1); } }, error => this.errorMessage = error); @@ -413,7 +415,6 @@ export class AddPdComponent implements OnInit, OnDestroy { // common function for both draft and process pd submitPdDetails(formValue: any, status:string) { - if(this._PDtriggerForm.invalid) { this.validateAllFormFields(this._PDtriggerForm); this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); @@ -428,12 +429,20 @@ export class AddPdComponent implements OnInit, OnDestroy { this.disableAfterSubmit=true; let concat_landline + let concat_landline1 if(formValue.lender_stdcode != null || formValue.lender_landline != null){ concat_landline = formValue.lender_stdcode +'-'+formValue.lender_landline; } else{ concat_landline = null; } + + if(formValue.applicant_stdcode != null || formValue.applicant_landline != null){ + concat_landline1 = formValue.applicant_stdcode +'-'+formValue.applicant_landline; + } + else{ + concat_landline1 = null; + } let pd_details:any={ "fk_lender_id":formValue.fk_lender_id, @@ -450,7 +459,7 @@ export class AddPdComponent implements OnInit, OnDestroy { "addressline1":formValue.addressline1, "fk_city":formValue.fk_city, "fk_state":formValue.fk_state, - "pincode":formValue.pincode , + "pincode":formValue.pincode, "other_pincode":formValue.other_pincode , "remarks":formValue.remarks, "pd_status": status, @@ -463,7 +472,7 @@ export class AddPdComponent implements OnInit, OnDestroy { "applicant_title_name":formValue.applicant_title_name, "company_name":formValue.company_name, "mobile_no":formValue.mobile_no, - "landline":formValue.applicant_stdcode +'-'+formValue.applicant_landline, + "landline":concat_landline1 , "applicant_type":1, "relation":"", }); @@ -501,6 +510,7 @@ export class AddPdComponent implements OnInit, OnDestroy { if(pd_applicant_details.length>0){ pd_form.append("pd_applicant_details",JSON.stringify(pd_applicant_details)) } + pd_form.append("pd_document_titles",JSON.stringify(AllFilesObj)) if(formValue.addtional_requirements.length > 0){ pd_form.append("addtional_requirements",JSON.stringify(formValue.addtional_requirements)) 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 bc278b693..881ab4dd7 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 @@ -55,9 +55,17 @@ export class EditPdApplicantComponent implements OnInit { } loadApplicantFormData() { - let stdcodesearch = this.mainApplicantData[0].landline.search("-"); - let stdcode = this.mainApplicantData[0].landline.substr(0,stdcodesearch); - let landline = this.mainApplicantData[0].landline.substr(+stdcodesearch + 1,8); + let stdcode; + let landline; + if(this.mainApplicantData[0].landline != null){ + let stdcodesearch = this.mainApplicantData[0].landline.search("-"); + stdcode = this.mainApplicantData[0].landline.substr(0,stdcodesearch) ; + landline = this.mainApplicantData[0].landline.substr(+stdcodesearch + 1,8) ; + }else{ + stdcode = ''; + landline = ''; + } + this._EditApplicantForm = this._fb.group({ fk_applicant_primary_id: [this.mainApplicantData[0].pd_co_applicant_id], applicant_name: [this.mainApplicantData[0].applicant_name, Validators.compose([Validators.required])], @@ -79,17 +87,17 @@ export class EditPdApplicantComponent implements OnInit { } createItem(listData): FormGroup { + console.log('listData',listData); if(listData){ let stdcode; let landline; if(listData.landline != null){ - let stdcodesearch = listData.landline.search("-"); - stdcode = listData.landline.substr(0,stdcodesearch); - //console.log(stdcode); - landline = listData.landline.substr(+stdcodesearch + 1,8);} + let stdcodesearch = listData.landline.search("-"); + stdcode = listData.landline.substr(0,stdcodesearch); + landline = listData.landline.substr(+stdcodesearch + 1,8);} else{ - stdcode = null; - landline = null; + stdcode = ''; + landline = ''; } return this._fb.group({ label: ['Co Applicant'], @@ -139,22 +147,37 @@ export class EditPdApplicantComponent implements OnInit { return; } else { - if((formValue.mobile_no == '') || (formValue.stdcode == '' && formValue.landline == '')){ + if((formValue.mobile_no == '') && (formValue.stdcode == '' || formValue.landline == '')){ this.notifier.notify('warning', 'Either Mobile or Landline Need.!'); return; } else{ + let concat_landline1 + if(formValue.stdcode != null && formValue.landline != null){ + if(formValue.stdcode == '' && formValue.landline == ''){ + concat_landline1 = null; + }else { + let std = formValue.stdcode == '' ? '' : formValue.stdcode; + let landline = formValue.landline == '' ? '' : formValue.landline; + concat_landline1 = std+'-'+landline; + } + } + else if(formValue.stdcode == '' && formValue.landline == ''){ + concat_landline1 = null; + }else{ + concat_landline1 = null; + } + let pd_applicant_details : any=[{ "fk_pd_id": this.data.pdID, "pd_co_applicant_id": formValue.fk_applicant_primary_id, "applicant_name":formValue.applicant_name, "company_name":formValue.company_name, "mobile_no":formValue.mobile_no, - "landline":formValue.stdcode+'-'+formValue.landline, + "landline":concat_landline1, "applicant_type":formValue.applicant_type, "relation":formValue.relationship, "applicant_title_name": formValue.applicant_title_name, - "isactive":1 }]; formValue.coApplicantItems.forEach((itemElement, itemIndex) => { @@ -189,19 +212,19 @@ export class EditPdApplicantComponent implements OnInit { } pd_applicant_details.push(obj1) }); - - // this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => { - // if (result.status == 200) { - // this.notifier.notify('success', 'PD Details Updated.'); - // this.dialogRef.close(); - // } - // else { - // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - // } - // }, error => { - // this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - // }); - }} + this._pd.updatePdApplicant(pd_applicant_details).subscribe(result => { + if (result.status == 200) { + this.notifier.notify('success', 'PD Details Updated.'); + this.dialogRef.close(); + } + else { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, error => { + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); + } + } } // get relation master details diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html index 7d4ca2fbb..68612360f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html @@ -150,6 +150,11 @@ {{PL.pincode}} + + + + Enter Valid Pincode. + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts index f54d1c334..30d6fbc55 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts @@ -134,6 +134,7 @@ export class EditPdMasterComponent implements OnInit { loadFormData() { console.log('this.data.record',this.data.records); + console.log('this.reocrds',this.data.records.pincode_id); let stdcode; let landline; if(this.data.records.pd_contact_landline){ @@ -149,7 +150,10 @@ export class EditPdMasterComponent implements OnInit { } this.getCityList(this.data.records.fk_state); - + // let getpincodeid = this.data.records.pincode != '' ? this.data.records.pincode != null ? (this.pincodeList.filter(data => data.pincode == this.data.records.pincode).pincode_id) + // : this.data.records.pincode + // : this.data.records.pincode; + this._EditPDtriggerForm = this._fb.group({ pd_id: [this.data.records.pd_id], fk_lender_id: [this.data.records.fk_lender_id, Validators.compose([Validators.required])], @@ -167,9 +171,10 @@ export class EditPdMasterComponent implements OnInit {   addressline1: [this.data.records.addressline1], fk_city: [this.data.records.fk_city], fk_state: [this.data.records.fk_state], -   pincode : [this.data.records.pincode],/** Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])], */ +   pincode : [this.data.records.pincode_id], + other_pincode:[this.data.records.other_pincode,Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])], remarks: [this.data.records.remarks], - }); + }); } get pdMain() { return this._EditPDtriggerForm.controls; } @@ -206,7 +211,7 @@ export class EditPdMasterComponent implements OnInit { } //trigger pd triggerPD(formValue: any, status:any){ - + console.log('triggerPD',formValue); // this._EditPDtriggerForm.controls['fk_lender_id'].setValidators([Validators.required]); // this._EditPDtriggerForm.controls['fk_lender_id'].updateValueAndValidity(); @@ -333,6 +338,7 @@ export class EditPdMasterComponent implements OnInit { "fk_city": my_array.fk_city, "fk_state": my_array.fk_state,   "pincode": my_array.pincode, + "other_pincode":my_array.other_pincode, "remarks": my_array.remarks, } 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 26d5cf659..fac93f6bc 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 @@ -25,7 +25,7 @@ - + @@ -47,7 +47,7 @@
- + {{m_locality.locality_name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts index e6af8783d..fd6681916 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts @@ -133,9 +133,8 @@ export class AddressComponent implements OnInit { this.addressForm.controls.address.setValue(data.records.address); this.addressForm.controls.pd_location.setValue(data.records.pd_location); this.addressForm.controls.address_type.setValue(data.records.address_type); - let selectedAddressType = this.addressData.filter(element =>element.address_type_id == data.records.address_type); - this.selectedAddressType(selectedAddressType); - + let selectedAddressType = this.addressData.filter(element =>element.address_type_id == data.records.address_type)[0]; + this.selectedAddressType(selectedAddressType.address_type); if(data.records.address_type == 1) { this.addressForm.controls.address_type_others.setValue(data.records.address_type_others); this.selectedAddressType(data.records.address_type_others); @@ -160,7 +159,7 @@ export class AddressComponent implements OnInit { // } this.addressForm.controls.other_premises_bussiness_activity.setValue(data.records.other_premises_bussiness_activity); if(data.records.other_premises_bussiness_activity != '' && data.records.other_premises_bussiness_activity !=null) { - this.addressForm.controls.bussiness_activity_remark.setValue(data.records.other_premises_bussiness_activity); + this.addressForm.controls.bussiness_activity_remark.setValue(data.records.bussiness_activity_remark); } else{ this.addressForm.controls.bussiness_activity_remark.setValue(''); 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 6c622dc6c..5768d1121 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 @@ -260,7 +260,7 @@ - Vintage + Age of Asset in Years @@ -295,6 +295,12 @@ +
+ +
--> -
- -
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 1d0e0f11c..055075397 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 @@ -111,7 +111,7 @@ {{ btLen.lender_name }}
- + @@ -166,6 +166,12 @@ Add More Banking Details
+ +
+ +
-
- -
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 10675856c..81cfbb247 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 @@ -29,7 +29,7 @@ import {ActivatedRoute, Router} from "@angular/router"; }) export class BankingDetailsComponent implements OnInit { pdid: number; - pageTitle: string ="Banking Information"; + pageTitle: string ="Banking Details of Individuals"; public bankingForm: FormGroup; step: number; private notifier: NotifierService; @@ -91,13 +91,13 @@ export class BankingDetailsComponent implements OnInit { this.existCompanyList = data.records.filter(val =>val.is_active===true); } - let modifyCompanyList : any=[]; - if(this.existCompanyList.length>0){ - modifyCompanyList = this.existCompanyList.map(element => { - return {id:element.company_order_id.toString(),name:element.company_name,group_id:1}; - }); - this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) - } + // let modifyCompanyList : any=[]; + // if(this.existCompanyList.length>0){ + // modifyCompanyList = this.existCompanyList.map(element => { + // return {id:element.company_order_id.toString(),name:element.company_name,group_id:1}; + // }); + // this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) + // } }); let modifyApplicantList: any=[]; 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 old mode 100644 new mode 100755 index 240abb48c..3b0febd23 --- 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 @@ -35,9 +35,9 @@
-
+
-
+
@@ -45,10 +45,18 @@ {{ prop.name | titlecase }} - - + + + + Owned + Rented + + + + +
@@ -200,12 +208,12 @@
- + {{"₹"}} {{appxMarketAmtInwords[i]}} Only - + @@ -229,11 +237,9 @@ -->
- - - + - Vintage + Approx Vintage @@ -244,9 +250,9 @@ - - - + + +
@@ -257,13 +263,12 @@
-
-
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss old mode 100644 new mode 100755 index 2f381258f..a1c689d8e --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.scss @@ -14,10 +14,15 @@ ::ng-deep .cdk-global-overlay-wrapper{ justify-content: center !important; } + +.matcard mat-form-field { + margin: 0 2%; +} - mat-form-field { +mat-form-field { margin: 0 2%; - } +} + $base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important; $product-bg-color-hover: rgba(103, 58, 183, 0.7); .p-list-main { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.spec.ts old mode 100644 new mode 100755 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 old mode 100644 new mode 100755 index 5b66497e0..101636fbf --- 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 @@ -16,7 +16,7 @@ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; }) export class BusinessAssetsInfoComponent implements OnInit { - pageTitle: string ="Business Assets"; + pageTitle: string ="Assets used for Business"; pdid:string; public _businessAssetsQuesFrom: FormGroup; @@ -36,6 +36,7 @@ export class BusinessAssetsInfoComponent implements OnInit { AssetValueInwords: any = []; // B_emiAmtInwords: any = []; public m_propertyType = []; + PropertyOwnedType : any = []; // public m_investmentType = []; // public m_freqOfPurchase = []; private notifier: NotifierService; @@ -76,6 +77,7 @@ export class BusinessAssetsInfoComponent implements OnInit { this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'}); this.company_id =this.pd_all_details.company_id; this.notifier = notifier; + this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ; } @@ -228,7 +230,22 @@ export class BusinessAssetsInfoComponent implements OnInit { business_emi: [''], }); } - + selectedPropertyOwnedType(e,s,i){ + + // const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(i).get('business_details') as FormArray ; + if(e == "owned"){ + // console.log('e o',e); + // console.log('s o',s); + // console.log('i o',i); + this.PropertyOwnedType[i] = true; + } + else{ + // console.log('e r',e); + // console.log('s r',s); + // console.log('i r',i); + this.PropertyOwnedType[i] = false; + } + } show: boolean; selectedAssetsType(e: any, i: any): void { let val = i; @@ -287,7 +304,9 @@ export class BusinessAssetsInfoComponent implements OnInit { loadProperty() { return this._formBuilder.group({ property_type: [''], - other_property_type: [''] + other_property_type: [''], + properties_ownership_type : [''], + properties_monthly_rented_amt:[''] }); } @@ -352,7 +371,9 @@ export class BusinessAssetsInfoComponent implements OnInit { loadPropertyWithData(data) { return this._formBuilder.group({ property_type: [data.property_type], - other_property_type: [data.other_property_type] + other_property_type: [data.other_property_type], + properties_ownership_type : [data.properties_ownership_type], + properties_monthly_rented_amt:[data.properties_monthly_rented_amt] //property_type:[''] }); } @@ -477,7 +498,8 @@ export class BusinessAssetsInfoComponent implements OnInit { case '2': { let business_property_datas : any; data.forEach((datas,i) => { - business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type }; + business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type,'properties_ownership_type':datas.properties_ownership_type,'properties_monthly_rented_amt':datas.properties_monthly_rented_amt }; + this.selectedPropertyOwnedType(datas.properties_ownership_type,i,val); }); const control = (this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ; control.push(this.loadPropertyWithData(business_property_datas)); 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 old mode 100644 new mode 100755 index d6a1ecfd0..e321a90e9 --- 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 @@ -42,7 +42,7 @@ {{ btLen.lender_name }} - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.scss old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-banking-details/business-banking-details.component.spec.ts old mode 100644 new mode 100755 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 old mode 100644 new mode 100755 index 41f75395a..404f4f28e --- 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 @@ -61,6 +61,7 @@ export class BusinessBankingDetailsComponent implements OnInit { this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'}); this.notifier = notifier; this.company_id = this.pd_all_details.company_id; + this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ; } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts old mode 100644 new mode 100755 index 8fe05e19e..7080d93b6 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts @@ -38,7 +38,7 @@ export class BusinessInfoGroupComponent implements OnInit { getCompanyListForBusiness(): void{ this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ if(data.dataStatus){ - this.existCompanyList = data.records.filter(val =>val.is_active && val.is_company_applicant===true); + this.existCompanyList = data.records.filter(val =>val.is_active == 1); this.waitLoading = true; } else { 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 68b144034..076ad7106 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 @@ -43,7 +43,7 @@ delete
-
+
@@ -57,11 +57,12 @@
-

No of Years in Current Business

-
+

No of Years in Current Business

+ +
- + {{errorMessage[i]}} @@ -69,20 +70,22 @@ + formControlName="total_business_experiance" (keypress)="keyPress($event)" (keyup)="getWorkExperience(members.value,i)" autocomplete="off" required (change)="checkWithExistTotalWorkExperience($event.target.value,i,members)"> + {{errorMessageForExistTotalWorkExperience[i]}}
-
+
-
+ +
- +
- - + +

Within India

@@ -368,8 +383,8 @@

Export

-
- +
+ Countries Where The Export Is Being Done for {{manufacturing.value.main_products}} @@ -377,8 +392,9 @@ - - + + + @@ -397,23 +413,29 @@
- + - Description of {{manufacturing.value.main_products}} + Description of {{manufacturing.value.main_products}} manufacturing process - + +
+ +
- + @@ -421,13 +443,13 @@ Retail Trading Details - + - + Within India Export Both @@ -499,9 +521,9 @@
-
+
- + Countries Where Export Is Being Done for {{retail.value.main_products}} @@ -511,8 +533,9 @@ - - + + + +
@@ -652,13 +682,13 @@ Wholesale Trade Details - + - + Within India Export Both @@ -730,9 +760,9 @@
-
+
- + Countries Where The Export Is Being Done for {{wholesale.value.main_products}} @@ -740,8 +770,9 @@ - - + + + +
- + @@ -881,13 +919,13 @@ Service Provider Details - + - + Within India Export Both @@ -1087,17 +1125,23 @@ - Description of {{serviceprovider.value.main_products}} + Description of {{serviceprovider.value.main_products}} Service Process - + +
+ +
@@ -1106,25 +1150,31 @@ Other Details - + +
+ +
- + - - + + Export Sale As a % Total Sales @@ -1206,6 +1256,7 @@ +
@@ -1218,6 +1269,13 @@ +
+ + + {{"₹"}} {{appxSalaryAmtInwords}} 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 775d8015c..b435db587 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 @@ -37,6 +37,7 @@ export class BusinessInfoComponent implements OnInit { form_id: number; pageTitle: string ="About Business"; relationData: any = []; + titleData: any = []; companyRelationShipList: any =[]; //industryData: any = []; activityData: any = []; @@ -45,6 +46,7 @@ export class BusinessInfoComponent implements OnInit { relativeNames: any; applicants: any; + EntityTypeFlag : boolean = false; public businessForm: FormGroup; private notifier: NotifierService; // businessEntityTypeList: any=["Private Limited Company","Proprietorship","Partnership","Limited Liability Partnership (LLP)","One Person Company (OPC)","Hindu Undivided Family (HUF)","Society","Cooperative","Trust","Public Ltd Company","Others"] @@ -60,12 +62,15 @@ export class BusinessInfoComponent implements OnInit { maxDate:any; // InvestedAmountInWords:any; public relationSource= new MatTableDataSource(); - displayedColumns = ['family_member_name','relation','relation_to','relationship_with_company','started_business']; + displayedColumns = ['title','family_member_name','relation','relation_to','relationship_with_company','started_business']; generalExistEntityType:string; generalExistEntityType_other:string; generalExistBusinessYear:Number; generalExistBusinessMonth:Number; errorMessage: any = []; + errorMessageForExistTotalWorkExperience:any = []; + ExportFlag: boolean = false; + appxSalaryAmtInwords: any; constructor(notifier: NotifierService, private fb: FormBuilder, @@ -77,7 +82,7 @@ export class BusinessInfoComponent implements OnInit { this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.company_id = this.pd_all_details.company_id; this.company_name = this.pd_all_details.company_name; - this.pageTitle = this.pd_all_details.company_name; + this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ; this.applicants = this.pd_all_details.pdapplicants_detials; this.form_id = 13; this.notifier = notifier; @@ -116,6 +121,7 @@ export class BusinessInfoComponent implements OnInit { this.getCountryDataList(); this.initBusinessForm(); this.getCompanyRelation(); + this.getTitle(); // const Desgn = this.businessForm.controls['designation']; // const Partnr = this.businessForm.controls['partners']; // const otherDoc = this.businessForm.controls['documents']; @@ -565,7 +571,7 @@ export class BusinessInfoComponent implements OnInit { } - public initBusinessForm(): void { + public initBusinessForm(): void { this.businessForm = this.fb.group({ pdid: this.pdid, formid: this.form_id, @@ -573,7 +579,7 @@ export class BusinessInfoComponent implements OnInit { fk_createdby: this.pdid, //industry: [''], seasonality: ['', Validators.compose([Validators.required])], - export_sale_of_total_sales:[], + export_sale_of_total_sales:[''], //month_of_business_run : [''], // peak_period_of_business : [''], //designation: this.fb.array([]), @@ -581,6 +587,7 @@ export class BusinessInfoComponent implements OnInit { employees_total: ['', Validators.compose([Validators.required])], employees_permanent: ['', Validators.compose([Validators.required])], employees_temporary: ['', Validators.compose([Validators.required])], + employees_appx_salary:['', Validators.compose([Validators.required])], officer_total: ['', Validators.compose([Validators.required])], // officer_permanent: ['', Validators.compose([Validators.required])], // officer_temporary: ['', Validators.compose([Validators.required])], @@ -684,14 +691,12 @@ export class BusinessInfoComponent implements OnInit { control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required)); control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([])); control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); - } else if(getDetails.value.area_of_sale=="Export"){ control.controls[getIndex].removeControl('countries_where_export_done'); control.controls[getIndex].removeControl('india_where_sale_done'); control.controls[getIndex].removeControl('pan_india_options'); control.controls[getIndex].removeControl('max_sale_state_name'); - control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()])); } else if(getDetails.value.area_of_sale=="Both") { @@ -786,7 +791,6 @@ export class BusinessInfoComponent implements OnInit { control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required)); control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([])); control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); - } else if(getDetails.value.area_of_sale=="Export"){ control.controls[getIndex].removeControl('countries_where_export_done'); @@ -1039,6 +1043,17 @@ export class BusinessInfoComponent implements OnInit { }) }); } + // get title master + getTitle() { + let master_name = 'TITLES'; + this._pd.getAllMasterDatas(master_name).subscribe(data => { + data.records.forEach(val => { + if (val.isactive == 1) { + this.titleData.push(val); + } + }) + }); + } getCompanyRelation() { let master_name = 'COMPANYRELATIONSHIPS'; @@ -1075,8 +1090,18 @@ export class BusinessInfoComponent implements OnInit { this.businessEntityTypeList.business_entity_type_id = filterList[0].business_entity_type_id==1; this.businessEntityTypeList.business_entity_type_name = filterList[0].business_entity_type_id!=1 ? filterList[0].business_entity_type_name : this.generalExistEntityType_other; this.businessEntityTypeList.section_label = filterList[0].business_entity_type_id!=1 ? filterList[0].section_label : this.generalExistEntityType_other; - - + + // console.log(this.businessEntityTypeList.business_entity_type_id+' , '+this.businessEntityTypeList.business_entity_type_name+' , '+this.businessEntityTypeList.section_label); + // console.log(this.businessForm.controls.partners['controls']); + // console.log(this.businessForm.controls.partners['controls'].length); + // if(this.businessForm.controls.partners['controls'].length > 1) + // { + // console.log('asd'); + // } + + if(this.businessEntityTypeList.business_entity_type_name == 'OPC (One Person Company)' || this.businessEntityTypeList.business_entity_type_name == 'Sole proprietorship'){ + this.EntityTypeFlag = true; + } // data.records.forEach(val => { // this.businessEntityTypeList.push(val); // this.sourceNames[val.business_entity_type_id] = val.section_label @@ -1122,6 +1147,7 @@ export class BusinessInfoComponent implements OnInit { createPersonRelationhip(details: any):FormGroup { return this.fb.group({ other_family_relationship_id: [details.other_family_relationship_id,Validators.required], + family_member_salutation:[details.family_member_salutation], family_member_name: [details.family_member_name,Validators.required], relationship_with_company_id: [details.relationship_with_company_id,Validators.required], relation_to_id: [details.relation_to_id,Validators.required], @@ -1166,33 +1192,71 @@ export class BusinessInfoComponent implements OnInit { addMoreManufacturing() { let manufacturingControl = this.businessForm.controls['manufacturing_activity_details']; manufacturingControl.push(this.createActivity()); + } + deleteManufacturing(findex){ + let manufacturingControl = this.businessForm.controls['manufacturing_activity_details']; + manufacturingControl.removeAt(findex); } // add more retail details addMoreRetail() { let retailControl = this.businessForm.controls['retail_trading_activity_details']; retailControl.push(this.createActivity()); - } + } + + deleteRetail(index) { + let retailControl = this.businessForm.controls['retail_trading_activity_details']; + retailControl.removeAt(index); + } + // add more retail details addMoreWholesale() { let wholesaleControl = this.businessForm.controls['wholesale_trading_activity_details']; wholesaleControl.push(this.createActivity()); - } + } + + deleteWholesale(index) { + let wholesaleControl = this.businessForm.controls['wholesale_trading_activity_details']; + wholesaleControl.removeAt(index); + } + + // add more service provider details addMoreServiceprovider() { let serviceControl = this.businessForm.controls['service_provider_activity_details']; serviceControl.push(this.createServiceActivity()); } + + deleteServiceprovider(index) { + let serviceControl = this.businessForm.controls['service_provider_activity_details']; + serviceControl.removeAt(index); + } + // add more others details addMoreOthersActivity() { let othersControl = this.businessForm.controls['others_activity_details']; othersControl.push(this.createOthersActivity()); } + deleteOthersActivity(index) { + let othersControl = this.businessForm.controls['others_activity_details']; + othersControl.removeAt(index); + } + // update partner group other form control changePartnerGroup(value,key) { let control: any = this.businessForm.get('partners') as FormArray; value=='Others' ? control.controls[key].addControl('partner_other_name', new FormControl('', Validators.required)) : control.controls[key].removeControl('partner_other_name'); } + + // Out of Total Export Sales what % of Sales is done in Albania? + getPlaceHolderName(id){ + let name = this.countryDataList.filter(value=>value.country_id == id); + // console.log(name); + // console.log(name[0].country_name); + // console.log(id); + return 'Out of Total Export Sales what % of Sales is done in '+ name[0].country_name +' ?'; + // return name[0].country_name +'?'; + } // get work experience based on create form control getWorkExperience(event, key) { let current_experience = event.current_business_experiance_year=='' ? 0 : parseInt(event.current_business_experiance_year); @@ -1246,6 +1310,41 @@ export class BusinessInfoComponent implements OnInit { // let family: any = []; // console.log(this.businessForm.value); + + + if(this.EntityTypeFlag == true){ + let control: any = this.businessForm.controls['partners']; + let control2:any = control.controls[0]; + + control2.controls['shareholding'].clearValidators(); + control2.controls['shareholding'].updateValueAndValidity(); + control2.controls['shareholding'].setValue('100'); + + + // control.controls[0].removeControl('shareholding'); + // control.controls[0].removeControl('started_business'); + // control.controls[0].removeControl('current_business_experiance_year'); + // control.controls[0].removeControl('current_business_experiance_month'); + // control.controls[0].removeControl('total_business_experiance'); + + control2.controls['started_business'].setValue(''); + + control2.controls['current_business_experiance_year'].clearValidators(); + control2.controls['current_business_experiance_year'].updateValueAndValidity(); + control2.controls['current_business_experiance_year'].setValue(''); + + control2.controls['current_business_experiance_month'].setValue(''); + + control2.controls['total_business_experiance'].clearValidators(); + control2.controls['total_business_experiance'].updateValueAndValidity(); + control2.controls['total_business_experiance'].setValue(''); + // if(control2.controls['total_business_previous_experience'].value !=undefined){ + // control2.controls['total_business_previous_experience'].clearValidators(); + // control2.controls['total_business_previous_experience'].updateValueAndValidity(); + // control2.controls['total_business_previous_experience'].setValue('0'); + // } + + } if (!this.businessForm.valid) { this.notifier.notify('warning',"Please Check All Manatory Fields.."); @@ -1253,6 +1352,7 @@ export class BusinessInfoComponent implements OnInit { } // let design: any; let records = this.businessForm.value; + // console.log(records); //to check the Appx. sale validation. // this.validateAppxSales(records); @@ -1269,6 +1369,22 @@ export class BusinessInfoComponent implements OnInit { let validationFlag : number = 0; + // let shareHoldValidationFlag : number = 0; + // console.log(records.partners.length); + console.log(records.partners); + + if(records.partners.length > 0){ + let total = records.partners.map(shares => shares.shareholding).reduce((a, b) => a + +b, 0); + if(total > 100){ + this.notifier.notify('warning',"Shareholding is greater than 100%"); + return; + } + } + + // console.log('as'); +// return; + // if(if(parseInt(datas.total_business_experiance) > parseInt(datas.current_business_experiance_year)) {) + // return; //type 1: Checking manufacturing_activity_details if(records.manufacturing_activity_details.length > 0){ @@ -1280,7 +1396,7 @@ export class BusinessInfoComponent implements OnInit { }); let total = ManufacturingArray.reduce((sum, item) => sum + +item.approx_sale, 0); if(total > 100 || total < 100){ - validationFlag++; + this.notifier.notify('warning',"Approximate sales doesn't add upto 100%"); } } }); @@ -1362,7 +1478,7 @@ export class BusinessInfoComponent implements OnInit { otherFamilyMemberDialogue() { let relationControl = this.businessForm.controls['persons_with_relationships']; - let other_family_member: any= {'other_family_relationship_id':'','other_family_relationship_name':'','family_member_name':'','relationship_with_company_id':'','relationship_with_company':'','started_business':'','currently_active_status':''}; + let other_family_member: any= {'other_family_relationship_id':'','other_family_relationship_name':'','family_member_salutation':'','family_member_name':'','relationship_with_company_id':'','relationship_with_company':'','started_business':'','currently_active_status':''}; relationControl.push(this.createPersonRelationhip(other_family_member)); } @@ -1457,13 +1573,87 @@ export class BusinessInfoComponent implements OnInit { checkTotalEmployee(FormData){ this.businessForm.controls['employees_total'].setValue((+FormData.value.employees_permanent ||0)+(+FormData.value.employees_temporary||0)); } - checkWithExistBusinessYear(e,i){ - if(e > this.generalExistBusinessYear){ + checkWithExistBusinessYear(e,i,members){ + + if(+e > this.generalExistBusinessYear){ this.errorMessage[i] = "Higher than Business Vintage"; + members.controls.current_business_experiance_year.setValue(''); } else{ this.errorMessage[i] = ''; } } + checkWithExistTotalWorkExperience(e,i,members){ + + if(+members.value.current_business_experiance_year > +e){ + this.errorMessageForExistTotalWorkExperience[i] = "Total Experience is Lower Than Experience in The Current Company"; + members.controls.total_business_experiance.setValue(''); + } + else{ + this.errorMessageForExistTotalWorkExperience[i] = ''; + } + } +// flag: number = 0; +// CheckExport(e,val){ +// console.log(e); +// console.log(val); +// console.log(this.) +// if(val == 1){ +// e != "Within India" ? +// this.flag++ :this.flag--; +// } +// if(val == 2){ +// e != "Within India" ? +// this.flag++ :this.flag--; +// } +// if(val == 3){ +// e != "Within India" ? +// this.flag++ :this.flag--; +// } +// if(val == 4){ +// e != "Within India" ? +// this.flag++ :this.flag--; +// } +// if(this.flag > 0){ +// this.ExportFlag = true; +// } + +// } + + CheckExport(e,val){ + console.log(e); + console.log(val); + let flag: number = 0; + if(val == 1){ + e != "Within India" ? + flag++ :flag--; + } + if(val == 2){ + e != "Within India" ? + flag++ :flag--; + } + if(val == 3){ + e != "Within India" ? + flag++ :flag--; + } + if(val == 4){ + e != "Within India" ? + flag++ :flag--; + } + if(flag > 0){ + this.ExportFlag = true; + } + + } + + inWords(e,flag){ + switch(flag){ + case 1 : + this.appxSalaryAmtInwords = this._pd.convertNumberToWords(e.target.value); + break; + } + } + + } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html index cba7fb278..92808407e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.html @@ -47,19 +47,25 @@ {{comrelShip.name}} - Not Applicable + + + +
+ Enter Valid Mobile Number. + Enter Valid STD Code Number.   -   + Enter Valid LandLine Number.
@@ -68,9 +74,18 @@ {{ pm.name }} - + +
+
+ No. of Days of Credit Given for Payment Receipt + + + + + +
@@ -134,19 +149,25 @@ {{comrelShip.name}} - Not Applicable + + + +
+ Enter Valid Mobile Number. + Enter Valid STD Code Number.   -   + Enter Valid LandLine Number.
@@ -156,9 +177,18 @@ {{ pm.name }} - + +
+
+ No. of Days of Credit Given for Payment Receipt + + + + + +
@@ -176,7 +206,7 @@
-
@@ -222,19 +252,25 @@ {{comrelShip.name}} - Not Applicable + + + +
+ Enter Valid Mobile Number. + Enter Valid STD Code Number.   -   + Enter Valid LandLine Number.
@@ -243,14 +279,23 @@ {{ pm.name }} - + +
+
+ No. of Days of Credit Given for Payment Receipt + + + + + +
- +
@@ -263,7 +308,7 @@
-
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts index 991802e81..e3b5abf35 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts @@ -81,6 +81,7 @@ export class ClientInfoComponent implements OnInit { this.form_id = 2; this.company_id = this.pd_all_details.company_id; this.notifier = notifier; + this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ; } public viewerOptions: any = { navbar: false, @@ -356,6 +357,7 @@ export class ClientInfoComponent implements OnInit { person_designation:[''], person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], + other_person_designation:[''], }) } else { return this._formBuilder.group({ @@ -369,6 +371,7 @@ export class ClientInfoComponent implements OnInit { person_designation:[records.person_designation || null], person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], + other_person_designation:[records.other_person_designation || null], }) } } @@ -393,11 +396,13 @@ export class ClientInfoComponent implements OnInit { trade_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], trade_product_payment_type: [''], trade_product_frequency_of_purchase: [''], - trade_product_credit_days: [''], + trade_product_credit_days_from: [''], + trade_product_credit_days_to: [''], person_title_name:[''], person_designation:[''], person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], + other_person_designation:[''], }) } else { return this._formBuilder.group({ @@ -407,11 +412,13 @@ export class ClientInfoComponent implements OnInit { trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], trade_product_payment_type: [records.trade_product_payment_type], trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase], - trade_product_credit_days: [records.trade_product_credit_days], + trade_product_credit_days_from: [records.trade_product_credit_days_from], + trade_product_credit_days_to: [records.trade_product_credit_days_to], person_title_name:[records.person_title_name || null], person_designation:[records.person_designation || null], person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], + other_person_designation:[records.other_person_designation || null], }) } } @@ -436,11 +443,13 @@ export class ClientInfoComponent implements OnInit { service_provider_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], service_provider_product_payment_type: [''], service_provider_product_frequency_of_purchase: [''], - service_provider_product_credit_days: [''], + service_provider_product_credit_days_from: [''], + service_provider_product_credit_days_to: [''], person_title_name:[''], person_designation:[''], person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], + other_person_designation:[''], }) } else { return this._formBuilder.group({ @@ -450,11 +459,13 @@ export class ClientInfoComponent implements OnInit { service_provider_product_contact_person_mobile_number: [records.service_provider_product_contact_person_mobile_number,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], service_provider_product_payment_type: [records.service_provider_product_payment_type], service_provider_product_frequency_of_purchase: [records.service_provider_product_frequency_of_purchase], - service_provider_product_credit_days: [records.service_provider_product_credit_days], + service_provider_product_credit_days_from: [records.service_provider_product_credit_days_from], + service_provider_product_credit_days_to: [records.service_provider_product_credit_days_to], person_title_name:[records.person_title_name || null], person_designation:[records.person_designation || null], person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], + other_person_designation:[records.other_person_designation || null], }) } } @@ -528,8 +539,7 @@ export class ClientInfoComponent implements OnInit { data => { if (data.dataStatus) { if(type==1){ - this.companyRelationShipList=data.records.filter(item => item.name != 'Others'); - + this.companyRelationShipList=data.records;// .filter(item => item.name != 'Others'); } if(type==2){ this.titleList=data.records.filter(val=>val.isactive==1); 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 d775926f5..b6aacf511 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 @@ -39,28 +39,28 @@ - + {{types.loan_type_name}} - + {{"₹"}} {{amtInwords[i]}} Only - + {{ btLen.lender_name }} - + - + - + - {{freq.name}} @@ -121,7 +121,7 @@
-
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 da792df83..b94a14eb4 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 @@ -89,79 +89,6 @@ export class CurrentLoanComponent implements OnInit { this.getMasterDetails('FREQUENCY',2); this.getMasterDetails('EXISTINGLOANTYPES',3); this.initCurrentloanForm(); - - this._pd.getAssetsWithLoanFromBusiness(this.pdid).subscribe(data=>{ - // console.log(data); - - if(data.dataStatus == true){ - // console.log(data.record); - this.dataFromAssets = data.record; - if(this.dataFromAssets.length > 0){ - let labelarray : any = []; - - this.dataFromAssets.forEach((val,index) => { - - if(val.business_assets_mode == 1){ - let data; - val.business_details.forEach((v,index) => { - - data = v.any_other_assets; - }); - labelarray[index] = val.business_name_of_the_owner +' - '+ data; - } - if(val.business_assets_mode == 2){ - let data; - val.business_details.forEach((v,index) => { - data = v.property_type_name; - }); - labelarray[index] = val.business_name_of_the_owner +' - '+ data; - } - if(val.business_assets_mode == 3){ - let data; - val.business_details.forEach((v,index) => { - data = v.manufacturer_model_vehicle; - }); - labelarray[index] = val.business_name_of_the_owner +' - '+ data; - } - if(val.business_assets_mode == 4){ - let data; - val.business_details.forEach((v,index) => { - data = v.equipment_manufacturing_description; - }); - labelarray[index] = val.business_name_of_the_owner +' - '+ data; - } - - }); - const control = this.currentLoanForm.controls['loan_details']; - this.labelArr = labelarray; - let arr : any = []; - if(this.labelArr.length > 0){ - this.currentLoanForm.controls['existing_loan'].setValue('Yes'); - this.labelArr.forEach((v,index) => { - arr = { - 'label': v, - 'loan_amount': '', - 'frequency':'', - 'other_frequency':'', - 'emi': '', - 'loan_type': '', - 'others_loan_type': '', - 'loan_taken_by':'', - 'others_loan_taken':'', - 'lender': '', - 'others_lender':'', - 'original_tenure': '', - 'current_balance_tenure': '', - 'elapsed_tenure':'' - } - control.push(this.createLoanDetail(arr)); - }); - // this.currentLoanForm.controls['existing_loan'].setValue(arr); - } - } - } - }); - this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ if(data.dataStatus){ this.existCompanyList = data.records.filter(val =>val.is_active===true); @@ -194,7 +121,7 @@ export class CurrentLoanComponent implements OnInit { // console.log('value', value); const control = this.currentLoanForm.controls['loan_details']; if (value.status == 200) { - +// console.log(value.status); this.currentLoanForm.controls['existing_loan'].setValue(value.records.existing_loan); this.currentLoanForm.controls['currentloan_remarks'].setValue(value.records.currentloan_remarks); @@ -216,9 +143,78 @@ export class CurrentLoanComponent implements OnInit { } } } else { - // console.log('overall else'); - - // control.push(this.createLoanDetail()); + console.log('else part',value.status); + this._pd.getAssetsWithLoanFromBusiness(this.pdid).subscribe(data=>{ + // console.log(data); + + if(data.dataStatus == true){ + // console.log(data.record); + this.dataFromAssets = data.record; + if(this.dataFromAssets.length > 0){ + let labelarray : any = []; + + this.dataFromAssets.forEach((val,index) => { + + if(val.business_assets_mode == 1){ + let data; + val.business_details.forEach((v,index) => { + + data = v.any_other_assets; + }); + labelarray[index] = val.business_name_of_the_owner +' - '+ data; + } + if(val.business_assets_mode == 2){ + let data; + val.business_details.forEach((v,index) => { + data = v.property_type_name; + }); + labelarray[index] = val.business_name_of_the_owner +' - '+ data; + } + if(val.business_assets_mode == 3){ + let data; + val.business_details.forEach((v,index) => { + data = v.manufacturer_model_vehicle; + }); + labelarray[index] = val.business_name_of_the_owner +' - '+ data; + } + if(val.business_assets_mode == 4){ + let data; + val.business_details.forEach((v,index) => { + data = v.equipment_manufacturing_description; + }); + labelarray[index] = val.business_name_of_the_owner +' - '+ data; + } + + }); + const control = this.currentLoanForm.controls['loan_details']; + this.labelArr = labelarray; + let arr : any = []; + if(this.labelArr.length > 0){ + this.currentLoanForm.controls['existing_loan'].setValue('Yes'); + this.labelArr.forEach((v,index) => { + arr = { + 'label': v, + 'loan_amount': '', + 'frequency':'', + 'other_frequency':'', + 'emi': '', + 'loan_type': '', + 'others_loan_type': '', + 'loan_taken_by':'', + 'others_loan_taken':'', + 'lender': '', + 'others_lender':'', + 'original_tenure': '', + 'current_balance_tenure': '', + 'elapsed_tenure':'' + } + control.push(this.createLoanDetail(arr)); + }); + // this.currentLoanForm.controls['existing_loan'].setValue(arr); + } + } + } + }); } }) } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html index 69dee7761..128a726a5 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html @@ -22,13 +22,16 @@
- + {{qual.qualification_name}} + + +
@@ -50,7 +53,7 @@ - - + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts index 21d668228..a6951b0ba 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit, Input, Output, Inject } from '@angular/core'; import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; import { PdTrigerService } from './../../../../../../pd-service/pd-triger.service'; +import { bool } from 'aws-sdk/clients/signer'; @Component({ selector: 'app-other-applicant-details', @@ -11,14 +12,33 @@ import { PdTrigerService } from './../../../../../../pd-service/pd-triger.servic export class OtherApplicantDetailsComponent implements OnInit { pageTitle: string ="Add Name of Person(s) Met and Individual Loan Applicant(s) "; public _OtherForm: FormGroup; - applicantInfo:any={'pd_co_applicant_id':"0",'applicant_name':'','is_applicant':false,'is_person_met':false, applicant_title_name:'',age:'', qualification:''}; + applicantInfo:any={'pd_co_applicant_id':"0",'applicant_name':'','is_applicant':false,'is_person_met':false, applicant_title_name:'',age:'', qualification:'',course_name:''}; titleList: any=[]; qualificationList: any=[]; + EditGeneralFormData: any=[]; + EditFlag: boolean = false; - constructor(private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef) { } + constructor(private _fb: FormBuilder, + private _pd: PdTrigerService, + @Inject(MAT_DIALOG_DATA) public generalFormData : any, + private dialogRef: MatDialogRef) { + if(generalFormData != ''){ + this.EditGeneralFormData = generalFormData.value; + this.EditFlag = true; + } + console.log(this.EditGeneralFormData); + } ngOnInit() { - this.initFormDetails(); + + if(!this.EditFlag){ + console.log('init if',this.EditGeneralFormData); + this.initFormDetails(null); + } + else{ + console.log('init else',this.EditGeneralFormData); + this.initFormDetails(this.EditGeneralFormData); + } this.getMasterDetails('TITLES',1); this.getMasterDetails('EDUQUALIFICATION',2); } @@ -39,14 +59,25 @@ export class OtherApplicantDetailsComponent implements OnInit { } // init form - initFormDetails() { - this._OtherForm = this._fb.group({ - applicant_list: this._fb.array([this.createApplicant(this.applicantInfo)]), - }); -} + initFormDetails(data : any) { + console.log('data',data); + if(data == null){ + console.log('if data',data); + this._OtherForm = this._fb.group({ + applicant_list: this._fb.array([this.createApplicant(this.applicantInfo)]), + }); + } + else{ + console.log('else data',data); + this._OtherForm = this._fb.group({ + applicant_list: this._fb.array([this.updateApplicant(this.EditGeneralFormData)]), + }); + } + } // create applicant form array createApplicant(elementValue:any){ + console.log("create applicants",elementValue); return this._fb.group({ pd_co_applicant_id: [elementValue.pd_co_applicant_id], applicant_title_name: [elementValue.applicant_title_name, Validators.required], @@ -54,7 +85,22 @@ createApplicant(elementValue:any){ is_applicant:[false], is_person_met:[false], age:[''], - qualification: [''] + qualification: [''], + course_name:[''] +}); +} + +updateApplicant(elementValue:any){ + console.log("update applicants",elementValue); + return this._fb.group({ + pd_co_applicant_id: [elementValue.pd_co_applicant_id], + applicant_title_name: [elementValue.applicant_title_name, Validators.required], + applicant_name:[elementValue.applicant_name,Validators.required], + is_applicant:[elementValue.is_applicant ? true : false], + is_person_met:[elementValue.is_person_met ? true : false], + age:[elementValue.age || ''], + qualification: [elementValue.qualification || ''], + course_name:[elementValue.course_name || ''] }); } 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 8fd31e47b..114ea50f9 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 @@ -280,7 +280,7 @@
- + {{person.applicant_name}} @@ -291,30 +291,33 @@
Residence Details
- + {{s.name}} - + {{c.city_name}} - + - + {{p.pincode}} + + + - + @@ -342,8 +345,9 @@ - - + + + {{"₹"}} {{RentAmount[i]}} Only
@@ -72,7 +73,7 @@ - + No difference 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}} @@ -92,8 +93,7 @@
- - + Net Profit Net Loss @@ -105,7 +105,7 @@ {{"₹"}} {{FY_netProfitAmtInwords[i]}} Only - + @@ -115,14 +115,14 @@ {{"₹"}} {{FY_netLossAmtInwords[i]}} Only - +
- + No difference 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}} @@ -140,7 +140,7 @@ - + No difference in Profit sales % in FY {{details.get('financial_year').value}} over Profit sales % in FY {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} @@ -160,7 +160,7 @@
- + @@ -176,7 +176,7 @@ - + Yes No @@ -196,31 +196,41 @@ - + + {{"₹"}} {{AV_SalesFrmInwords[i]}} Only - + + {{"₹"}} {{AV_SalesToInwords[i]}} Only - - + + {{"₹"}} {{AV_SalesInwords[i]}} Only
- + - + Net Profit Net Loss - + + + + Yes + No + + + + -
+
- + - + - - {{"₹"}} {{details.get('estimate_profit_margin').value}} ( {{AV_marginProfitAmtInwords[i]}} Only ) + + {{"₹"}} {{AV_marginProfitAmtInwords[i]}} Only ( {{"₹"}} {{details.get('estimate_profit_margin').value}} )
-
+
- + + {{"₹"}} {{AV_netProfitAmtFrmInwords[i]}} Only - + + {{"₹"}} {{AV_netProfitAmtToInwords[i]}} Only - - ( {{details.get('estimate_net_profit_percent').value }} % ) - + + {{"₹"}} {{AV_netProfitAmtInwords[i]}} Only ( {{details.get('estimate_net_profit_percent').value }} % ) +
- + - -
+ +
- + - + - - {{"₹"}} {{details.get('estimate_Loss_margin').value}} - + + {{"₹"}} {{AV_marginLossAmtInwords[i]}} Only ( {{"₹"}} {{details.get('estimate_loss_margin').value}} ) +
-
+
- + + {{"₹"}} {{AV_netLossAmtFrmInwords[i]}} Only - + + {{"₹"}} {{AV_netLossAmtToInwords[i]}} Only - - ( {{details.get('estimate_net_loss_percent').value }} % ) - + + {{"₹"}} {{AV_netLossAmtInwords[i]}} Only ( {{details.get('estimate_net_loss_percent').value }} % ) + -
+
+
+ + + +
- +
+ + + + Business Use. + Child’s Marriage. + Furniture & Finishing of House Property. + Medical Expenses. + Paying Off Existing Loans. + Others. + + + + + +
@@ -84,9 +97,9 @@ - + @@ -105,17 +118,17 @@

Details of Property being Mortgaged

- + {{ typeprop.property_name }} - + - + @@ -149,7 +162,7 @@ --> - + {{ status.name }} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.scss index a2381ffbc..3bb315cf9 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.scss @@ -18,6 +18,12 @@ margin: 0 2%; width:26%; } + +// ::ng-deep .mat-option{ +// word-wrap: break-word !important; +// white-space: pre-wrap !important; +// } + .address .button { float: right; width: 10px; 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 375560841..02bbdf249 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 @@ -138,13 +138,16 @@ export class LoanDetailsComponent implements OnInit { return {id:element.company_order_id.toString(),name:element.company_name,group_id:1}; }); this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) + this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:[{id:0,name:'Not Yet Finalised',group_id:2}]}) } + let modifyApplicantList: any=[]; if(this.applicants.length > 0){ modifyApplicantList = this.applicants.map(element => { return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2}; }); this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList}) + // this.listOfLanguagues.splice(this.listOfLanguagues.indexOf(languague), 1); } }) @@ -204,9 +207,14 @@ export class LoanDetailsComponent implements OnInit { if (value.records.topup_amount) { this.loanDetailsForm.controls['topup_amount'].setValue(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) { + this.loanDetailsForm.controls['other_end_use_topup'].setValue(value.records.other_end_use_topup); + } + } } - - // this.loanDetailsForm.controls['end_use_topup'].setValue(value.records.end_use_topup); + if (value.records.lender) { this.loanDetailsForm.controls['lender'].setValue(value.records.lender); @@ -237,10 +245,10 @@ export class LoanDetailsComponent implements OnInit { this.loanDetailsForm.controls['other_source'].setValue(value.records.other_source); } - if(value.records.personal_loan_source) { - // this.isPLSource = true; - this.loanDetailsForm.controls['personal_loan_source'].setValue(value.records.personal_loan_source); - } + // if(value.records.personal_loan_source) { + // // this.isPLSource = true; + // this.loanDetailsForm.controls['personal_loan_source'].setValue(value.records.personal_loan_source); + // } } // if (value.records.lender_name_type) { @@ -359,7 +367,8 @@ getM_sourceofamount() { } } }); - + this.m_mortageTypeProperty + // mortage_property_id">{{ typeprop.property_name console.log(this.m_mortageTypeProperty); } }, @@ -429,13 +438,14 @@ getM_sourceofamount() { //is_topup: [''], balance_transfer_amount: [''], topup_amount: [''], - // end_use_topup:[''], + end_use_topup:[''], + other_end_use_topup:[''], lender: [''], other_bt_lender : [''], own_contribution: [''], source: [''], other_source:[''], - personal_loan_source:[''], + // personal_loan_source:[''], //lender_name_type: [''], emi_level: [''], property_type: [''], @@ -465,9 +475,9 @@ getM_sourceofamount() { event.forEach(option => { // let othersData = this.m_endUseofLoad.filter(sub=>sub.subproduct_id==option)[0]; let othersData = this.m_endUseForLoan.filter(sub=>sub.enduse_of_loan_id==option)[0]; - // console.log(othersData); + // console.log('1',othersData); OthersAvaliable = othersData.enduse_of_loan.substr(0,6).toLowerCase(); - // console.log(OthersAvaliable); + // console.log('1',OthersAvaliable); this.endUserList.push({ end_use: option }); }); @@ -488,8 +498,8 @@ getM_sourceofamount() { // this.isOtherSource = (evt.some(e => e == 4) == true) ? true : false ; // this.isPLSource = (evt.some(e => e == 3) == true) ? true : false ; - this.isOtherSource = evt.some(e => e == 4) // this return true or false Only; - this.isPLSource = evt.some(e => e == 3) // this return true or false Only; + this.isOtherSource = evt.some(e => e == 1) // this return true or false Only; + // this.isPLSource = evt.some(e => e == 3) // this return true or false Only; this.sourceList = []; @@ -565,7 +575,15 @@ getM_sourceofamount() { // if (this.loanDetailsForm.controls['is_topup'].value == 'yes') { records.topup_amount = this.loanDetailsForm.controls['topup_amount'].value; // } - // records.end_use_topup = this.loanDetailsForm.controls['end_use_topup'].value; + + if(records.topup_amount > 0){ + records.end_use_topup = this.loanDetailsForm.controls['end_use_topup'].value; + if(records.end_use_topup == 1){ + records.other_end_use_topup = this.loanDetailsForm.controls['other_end_use_topup'].value; + } + } + + if (this.loanDetailsForm.controls['is_transfer'].value == 'yes') { //this.loanDetailsForm.controls['is_topup'].value == 'yes' || records.lender = this.loanDetailsForm.controls['lender'].value; @@ -603,9 +621,9 @@ getM_sourceofamount() { records.other_source = this.loanDetailsForm.controls['other_source'].value; }else{ records.other_source = ''; } - if(this.isPLSource){ - records.personal_loan_source = this.loanDetailsForm.controls['personal_loan_source'].value; - }else{ records.personal_loan_source = ''; } + // if(this.isPLSource){ + // records.personal_loan_source = this.loanDetailsForm.controls['personal_loan_source'].value; + // }else{ records.personal_loan_source = ''; } //records.percentage_of_construction = this.loanDetailsForm.controls['percentage_of_construction'].value; 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 6a3dd6da8..017731376 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 @@ -85,7 +85,6 @@ - +91 Enter Valid STD Code. - @@ -104,7 +103,7 @@ - +

Period of Relationship

@@ -126,7 +125,7 @@
- + 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 e5c4a6ffc..b12374961 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 @@ -10,12 +10,12 @@ import { parse } from 'url'; styleUrls: ['./neighbour-hood.component.scss'] }) export class NeighbourHoodComponent implements OnInit { - pageTitle: string ="Neighbourhood / Reference Check"; + pageTitle: string ="Neighbourhood Check / Reference Check"; public _neighbourhoodForm: FormGroup; pdid : string; form_id:number; private notifier: NotifierService; - check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference Check'}] + check_type:any=[{'id':0,'type_name':'Neighbourhood Check'},{'id':1,'type_name':'Reference Check'}] default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':'','reference_final_remarks':'','positive_remark':'','negative_remark':'','insufficient_info_remark':''}; default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know_in_year':'','how_long_do_know_in_month':'','is_applicant_owner':''}; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html index ef0521e21..47c367d0e 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 @@ -48,7 +48,7 @@ - + @@ -80,7 +80,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html index 7302a038e..cd69f0535 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/rental-info/rental-info.component.html @@ -19,18 +19,18 @@
- + - + Applicant co-applicant Parental - + Residential/commercial other @@ -182,14 +182,14 @@
- + Yes No - + 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 44e08cbbf..76d7e814b 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 @@ -20,11 +20,11 @@ -
Manufacturing Details
+
Manufacturing Stock Details
Raw Material #{{a+1}} @@ -72,18 +72,19 @@ +
+ +
-
- -
+
@@ -148,6 +149,12 @@ +
+ +
--> -
- -
- - -
-
- -
-
- - Traded Goods #{{c+1}} - - - - - - - Add Stock Details - No Stock Observed - - - - - - - - - {{uom.name}} - - - - - - - - {{"₹"}} {{M_tradedGoodsValueInWords[c]}} Only - - - - - - Yes - No - - - - Please comment on the Traded Goods stock level observed? - - - - - - - - -
- -
-
- -
@@ -252,89 +177,16 @@ -
Retail Details
+
-
-
- - Finished Goods #{{d+1}} - - - - - - - Add Stock Details - No stock observed - - - - - - - - - {{uom.name}} - - - - - - - - {{"₹"}} {{R_goodsValueInWords[d]}} Only - - - - - - Yes - No - - - - Please comment on the finished goods stock level observed? - - - - - - - -
- -
-
- -
-
-
-
-
+
+
Retail Trading Details
Traded Goods #{{e+1}} @@ -392,18 +244,18 @@ +
+ +
-
- -
@@ -418,89 +270,13 @@ -
Trading Details
+
-
-
- - Finished Goods #{{f+1}} - - - - - - - Add Stock Details - No Stock Observed - - - - - - - - - {{uom.name}} - - - - - - - - {{"₹"}} {{T_goodsValueInWords[f]}} Only - - - - - - Yes - No - - - - Please comment on the finished goods stock level observed? - - - - - - - - - -
- -
-
- -
-
-
-
-
-
+
Wholesale Trading Details
Traded Goods #{{g+1}} @@ -566,7 +342,7 @@
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 14dc8a6c3..4295b502b 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 @@ -48,10 +48,10 @@ export class StockComponent implements OnInit { // R_financialTradedGoodsValueInWords : any = []; // T_financialTradedGoodsValueInWords : any = []; - rawMaterialAccess: boolean; - finishedGoodsAccess: boolean; - tradeConcernAccess: boolean; - + rawMaterialAccess: Boolean = false; + finishedGoodsAccess: Boolean = false; + tradeConcernAccess: Boolean = false; + serviceAccess: Boolean = false; public submitted = false; noRecordsFound: Boolean = false; serviceProviderForm: Boolean = false; @@ -68,6 +68,7 @@ export class StockComponent implements OnInit { this.form_id = 11; this.company_id = this.pd_all_details.company_id; this.notifier = notifier; + this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ; } public viewerOptions: any = { @@ -91,78 +92,12 @@ export class StockComponent implements OnInit { }; ngOnInit() { - - // this._pd.stockFormsAccess({pd_id:this.pdid}).subscribe(data => { - // if(data.status == 200){ - // this.initstockForms(data.record.type_of_activity); - // } - // }, err => { - // this.notifier.notify('warning', 'There is No Type Of Activity Please Check Bussiness Information.!'); - // }) - // "Manufacturing" - // products - // : - // (2) ["Rwas1", "123"] - // type_of_activity_id - // : - // 2 - //this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe( - // console.log(this.pdid); - // console.log(this.company_id); - + this._pd.stockFormAccess(this.pdid,this.company_id).subscribe(data => { - console.log(data); - console.log(data.record); - // return; if(data.dataStatus == true){ - let tempcount = 0; - - let datas = data.record; - let api = Object.keys(datas).map(function (key) { - return datas[key]; - }); - console.log(api); - if(api.length > 0){ - api.forEach(val => { - if (val.type_of_activity_id == 2) { - if(val.products){ - this.suppliers_raw_materials = val.products; - } - } - if (val.type_of_activity_id == 3) { - if(val.products){ - this.suppliers_finished_goods = val.products; - } - } - if (val.type_of_activity_id == 4) { - if(val.products){ - this.suppliers_trade_details = val.products; - } - } - if (val.type_of_activity_id == 5) { - if(val.products){ - this.suppliers_service_product = val.products; - } - console.log(this.suppliers_service_product); - } - tempcount++; - }); - // console.log('tempcount',tempcount); - if(tempcount>0){ - this.initstockForms(datas); - } - else{ - this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id ); - this.noRecordsFound = false; - } - - - } - else{ - this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id ); - this.noRecordsFound = false; - } - }else if(data.dataStatus == false) + this.initstockForms(data.record); + } + else if(data.dataStatus == false) { this.notifier.notify('warning', 'Fill Business Form First! / No Company Found at this ID '+ this.company_id ); this.noRecordsFound = false; @@ -182,20 +117,12 @@ export class StockComponent implements OnInit { } public initstockForms(record){ - // console.log(record); -// {: 2, name: "Manufacturing", products: Array(2)} -// 1 -// : -// {type_of_activity_id: 3, name: "Retail trading", products: Array(1)} -// 2 -// : -// {type_of_activity_id: 4, name: "Wholesale Trade", products: Array(1)} -// 3 -// : -// {type_of_activity_id: 5, name: "Service Provider", products: Array(1)} - - - + + let api = Object.keys(record).map(function (key) { + return record[key]; + }); + + let params: any = {}; params.pd_id = this.pdid; params.pd_form_id = this.form_id; @@ -209,43 +136,49 @@ export class StockComponent implements OnInit { formid: [this.form_id], company_id: [this.company_id], stock_remarks: [''], - manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]), - retail_details : this.fb.array([this.retailFormCreation(record)]), - trade_details: this.fb.array([this.tradingFormCreation(record)]), + manufacturing_details: this.fb.array([this.manufacturingFormCreation(api)]), + retail_details : this.fb.array([this.retailFormCreation(api)]), + trade_details: this.fb.array([this.tradingFormCreation(api)]), }); - let arr = record.filter(data => data.type_of_activity_id == 2); - if(arr.length > 0) { - 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); - } - - let arr1 = record.filter(data => data.type_of_activity_id == 3); - if(arr1.length > 0) { - let retail_temparr = []; - retail_temparr['retail_traded_goods'] = dataForm.retail_details[0].retail_traded_goods; - retail_temparr['retail_finished_goods'] = dataForm.retail_details[0].retail_finished_goods; - this.initRetailDetails(retail_temparr); - } - - let arr2 = record.filter(data => data.type_of_activity_id == 4); - if(arr2.length > 0) { + + if(api.length > 0){ + api.forEach(val => { + if (val.type_of_activity_id == 2) { + if(val.products){ + 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; + this.initManufacturingDetails(manufacturing_temparr); + } + } + if (val.type_of_activity_id == 3) { + if(val.products){ + let retail_temparr = []; + retail_temparr['retail_traded_goods'] = dataForm.retail_details[0].retail_traded_goods; + this.initRetailDetails(retail_temparr); + } + } + if (val.type_of_activity_id == 4) { + if(val.products){ let trading_temparr = []; - trading_temparr['trading_finished_goods'] = dataForm.trade_details[0].trading_finished_goods; trading_temparr['trading_traded_goods'] = dataForm.trade_details[0].trading_traded_goods; this.initTradingDetails(trading_temparr); + } + } + if (val.type_of_activity_id == 5) { + if(val.products){ + this.serviceProviderForm = true; + } + + } + + }); + this.noRecordsFound = true; } - let arr3 = record.filter(data => data.type_of_activity_id == 5); - if(arr3.length > 0) { - this.serviceProviderForm = true; - } - this.noRecordsFound = true; } else{ - // console.log('dataForm',dataForm); + this.stockForms = this.fb.group({ pdid: [this.pdid], formid: [this.form_id], @@ -255,34 +188,38 @@ export class StockComponent implements OnInit { retail_details : this.fb.array([this.retailFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]), }); - let arr = record.filter(data => data.type_of_activity_id == 2); - if(arr.length > 0) { - this.initManufacturingDetails(null); + + if(api.length > 0){ + api.forEach(val => { + if (val.type_of_activity_id == 2) { + if(val.products){ + this.suppliers_raw_materials = val.products; + this.initManufacturingDetails(null); + } } - let arr1 = record.filter(data => data.type_of_activity_id == 3); - if(arr1.length > 0) { - this.initRetailDetails(null); + if (val.type_of_activity_id == 3) { + if(val.products){ + this.suppliers_finished_goods = val.products; + this.initRetailDetails(null); + } } - let arr2 = record.filter(data => data.type_of_activity_id == 4); - if(arr2.length > 0) { + if (val.type_of_activity_id == 4) { + if(val.products){ + this.suppliers_trade_details = val.products; this.initTradingDetails(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.suppliers_finished_goods - // this.suppliers_trade_details = value.records.trade_details[0].trading_products; - // this.initTradingDetails(null); - // } - // else{ - // this.initTradingDetails(null); - // } - // }); + } } - let arr3 = record.filter(data => data.type_of_activity_id == 5); - if(arr3.length > 0) { - this.serviceProviderForm = true; - } - this.noRecordsFound = true; + if (val.type_of_activity_id == 5) { + if(val.products){ + this.suppliers_service_product = val.products; + this.serviceProviderForm = true; + } + + } + + }); + this.noRecordsFound = true; + } } } else { @@ -295,59 +232,40 @@ export class StockComponent implements OnInit { retail_details : this.fb.array([this.retailFormCreation(record)]), trade_details: this.fb.array([this.tradingFormCreation(record)]), }); - let arr = record.filter(data => data.type_of_activity_id == 2); - if(arr.length > 0) { - // 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 == 3); - if(arr1.length > 0) { - // this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { - // if(value.status == 200){ - // this.suppliers_finished_goods = value.records.trade_details[0].trading_products; - // // value.records.manufacturing_details[0].main_raw_materials; - // this.initRetailDetails(null); - // } - // else{ - this.initRetailDetails(null); - // } - // }); - - } - let arr2 = record.filter(data => data.type_of_activity_id == 4); - if(arr2.length > 0) { - // this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { - // if(value.status == 200){ - // this.suppliers_trade_details = value.records.trade_details[0].trading_products; - - // } - // else{ - this.initTradingDetails(null); - // } - - // this.initTradingDetails(null); - } - let arr3 = record.filter(data => data.type_of_activity_id == 5); - if(arr3.length > 0) { - this.serviceProviderForm = true; - } - this.noRecordsFound = true; + if(api.length > 0){ + api.forEach(val => { + if (val.type_of_activity_id == 2) { + if(val.products){ + this.suppliers_raw_materials = val.products; + this.initManufacturingDetails(null); + } + } + if (val.type_of_activity_id == 3) { + if(val.products){ + this.suppliers_finished_goods = val.products; + this.initRetailDetails(null); + } + } + if (val.type_of_activity_id == 4) { + if(val.products){ + this.suppliers_trade_details = val.products; + this.initTradingDetails(null); + } + } + if (val.type_of_activity_id == 5) { + if(val.products){ + this.suppliers_service_product = val.products; + this.serviceProviderForm = true; + } + + } + + }); + this.noRecordsFound = true; + } + this.noRecordsFound = true; } }) - - // this.stockForms = this.fb.group({ - // stock_remarks: [''], - // raw_materials: this.fb.array([]), - // finished_goods: this.fb.array([]), - // traded_goods: this.fb.array([]) - // }); } manufacturingForm: Boolean = false; @@ -358,9 +276,7 @@ export class StockComponent implements OnInit { return this.fb.group({ manufacturing_raw_materials: this.fb.array([]), manufacturing_finished_goods: this.fb.array([]), - manufacturing_traded_goods: this.fb.array([]) }) - // } } else { return; } @@ -373,7 +289,6 @@ retailFormCreation(val) { if (arr.length > 0) { this.retailForm = true; return this.fb.group({ - retail_finished_goods: this.fb.array([]), retail_traded_goods: this.fb.array([]) }) // } @@ -388,7 +303,6 @@ tradingFormCreation(val) { if (arr.length > 0) { this.tradingForm = true; return this.fb.group({ - trading_finished_goods: this.fb.array([]), trading_traded_goods: this.fb.array([]) }); } else { @@ -406,11 +320,10 @@ 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']; if(datas === null){ - console.log('sdzsgfasdfasddfasdf'); - console.log(this.suppliers_raw_materials); + + if(this.suppliers_raw_materials.length > 0){ this.suppliers_raw_materials.forEach(val => { let Ref_RawMaterials : any = {'raw_name': val, @@ -446,32 +359,11 @@ tradingFormCreation(val) { finishedGoods.push(this.createGoods(null)); } - if(this.suppliers_trade_details.length > 0){ - this.suppliers_trade_details.forEach(val => { - let Ref_Trade_Goods : any = { - 'traded_goods_name': val, - 'traded_goods_observed': '', - 'traded_goods_quantity': '', - 'traded_goods_uom': '', - 'traded_goods_other_uom': '', - 'estimated_traded_goods_value': '', - 'is_sufficiant_traded_goods': '', - 'traded_goods_remarks':''}; - tradedGoods.push(this.createTradedGoods(Ref_Trade_Goods)); - }); - } - else{ - tradedGoods.push(this.createTradedGoods(null)); - } - } else { - // console.log(305,'else') - // console.log(377,datas); - // console.log(datas.manufacturing_raw_materials); + if(datas.manufacturing_raw_materials != undefined){ for (let val of datas.manufacturing_raw_materials) { - // 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); @@ -484,7 +376,6 @@ tradingFormCreation(val) { } if(datas.manufacturing_finished_goods != undefined){ for (let val of datas.manufacturing_finished_goods) { - // 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); @@ -496,28 +387,13 @@ tradingFormCreation(val) { else{ finishedGoods.push(this.createGoods(null)); } - if(datas.manufacturing_traded_goods !== undefined){ - for (let val of datas.manufacturing_traded_goods) { - // 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)); - - } - } - else{ - tradedGoods.push(this.createTradedGoods(null)); - } - // console.log(310,rawMaterial); } } createRawmaterial(records) { - // console.log(330,'function in'); + if(records === null) { - // console.log(331,'fif'); + return this.fb.group({ raw_name: [''], stock_observed:[''], @@ -530,7 +406,7 @@ tradingFormCreation(val) { rawmaterial_remarks:[''] }) } else { - // console.log(343,'else'); + return this.fb.group({ manufacturing_raw_material_name: [records.manufacturing_raw_material_name || null], raw_name: [records.raw_name], @@ -548,32 +424,13 @@ tradingFormCreation(val) { initRetailDetails(datas) { - const finishedGoods = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods']; const tradedGoods = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; if(datas === null){ - // finishedGoods.push(this.createGoods(null)); - if(this.suppliers_finished_goods.length > 0){ - // for (let val of this.suppliers_finished_goods) { - this.suppliers_finished_goods.forEach(val => { - let Ref_Finished_Goods : any = {'goods_name': val, - 'goods_observed': '', - 'goods_quantity': '', - 'goods_uom': '', - 'goods_other_uom': '', - 'goods_value': '', - 'is_sufficiant_goods': '', - 'finishedgoods_remarks':''}; - finishedGoods.push(this.createGoods(Ref_Finished_Goods)); - }); - } - else{ - finishedGoods.push(this.createGoods(null)); - } - if(this.suppliers_trade_details.length > 0){ - console.log(this.suppliers_trade_details); + this.rawMaterialAccess = true; + this.suppliers_trade_details.forEach(val => { let Ref_Trade_Goods : any = { 'traded_goods_name': val, @@ -592,27 +449,9 @@ tradingFormCreation(val) { } } else { - //console.log(479,datas.retail_finished_goods); - if(datas.retail_finished_goods != undefined){ - for (let val of datas.retail_finished_goods) { - // console.log(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)); - - } - } - else{ - finishedGoods.push(this.createGoods(null)); - } - - //console.log(495,datas.retail_traded_goods); if(datas.retail_traded_goods !== undefined){ for (let val of datas.retail_traded_goods) { - // 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); @@ -684,31 +523,9 @@ tradingFormCreation(val) { } initTradingDetails(datas) { - - const finishedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods']; - const tradedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods']; - + const tradedGoods = this.stockForms.controls['trade_details']['controls'][0].controls['trading_traded_goods']; if(datas === null){ - // finishedGoods.push(this.createGoods(null)); - // tradedGoods.push(this.createTradedGoods(null)); - if(this.suppliers_finished_goods.length > 0){ - // for (let val of this.suppliers_finished_goods) { - this.suppliers_finished_goods.forEach(val => { - let Ref_Finished_Goods : any = {'goods_name': val, - 'goods_observed': '', - 'goods_quantity': '', - 'goods_uom': '', - 'goods_other_uom': '', - 'goods_value': '', - 'is_sufficiant_goods': '', - 'finishedgoods_remarks':''}; - finishedGoods.push(this.createGoods(Ref_Finished_Goods)); - }); - } - else{ - finishedGoods.push(this.createGoods(null)); - } if(this.suppliers_trade_details.length > 0){ // for (let val of this.suppliers_trade_details) { @@ -730,31 +547,10 @@ tradingFormCreation(val) { } } else { - // for (let val of datas) { - - // finishedGoods.push(this.createGoods(val.trading_finished_goods)); - // tradedGoods.push(this.createTradedGoods(val.trading_traded_goods)); - - // } - if(datas.trading_finished_goods !==undefined) - { - for (let val of datas.trading_finished_goods) { - // 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)); - - } - } - else{ - finishedGoods.push(this.createGoods(null)); - } if(datas.trading_traded_goods !==undefined) { for (let val of datas.trading_traded_goods) { - // 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); @@ -827,14 +623,10 @@ tradingFormCreation(val) { break; } case 2: { - const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods']; - control.push(this.createGoods(null)); break; } case 3: { - const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods']; - control.push(this.createGoods(null)); - break; + break; } default: { break; @@ -849,13 +641,9 @@ tradingFormCreation(val) { break; } case 2: { - const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_finished_goods']; - control.removeAt(index); break; } case 3: { - const control = this.stockForms.controls['trade_details']['controls'][0].controls['trading_finished_goods']; - control.removeAt(index); break; } default: { @@ -868,16 +656,10 @@ tradingFormCreation(val) { } addTradedGoods(flag) { - // const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - // //const control = this.stockForms.controls['traded_goods']; - - // control.push(this.createTradedGoods(null)); switch(flag){ case 1: { - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - control.push(this.createTradedGoods(null)); break; - } + } case 2: { const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; control.push(this.createTradedGoods(null)); @@ -895,11 +677,9 @@ tradingFormCreation(val) { } deleteTradedGoods(index,flag) { switch(flag){ - case 1: { - const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; - control.removeAt(index); + case 1:{ break; - } + } case 2: { const control = this.stockForms.controls['retail_details']['controls'][0].controls['retail_traded_goods']; control.removeAt(index); @@ -915,7 +695,6 @@ tradingFormCreation(val) { } } - //const control = this.stockForms.controls['manufacturing_details']['controls'][0].controls['manufacturing_traded_goods']; //const control = this.stockForms.controls['traded_goods']; } @@ -930,8 +709,7 @@ tradingFormCreation(val) { // return; // } else { var answerFormValues = this.stockForms.value; -console.log(answerFormValues); -// return; + //To Remove The "Null" With Key also Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html index 6fec2b84d..57b72e300 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.html @@ -42,32 +42,45 @@ {{comrelShip.name}} - Not Applicable + + + +
- + Enter Valid Mobile Number. + Enter Valid STD Code Number.   -   + Enter Valid LandLine Number.
- + + {{ pm.name }} - - +
+ +
+ No.of days of Credit Provided by Supplier + + -
+ + + +
@@ -126,20 +139,26 @@ {{comrelShip.name}} - Not Applicable + + + +
+ Enter Valid Mobile Number. + Enter Valid STD Code Number.   -   + Enter Valid LandLine Number.
@@ -148,10 +167,20 @@ {{ pm.name }} - +
+ +
+ No.of days of Credit Provided by Supplier + + + + + + +
+
@@ -168,7 +197,7 @@
-
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts index 3a056c536..1b19f75b9 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts @@ -54,6 +54,7 @@ export class SupplierInfoComponent implements OnInit { this.form_id = 1; this.company_id = this.pd_all_details.company_id this.notifier = notifier; + this.pageTitle = this.pd_all_details.company_name + ' - ' +this.pageTitle ; } public viewerOptions: any = { @@ -266,10 +267,12 @@ export class SupplierInfoComponent implements OnInit { manufacturing_supplier_name: [''], person_title_name:[''], person_designation:[''], + other_person_designation:[''], manufacturing_contact_person_name: [''], manufacturing_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], manufacturing_payment_type: [''], - manufacturing_credit_days: [''], + manufacturing_credit_days_from: [''], + manufacturing_credit_days_to:[''], manufacturing_frequency_of_purchase: [''], person_stdcode:['', Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:['', Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], @@ -281,10 +284,12 @@ export class SupplierInfoComponent implements OnInit { manufacturing_supplier_name: [records.manufacturing_supplier_name || null], person_title_name:[records.person_title_name || null], person_designation:[records.person_title_name || null], + other_person_designation:[records.other_person_designation || null], manufacturing_contact_person_name: [records.manufacturing_contact_person_name || null], manufacturing_contact_person_mobile_number: [records.manufacturing_contact_person_mobile_number || null,Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], manufacturing_payment_type: [records.manufacturing_payment_type || null], - manufacturing_credit_days: [records.manufacturing_credit_days || null], + manufacturing_credit_days_from: [records.manufacturing_credit_days_from || null], + manufacturing_credit_days_to:[records.manufacturing_credit_days_to || null], manufacturing_frequency_of_purchase: [records.manufacturing_frequency_of_purchase || null], person_stdcode:[records.person_stdcode || null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:[records.person_landline || null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], @@ -309,20 +314,23 @@ export class SupplierInfoComponent implements OnInit { trade_product_name: [''], trade_supplier_name: [''], person_title_name:[''], - person_designation:[], + person_designation:[''], + other_person_designation:[''], trade_product_contact_person_name: [''], trade_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], person_stdcode:[null, Validators.compose([Validators.minLength(3),Validators.maxLength(5),Validators.pattern('^[0-9]*$')])], person_landline:[null, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], trade_product_payment_type: [''], trade_product_frequency_of_purchase: [''], - trade_product_credit_days: [''], + trade_product_credit_days_from: [''], + trade_product_credit_days_to: [''], }) } else { return this._formBuilder.group({ trade_product_name: [records.trade_product_name], person_title_name:[records.person_title_name], person_designation:[records.person_designation], + other_person_designation:[records.other_person_designation], trade_supplier_name: [records.trade_supplier_name], trade_product_contact_person_name: [records.trade_product_contact_person_name], trade_product_contact_person_mobile_number: [records.trade_product_contact_person_mobile_number, Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], @@ -330,7 +338,8 @@ export class SupplierInfoComponent implements OnInit { person_landline:[records.person_landline, Validators.compose([Validators.minLength(6),Validators.maxLength(8),Validators.pattern('^[0-9]*$')])], trade_product_payment_type: [records.trade_product_payment_type], trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase], - trade_product_credit_days: [records.trade_product_credit_days], + trade_product_credit_days_from: [records.trade_product_credit_days_from], + trade_product_credit_days_to: [records.trade_product_credit_days_to], }) } } @@ -365,7 +374,8 @@ export class SupplierInfoComponent implements OnInit { data => { if (data.dataStatus) { if(type==1){ - this.companyRelationShipList=data.records.filter(item => item.name != 'Others'); + this.companyRelationShipList=data.records; + // .filter(item => item.name != 'Others'); } if(type==2){ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html index f4d24683e..d64492d12 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html @@ -33,3 +33,4 @@ + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index e64e6747a..0597ae47a 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -20,7 +20,7 @@ {{master.pd_status | titlecase}} QC Completed    - +
{{master.pd_allocated_to | titlecase}} @@ -98,7 +98,7 @@
- {{master.addressline1}},
{{master.city_name}},
{{master.state_name}}-{{master.pincode}}
+ {{master.addressline1}},
{{master.city_name}},
{{master.state_name}}-{{master.pincode_id == 1 ? master.other_pincode : master.pincode }}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index 29f23fbed..ee6f765b0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -134,6 +134,7 @@ export class ViewPdComponent implements OnInit, OnDestroy { if (data.status == 200) { let masterData: any = data.records.pd_master_details; this.pdMasterData.push(masterData[0]); + console.log('this.pdMasterData',this.pdMasterData); this.mandatoryFieldsValidations = masterData[1].mandatory_fields; this.pd_QC_Rating = Number(this.pdMasterData.qc_rating); this.pdApplicantData= data.records.applicants_details; diff --git a/ng6-seed/src/app/personal-discussion/pd-pipes/search-relation.pipe.spec.ts b/ng6-seed/src/app/personal-discussion/pd-pipes/search-relation.pipe.spec.ts old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/personal-discussion/pd-pipes/search-relation.pipe.ts b/ng6-seed/src/app/personal-discussion/pd-pipes/search-relation.pipe.ts old mode 100644 new mode 100755 diff --git a/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-list-tat.component.html b/ng6-seed/src/app/settings/entity/entity-edit/entity-edit-tat/entity-edit-list-tat.component.html old mode 100644 new mode 100755