diff --git a/ng6-seed/sineedge_prod_080319_3.zip b/ng6-seed/sineedge_prod_080319_3.zip new file mode 100644 index 000000000..4c0422448 Binary files /dev/null and b/ng6-seed/sineedge_prod_080319_3.zip differ 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 69fba04bc..8577828eb 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 @@ -59,12 +59,12 @@ export class EditPdMasterComponent implements OnInit { ngOnInit() { // this.draftStatus="DRAFT"; // this.PDTriggerStatus="TRIGGERED"; + this.getCustomerSegmentList(); this.getLenderList(); this.getProductsList(); - this.getCustomerSegmentList(); this.getStateCityList(); this.getPDTypeList(); - this.getAddresses(); + // this.getAddresses(); this.loadFormData(); this.applicantLength=this.data.applicantLength; } @@ -87,10 +87,15 @@ export class EditPdMasterComponent implements OnInit { this._EditPDtriggerForm.controls.pd_branch_id.setValue(null); } - getAddresses(){ - - } - + + getCustomerSegmentList(){ + this._pd.getCustomersDetails().subscribe( + data => { + if (data.status == 200) { + this.customerSegmentAllList=data.records + } + }, error => this.errorMessage = error); + } getProductsList(){ this._pd.getProductsDetails().subscribe( @@ -103,14 +108,7 @@ export class EditPdMasterComponent implements OnInit { } }, error => this.errorMessage = error); } - getCustomerSegmentList(){ - this._pd.getCustomersDetails().subscribe( - data => { - if (data.status == 200) { - this.customerSegmentAllList=data.records - } - }, error => this.errorMessage = error); - } + // getStateCityList(){ // this._pd.getStateCityDetails().subscribe( // data => { @@ -203,8 +201,6 @@ export class EditPdMasterComponent implements OnInit { } this.getCityList(val.fk_state,index); this.getPincode(val.pincode_id,index); - - console.log('this.addressesList.length',this.addressesList.length); this.addressesDeactivited[this.addressesList.length] = true; addressesArray.push(this.createAddresses(obj)); }); @@ -226,16 +222,13 @@ export class EditPdMasterComponent implements OnInit { //get sub product list based on prokduct id getSubproductList(productID:string){ this.customerSegmentList=this.customerSegmentAllList; - console.log('this.customerSegmentAllList',this.customerSegmentAllList); if(productID != '4'){ - console.log('if',this.customerSegmentList); this.subProductList= this.productList.filter(item => item.product_id == productID); this.subProductList=this.subProductList[0].subproducts; } if(productID == '4'){ let filtered = this.customerSegmentAllList.filter(s => (s.customer_segment).includes('Self')); this.customerSegmentList = filtered; - console.log('else',this.customerSegmentList); } } @@ -436,7 +429,6 @@ export class EditPdMasterComponent implements OnInit { return; } else{ - // console.log('my_array.addresses',my_array.addresses); let filteredAddressesdata = my_array.addresses.filter(item => item.isactive == 1); let lenderMasterArray = { "pd_id": my_array.pd_id, diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html index f27e3f116..12390f9c0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html @@ -38,19 +38,19 @@ Declared_by_customer - {{element.declared_by_customer}} + {{element.declared_by_customer.toFixed(2)}} As Derived from Item Wise Sales - {{element.derived_item_wise}} + {{element.derived_item_wise.toFixed(2)}} As Derived from Kuchha Sales Book/Bills - {{element.derived_sales_book}} + {{element.derived_sales_book.toFixed(2)}} 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 a38af0d33..bebd66f50 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 @@ -1770,10 +1770,10 @@ CheckExport(value,stringFlag,index){ const childControl = parentControl.controls[0]; if(!this.ManufacturingUnChecked){ - if(stringFlag == 'MActivity' && value != "Within India"){ + if(stringFlag == 'MActivity' && value == "Both"){ this.ManufacturingCounterArray[index] = 1; } - else if(stringFlag == 'MActivity' && value == "Within India"){ + else if(stringFlag == 'MActivity' && value != "Both"){ this.ManufacturingCounterArray[index] = 0; } }else if (this.ManufacturingUnChecked && stringFlag == 'MActivity'){ @@ -1781,10 +1781,10 @@ CheckExport(value,stringFlag,index){ } if(!this.RetailedUnChecked){ - if(stringFlag == 'RActivity' && value != "Within India"){ + if(stringFlag == 'RActivity' && value == "Both"){ this.RetailCounterArray[index] = 1; } - else if(stringFlag == 'RActivity' && value == "Within India"){ + else if(stringFlag == 'RActivity' && value != "Both"){ this.RetailCounterArray[index] = 0; } } @@ -1793,10 +1793,10 @@ CheckExport(value,stringFlag,index){ } if(!this.WholeSalesUnChecked){ - if(stringFlag == 'WActivity' && value != "Within India"){ + if(stringFlag == 'WActivity' && value == "Both"){ this.WholeSaleCounterArray[index] = 1; } - else if(stringFlag == 'WActivity' && value == "Within India"){ + else if(stringFlag == 'WActivity' && value != "Both"){ this.WholeSaleCounterArray[index] = 0; } } @@ -1806,11 +1806,11 @@ CheckExport(value,stringFlag,index){ if(!this.ServiceUnChecked){ - if(stringFlag == 'SPActivity' && value != "Within India") + if(stringFlag == 'SPActivity' && value == "Both") { this.ServiceCounterArray[index] = 1; } - else if(stringFlag == 'SPActivity' && value == "Within India"){ + else if(stringFlag == 'SPActivity' && value != "Both"){ this.ServiceCounterArray[index] = 0; } }else if(stringFlag == 'SPActivity' && this.ServiceUnChecked){ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts index 19e51a7d4..55cf81097 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.ts @@ -362,45 +362,37 @@ export class FamilyDetailsComponent implements OnInit { } selectedPerson(e,inx){ - console.log('1)','e',e,'index',inx); + this.FamilyMemberAsLabel[inx] = this.selectPerson.filter(item => item.pd_co_applicant_id == e)[0].applicant_name; - console.log('2)','this.FamilyMemberAsLabel[inx]',this.FamilyMemberAsLabel[inx]); + const control = this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details; let newControlLength: number; let oldControlLength: number = control.length; + let index: number = 0; if(this.apiFamilyMembers.length>0){ - let arraydata : any; + let arraydata : any; let data = this.apiFamilyMembers.filter(item => item.relation_to == e); - console.log('3)','data',data); - // data_gets_from:'GeneralForm' - // data_gets_from:'BusinessForm' - if(data.length > 0){ - - + newControlLength = data.length; - let index: number = 0; while(index < oldControlLength) { - control.removeAt(index); - index++; + control.removeAt(index); + index++; } oldControlLength = newControlLength - - + data.forEach((val,inx) => { - console.log('b4 this.isReadOnly[inx]',this.isReadOnly[inx],val.age); - // family_member_earning_status + if(val.age){ - this.isReadOnly[inx] = true; + // this.isReadOnly[inx] = true; }else{ - this.isReadOnly[inx] = false; + // this.isReadOnly[inx] = false; } - console.log('aftr this.isReadOnly[inx]',this.isReadOnly[inx],val.age); arraydata = { 'family_member_name' : val.name, 'family_member_relationship' : val.relationship, @@ -417,24 +409,22 @@ export class FamilyDetailsComponent implements OnInit { 'non_earning_if_schoolorcollege': '' } control.push(this.initgenerateFamilyMembersDetailsGet(arraydata)); - }); } else{ - let index: number = 0; + newControlLength = 1; while(index < oldControlLength) { - control.removeAt(index); - index++; + control.removeAt(index); + index++; } - oldControlLength = 1; + oldControlLength = newControlLength; control.push(this.generateFamilyMembersDetailsGet()); } } else{ - control.push(this.generateFamilyMembersDetailsGet()); } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts index 90f55cd0e..090ff720d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts @@ -286,12 +286,12 @@ export class FinancialInfoComponent implements OnInit { estimate_net_loss_percent:[''], estimate_net_loss:[''], estimate_reason_for_loss:[''], - estimate_receive_the_money_in_days:[''], - estimate_pay_the_money_in_days:[''], - estimate_unsold_stock_lies_in_days:[''], - estimate_working_capital_facilities_availed:[''], - reason_for_working_capital_facilities_availed:[''], - is_there_working_capital_available:[''] + // estimate_receive_the_money_in_days:[''], + // estimate_pay_the_money_in_days:[''], + // estimate_unsold_stock_lies_in_days:[''], + // estimate_working_capital_facilities_availed:[''], + // reason_for_working_capital_facilities_availed:[''], + // is_there_working_capital_available:[''] }); } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts index f901f5362..f22f71483 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts @@ -601,39 +601,55 @@ export class GeneralInfoComponent implements OnInit { } // submit form details + temp : number = 0; submitGeneralForm(formData: any) { if(this.customer_segment_abbr != 'SE-RI'){ this._generalForm.controls['rental_income_rcv_in_years'].clearValidators(); this._generalForm.controls['rental_income_rcv_in_years'].updateValueAndValidity(); } - // 0th index of companies formArray only - required removed - // greater than zero means not applicable here - if(this.customer_segment_abbr == 'SE-RI'){ - let otherControl: any = this._generalForm.get('companies') as FormArray; - otherControl = otherControl.controls[0]; - // otherControl.controls.business_entity_type_other.clearValidators(); - // otherControl.controls.business_entity_type_other.updateValueAndValidity(); + // 0th index of companies formArray only - required removed + // greater than zero means not applicable here + if(this.customer_segment_abbr == 'SE-RI'){ + let otherControl: any = this._generalForm.get('companies') as FormArray; + otherControl = otherControl.controls[0]; + // otherControl.controls.business_entity_type_other.clearValidators(); + // otherControl.controls.business_entity_type_other.updateValueAndValidity(); - otherControl.controls.business_years.clearValidators(); - otherControl.controls.business_years.updateValueAndValidity(); + otherControl.controls.business_years.clearValidators(); + otherControl.controls.business_years.updateValueAndValidity(); - otherControl.controls.business_entity_type.clearValidators(); - otherControl.controls.business_entity_type.updateValueAndValidity(); + otherControl.controls.business_entity_type.clearValidators(); + otherControl.controls.business_entity_type.updateValueAndValidity(); - } + } + // console.log(formData.individuals.length); + // console.log(formData.individuals); + + + if (this._generalForm.invalid) { this.disableAfterSubmit = false; this.validateAllFormFields(this._generalForm); this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); return; } - // else if(formData.applicant_relation.length==0){ - - // this.notifier.notify('warning', 'Please Choose Name of Person Met.!'); - // } else { + if(formData.individuals.length > 0){ + // console.log(this.temp,formData.individuals.length); + formData.individuals.forEach((val,index) => { + if(val.is_person_met == false){ + this.temp++; + } + + }); + + if(this.temp == formData.individuals.length){ + this.notifier.notify('warning', 'Please Choose Name of Person Met.!'); + return; + } + } this.disableAfterSubmit = true; let saveRecords: any = {} saveRecords.pdid = formData.pdid; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html index 4e6522ac7..7ac25ccd8 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html @@ -36,7 +36,7 @@ + formControlName="sub_product" (selectionChange)="onChangeSubProduct($event.value)"> Select {{list.name }} ( {{list.abbr}} ) 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 9167d92cb..db3edf305 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 @@ -122,7 +122,7 @@ export class LoanDetailsComponent implements OnInit { this.initloanDetailsForm(); this.getM_EndUseofLoad(); - this.getM_EndUseForLoan(this.pdid); + this.getM_EndUseForLoan(this.pdid,this.pd_all_details.pdmaster_details.fk_subproduct_id); this.getM_sourceofamount(); this.getM_MortageTypeProperty(); this.getM_StatusofCunstruction(); @@ -311,8 +311,8 @@ export class LoanDetailsComponent implements OnInit { }); } - getM_EndUseForLoan(pdid) { - this._pd.getEndUseForLoan(pdid).subscribe( + getM_EndUseForLoan(pdid,subproductid) { + this._pd.getEndUseForLoan(pdid,subproductid).subscribe( data => { this.m_endUseForLoan = data.records.filter(data => data.isactive == 1); }); @@ -436,6 +436,12 @@ export class LoanDetailsComponent implements OnInit { } + onChangeSubProduct(e){ + this._pd.getEndUseForLoan(this.pdid,e).subscribe( + data => { + this.m_endUseForLoan = data.records.filter(data => data.isactive == 1); + }); + } /** Enduse Changes And its Validation */ endUserChange(event) { 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 05287358a..8dcc90882 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 @@ -84,9 +84,16 @@
- + + + + + {{val.name}} + + @@ -94,7 +101,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 cd1edeaae..67c721c9e 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 @@ -33,7 +33,11 @@ export class NeighbourHoodComponent implements OnInit { finalRemarksList : any = [{'id': 1,'name': "Positive"}, {'id': 2,'name': "Negative"}, {'id': 3,'name': "Insufficient information provided"}]; - amtInwords : any = []; +existCompanyList: any =[]; +mergeCompanyApplicant: any=[]; +isOrganisationOwner: any=[]; +amtInwords : any = []; + // isOtherApplicant: any = []; constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef) { this.pdid = this.data.pdmaster_details.pd_id; @@ -46,11 +50,34 @@ export class NeighbourHoodComponent implements OnInit { this.applicants = this.data.pdapplicants_detials; this.applicants = this.applicants.filter(appt=>appt.applicant_type != 2); this.applicants.push({'pd_co_applicant_id': 0,'applicant_name': "Others"}) - } ngOnInit() { + this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ + if (data.dataStatus) { + this.existCompanyList = data.records.filter(val => val.is_active === true); + } + + // get company list + 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 }) + } + // get applicant list + 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.initFormDetails(); // call neghbourhhod / reference check changes @@ -113,6 +140,7 @@ export class NeighbourHoodComponent implements OnInit { this.toggleVisibility(element.did_not_know_the_owner,index,2); // this.selectedApplicants(referencecheckControl,element.organisation_owner,index); neighbourhoodControl.push(this.createNeighbourhood(element)); + this.getOtherOrganisationOwner(element.organisation_owner,index); }); } else if(exist_ref_details.length>0 && data.records.check_type==1){ @@ -417,5 +445,45 @@ checkOthers(values){ this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value); } +compareObjects(o1: any, o2: any) { + if(o1.id == o2.id && o1.group_id == o2.group_id) + return true; + else return false +} + +getOtherOrganisationOwner(value,i) { + console.log('value',value,'I',i); +let Ctrls = this._neighbourhoodForm.controls['neighbourhood_list']; + console.log('ParCtrls',Ctrls); +let ChdCtrls:any = Ctrls.controls[i]; + console.log('ChdCtrls',ChdCtrls); + // return; + + +let Avaliablity = 1; +console.log('val',value); +if(value.length>0){ + value.forEach(option => { + if(option.id == 0 && option.group_id == 2){ + Avaliablity = option.id; + } + }); +} +if(Avaliablity == 0){ +// console.log('if Avaliablity',Avaliablity); + + ChdCtrls.controls.other_organisation_owner.setValidators([Validators.required]); + this.isOrganisationOwner[i] = true; +}else if(Avaliablity == 1){ +// console.log('else Avaliablity',Avaliablity); +// console.log('esle this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]); + ChdCtrls.controls.other_organisation_owner.setValue(''); + ChdCtrls.controls.other_organisation_owner.clearValidators(); + this.isOrganisationOwner[i] = false; +// console.log('else this.isOrganisationOwner[ParInx]',this.isOrganisationOwner[i]); +} + +ChdCtrls.controls.other_organisation_owner.updateValueAndValidity(); +} } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts index fdf9aaf7c..fbea14562 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts @@ -154,19 +154,7 @@ public viewerOptions: any = { this.amtInwords[index] = this._pd.convertNumberToWords(val.amount); // this.getOtherIncomeEarnedBy(val.income_earned_by,index); control.push(this.createDetail()); - let Avaliablity = 1; - if(val.income_earned_by.length>0){ - val.income_earned_by.forEach(option => { - if(option.id == 0 && option.group_id == 2){ - Avaliablity = option.id; - } - }); - } - if(Avaliablity == 0){ - this.isIncomeEarnedBy[index] = true; - }else if(Avaliablity == 1){ - this.isIncomeEarnedBy[index] = false; - } + this.getOtherIncomeEarnedBy(val.income_earned_by,index); }); this.otherIncomeForm.controls['income_details'].setValue(result); } else { diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index 6f477c139..48d4062fc 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -545,8 +545,11 @@ export class PdTrigerService { .pipe(catchError(this.handleError('operation', []))) } - getEndUseForLoan(pdid: any): Observable { - return this._http.post(this.apiUrl + "getEndUseOfLoan",{ "records":{ "pd_id" : pdid}}) + /** To get Enduse For Dropdown + * 1) loan details + */ + getEndUseForLoan(pdid: any,subproductid: any): Observable { + return this._http.post(this.apiUrl + "getEndUseOfLoan",{ "records":{"pd_id" : pdid,"sub_product_id":subproductid}}) .pipe( catchError(this.handleError('operation', [])) )