From 7915f22598771bb78500e426e95dd128daa2c463 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Tue, 5 Mar 2019 10:10:05 +0530 Subject: [PATCH] sheet changes : ps --- .../edit-pd-master.component.html | 4 +- .../edit-pd-master.component.ts | 8 +- .../forms/address/address.component.html | 2 +- .../forms/address/address.component.ts | 11 +- .../manage-daily-sales.component.html | 1 + .../manage-daily-sales.component.ts | 10 +- ...anage-other-business-income.component.html | 2 +- .../manage-sales/manage-sales.component.html | 13 +- .../manage-sales/manage-sales.component.ts | 53 +++++- .../assessed-income.component.html | 11 +- .../assessed-income.component.scss | 3 + .../daily-sales-details.component.html | 2 +- .../daily-sales-details.component.scss | 4 + .../gross-profit-calculation.component.html | 4 +- .../gross-profit-calculation.component.ts | 7 + ...her-business-income-details.component.html | 2 +- .../sales-calculation.component.html | 5 +- .../sales-calculation.component.ts | 15 +- .../assets-info/assets-info.component.html | 10 +- .../assets-info/assets-info.component.ts | 168 +++++++++++------- .../business-assets-info.component.html | 4 +- .../business-assets-info.component.ts | 111 +++++++----- .../final-remarks.component.html | 4 +- .../general-info/general-info.component.ts | 2 + .../lender-representative.component.html | 2 +- .../lender-representative.component.ts | 7 +- .../loan-details/loan-details.component.html | 2 +- .../loan-details/loan-details.component.ts | 8 +- .../other-income/other-income.component.html | 6 + .../other-income/other-income.component.ts | 29 +++ .../rental-info/rental-info.component.html | 1 + .../start-pd/forms/stock/stock.component.ts | 14 +- 32 files changed, 366 insertions(+), 159 deletions(-) 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 9efd602f8..7b1e4cb2c 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 @@ -136,7 +136,7 @@
- + {{addressesDeactivited[i]}} Address Details #{{i+1}} Deactivited @@ -197,7 +197,7 @@    -
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 9814c43be..ff8578cde 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 @@ -28,7 +28,7 @@ export class AddressComponent implements OnInit { main_applicant: any; pageTitle: string = "PD Address Details"; - + disableAfterSubmit : boolean = false; /**Declaration of FormField Variables */ //@Input() pdid: number; pdid: number; @@ -345,7 +345,7 @@ createAddresses(AddressDetails): FormGroup { else if (type == 2 && val.isactive == 1) { this.commentData.push(val); } - else if (type == 3 && val.isactive == 1) { + else if (type == 3 && val.isactive == 1 && val.is_land_uom != 0) { this.uomData.push(val); } else if (type == 4 && val.isactive == 1) { @@ -432,14 +432,16 @@ createAddresses(AddressDetails): FormGroup { if (!this.addressForm.valid) { this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); + this.disableAfterSubmit = false; return; } if(this.addressForm.value.bussiness_activity_remark == ''){ this.notifier.notify('warning', 'Fill Remark!'); + this.disableAfterSubmit = false; return; } - + this.disableAfterSubmit = true; let records: any = {}; records.addresses = this.addressForm.controls.addresses.value; // records.address = this.address.value; @@ -483,13 +485,16 @@ createAddresses(AddressDetails): FormGroup { this.notifier.notify('success', 'Saved Successfully.'); setTimeout(() => { this.dialogRef.close(); + this.disableAfterSubmit = false; }, 3000); } else { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.disableAfterSubmit = false; } }, error => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.disableAfterSubmit = false; }); } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.html index 3606a00bf..976ce3781 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component.html @@ -21,6 +21,7 @@ + {{"₹"}} {{marginAmtInwords[s]}} Only + @@ -302,11 +309,11 @@ - + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss index a63b81ec4..1cfc15b89 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss @@ -12,6 +12,9 @@ color:#e00201 !important; } + .complete-button button { + margin-top: 10px; + } .paragraph_change { color: #fff !important; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.html index f0951717b..4fa675d08 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.html @@ -19,7 +19,7 @@ {{expandDetails.salesItem}} - (Margin Percentage % : {{expandDetails.margin_per}}   Margin Value : {{expandDetails.margin_value}}) +  ( Margin Percentage : {{expandDetails.margin_per}} %   Margin Value : {{expandDetails.margin_value}} ) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.scss index 588f58a6b..f350cbf76 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/daily-sales-details/daily-sales-details.component.scss @@ -31,3 +31,7 @@ tr.mat-footer-row { .delete-margin { margin-left: 3%; } +.mat-footer-cell { + font-weight: bold; + font-size: 1.2rem !important; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html index 42dd4466c..8736c7ffd 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.html @@ -10,11 +10,11 @@ {{getData.name}} - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.ts index 381a24d93..4e8676fbe 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component.ts @@ -24,7 +24,14 @@ export class GrossProfitCalculationComponent implements OnInit, OnChanges { } changeOptions(values: any){ + // console.log('values',values); this.grossProfitForm.controls['margin'].setValue(''); + /** if Mode Value is 'No' -> margin value is setted as netmargin and its id - 2 + * Refer => check_sales_type **/ + if(values.mode == 2){ + // console.log('2'); + this.grossProfitForm.controls['margin'].setValue('2'); + } } submitDetails(records: any){ if (this.grossProfitForm.invalid) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.html index 202ec4434..5a0e24d62 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/other-business-income-details/other-business-income-details.component.html @@ -15,7 +15,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.html index 9d54b4f61..19c2839e9 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.html @@ -3,16 +3,19 @@ Sales Calculation - + {{activateMariginCalculation}} + {{"₹"}} {{SaleAmtInwords}} Only + + {{"₹"}} {{marginAmtInwords}} Only diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.ts index 321254f47..2860eec0b 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/sales-calculation/sales-calculation.component.ts @@ -15,6 +15,8 @@ export class SalesCalculationComponent implements OnInit, OnChanges, DoCheck { salesCalculationForm:FormGroup; activateMariginCalculation: boolean; private notifier: NotifierService; + SaleAmtInwords : any; + marginAmtInwords: any; constructor(notifier:NotifierService,private _fb: FormBuilder, private _pd: PdTrigerService) { this.activateMariginCalculation=false; this.notifier = notifier; @@ -23,9 +25,12 @@ export class SalesCalculationComponent implements OnInit, OnChanges, DoCheck { ngOnInit() { } salesCalculation(values): void { + if(values.sales_declared_by_customer !=''){this.SaleAmtInwords = this._pd.convertNumberToWords(values.sales_declared_by_customer);} if(values.margin_per !='' && values.sales_declared_by_customer !='') { + this.salesCalculationForm.controls['margin_value'].setValue(values.sales_declared_by_customer * (values.margin_per/100)); + this.marginAmtInwords = this._pd.convertNumberToWords(values.sales_declared_by_customer * (values.margin_per/100)); } } // save sales calculations details @@ -60,7 +65,9 @@ validateAllFormFields(formGroup: any) { // do check component bases ngDoCheck() { - +// console.log('ngDoCheck this.activateMariginCalculation',this.activateMariginCalculation); +// console.log('ngDoCheck this.masterData.grossProfitTypeList',this.masterData.grossProfitTypeList); +// console.log('69',this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].margin); if(this.masterData.grossProfitTypeList.length>0){ this.activateMariginCalculation = this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].margin==2 && this.masterData.grossProfitTypeList[this.masterData.grossProfitTypeList.length-1].mode==2 ? true : false; } @@ -71,6 +78,9 @@ ngDoCheck() { //detect chnges from parent ngOnChanges(changes: SimpleChanges) { + // console.log('ngDoCheck this.activateMariginCalculation',this.activateMariginCalculation); + // console.log('ngDoCheck this.masterData.grossProfitTypeList',changes.masterData); + // console.log('82',changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].mode); if(changes.masterData){ if(changes.masterData.currentValue.grossProfitTypeList.length>0){ this.activateMariginCalculation = changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].margin==2 && changes.masterData.currentValue.grossProfitTypeList[changes.masterData.currentValue.grossProfitTypeList.length-1].mode==2 ? true : false; @@ -78,6 +88,8 @@ ngOnChanges(changes: SimpleChanges) { } if(changes.parentData){ if(changes.parentData.currentValue.length>0){ + this.SaleAmtInwords = this._pd.convertNumberToWords(changes.parentData.currentValue[changes.parentData.currentValue.length-1].sales_declared_by_customer); + this.marginAmtInwords = this._pd.convertNumberToWords(changes.parentData.currentValue[changes.parentData.currentValue.length-1].margin_value); this.salesCalculationForm = this._fb.group({ sdc_id:[changes.parentData.currentValue[changes.parentData.currentValue.length-1].sdc_id], sales_declared_by_customer:[changes.parentData.currentValue[changes.parentData.currentValue.length-1].sales_declared_by_customer, Validators.compose([Validators.required])], @@ -100,5 +112,4 @@ ngOnChanges(changes: SimpleChanges) { } } - } 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 5aefd5216..4572e9cad 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 @@ -42,7 +42,7 @@
- + Select {{ prop.name }} @@ -279,8 +279,8 @@ - + {{val.name}} @@ -289,7 +289,7 @@ - + @@ -488,7 +488,7 @@
- +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts index 824a70a1b..63dbdc053 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts @@ -45,6 +45,9 @@ export class AssetsInfoComponent implements OnInit { public applicants: any; otherEmiamtFlag : boolean = false; businessEmiAmtFlag : boolean = false; + isOtherOwner:any = []; + disableAfterSubmit : boolean = false; + public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"}, {'value': "no",'viewValue': "No"}, {'value': "nan",'viewValue': "NA"}] @@ -119,30 +122,31 @@ export class AssetsInfoComponent implements OnInit { // this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => { // this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ; // }); + this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ - if(data.dataStatus){ - this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true); + 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}) - 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.getPdSupplierFormDetails(); this.getM_Assets_Type(); this.getM_PropertyType(); @@ -591,11 +595,7 @@ export class AssetsInfoComponent implements OnInit { var result = Object.keys(supp_data).map(function (key) { return supp_data[key]; }); - result.forEach((datas,index) => { - - this.OtherAppxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.approximate_market_value); - - }); + if (result.length > 0) { for (let val of result) { let vals = { @@ -610,9 +610,21 @@ export class AssetsInfoComponent implements OnInit { emi: val.emi, }; const control = this._assetsQuesFrom.controls['assets_details']; + + // let Avaliablity = 1; + // val.name_of_the_owner.forEach(option => { + // if(option.id == 0 && option.group_id == 2){ + // Avaliablity = option.id; + // } + // }); + // this.isOtherOwner = Avaliablity == 0 ? true : false; control.push(this.initDetailsWithdata(vals)); this.setAssetsDetailsWithData(vals.assets_mode, val.details, control.length - 1) } + result.forEach((datas,index) => { + this.OtherAppxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.approximate_market_value); + this.setRequiredValidation(datas.name_of_the_owner,index,'',4); + }); } this.loadDetails = true; } @@ -789,8 +801,10 @@ export class AssetsInfoComponent implements OnInit { // stop here if form is invalid if (this._assetsQuesFrom.invalid) { this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); + this.disableAfterSubmit = false; return; } else { + this.disableAfterSubmit = true; var answerFormValues = this._assetsQuesFrom.value; //To Remove The "Null" With Key also @@ -802,13 +816,16 @@ export class AssetsInfoComponent implements OnInit { this.notifier.notify('success', 'Saved Successfully.'); setTimeout(() =>{ this.dialogRef.close(); + this.disableAfterSubmit = false; },3000); } else { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.disableAfterSubmit = false; } }, error => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.disableAfterSubmit = false; // this.dialogRef.close(); }); //After Saving the BRANCH data then popup close @@ -854,44 +871,75 @@ export class AssetsInfoComponent implements OnInit { // } } - setRequiredValidation(value,item,flag) { - + setRequiredValidation(value,ParInx,ChdInx,flag) { + console.log('value',value,'ParInx',ParInx,'ChdInx',ChdInx,'flag',flag); + let ParCtrls = this._assetsQuesFrom.controls.assets_details; + console.log('ParCtrls',ParCtrls); + let ChdCtrls:any = ParCtrls.controls[ParInx]; + console.log('ChdCtrls',ChdCtrls); if(flag == 1){ value==1 - ? item.controls.other_property_type.setValidators([Validators.required]) - : item.controls.other_property_type.clearValidators(); - item.controls.other_property_type.updateValueAndValidity(); + + // ? controls2[ChdInx].controls.other_property_type.setValidators([Validators.required]) + // : item.controls.other_property_type.clearValidators(); + // item.controls.other_property_type.updateValueAndValidity(); } - if(flag == 2){ - value==1 - ? item.controls.other_frequency_mode.setValidators([Validators.required]) - : item.controls.other_frequency_mode.clearValidators(); - item.controls.other_frequency_mode.updateValueAndValidity(); + // if(flag == 2){ + // value==1 + // ? item.controls.other_frequency_mode.setValidators([Validators.required]) + // : item.controls.other_frequency_mode.clearValidators(); + // item.controls.other_frequency_mode.updateValueAndValidity(); + // } + // if(flag == 3){ + // value==1 + // ? item.controls.other_investments_type.setValidators([Validators.required]) + // : item.controls.other_investments_type.clearValidators(); + // item.controls.other_investments_type.updateValueAndValidity(); + // } + // if(flag == 4){ + // value==0 + // ? item.controls.other_owner.setValidators([Validators.required]) + // : item.controls.other_owner.clearValidators(); + // item.controls.other_owner.updateValueAndValidity(); + // } + if (flag == 4) { + let Avaliablity = 1; + // console.log('val',value); + value.forEach(option => { + if(option.id == 0 && option.group_id == 2){ + Avaliablity = option.id; + } + }); + if(Avaliablity == 0){ + // console.log('if Avaliablity',Avaliablity); + // console.log('if this.isOtherOwner[ParInx]',this.isOtherOwner[ParInx]); + ChdCtrls.controls.other_owner.setValidators([Validators.required]); + this.isOtherOwner[ParInx] = true; + // console.log('if this.isOtherOwner[ParInx]',this.isOtherOwner[ParInx]); + }else if(Avaliablity == 1){ + // console.log('else Avaliablity',Avaliablity); + // console.log('esle this.isOtherOwner[ParInx]',this.isOtherOwner[ParInx]); + ChdCtrls.controls.other_owner.setValue(''); + ChdCtrls.controls.other_owner.clearValidators(); + this.isOtherOwner[ParInx] = false; + // console.log('else this.isOtherOwner[ParInx]',this.isOtherOwner[ParInx]); + } + + ChdCtrls.controls.other_owner.updateValueAndValidity(); + } - if(flag == 3){ - value==1 - ? item.controls.other_investments_type.setValidators([Validators.required]) - : item.controls.other_investments_type.clearValidators(); - item.controls.other_investments_type.updateValueAndValidity(); - } - if(flag == 4){ - value==0 - ? item.controls.other_owner.setValidators([Validators.required]) - : item.controls.other_owner.clearValidators(); - item.controls.other_owner.updateValueAndValidity(); - } - if(flag == 5){ - value==1 - ? item.controls.other_vehicle_type.setValidators([Validators.required]) - : item.controls.other_vehicle_type.clearValidators(); - item.controls.other_vehicle_type.updateValueAndValidity(); -} -if(flag == 6){ - value==1 - ? item.controls.other_uom.setValidators([Validators.required]) - : item.controls.other_uom.clearValidators(); - item.controls.other_uom.updateValueAndValidity(); -} +// if(flag == 5){ +// value==1 +// ? item.controls.other_vehicle_type.setValidators([Validators.required]) +// : item.controls.other_vehicle_type.clearValidators(); +// item.controls.other_vehicle_type.updateValueAndValidity(); +// } +// if(flag == 6){ +// value==1 +// ? item.controls.other_uom.setValidators([Validators.required]) +// : item.controls.other_uom.clearValidators(); +// item.controls.other_uom.updateValueAndValidity(); +// } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html index bc077b578..c4a49beca 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html @@ -118,7 +118,7 @@ Asset Owned by Required - + @@ -315,7 +315,7 @@ Asset Owned by Required - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts index cf23bd025..d2415150f 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts @@ -33,8 +33,8 @@ export class BusinessAssetsInfoComponent implements OnInit { private notifier: NotifierService; public _businessAssetsQuesFrom: FormGroup; public submitted = false; - isOtherOwnerForAddress : boolean = false; - isOtherOwner: boolean = false; + isOtherOwnerForAddress : any = []; + isOtherOwner : any = []; loadDetails: boolean; CustSegAbbr: any; @@ -553,7 +553,6 @@ export class BusinessAssetsInfoComponent implements OnInit { var result = Object.keys(data).map(function (key) { return data[key]; }); - if (result.length > 0) { result.forEach((datas, index) => { this.RentAmtInwordsForAddress[index] = this.pdTrigerService.convertNumberToWords(datas.business_monthly_rented_amt); @@ -567,7 +566,7 @@ export class BusinessAssetsInfoComponent implements OnInit { } }); } - this.isOtherOwnerForAddress = Avaliablity == 0 ? true : false; + this.isOtherOwnerForAddress[index] = Avaliablity == 0 ? true : false; }); @@ -609,8 +608,13 @@ export class BusinessAssetsInfoComponent implements OnInit { this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value); this.RentAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_monthly_rented_amt); let Avaliablity = 1; - - this.isOtherOwner = Avaliablity == 0 ? true : false; + + datas.business_name_of_the_owner.forEach(option => { + if(option.id == 0 && option.group_id == 2){ + Avaliablity = option.id; + } + }); + this.isOtherOwner[index] = Avaliablity == 0 ? true : false; }); @@ -843,7 +847,57 @@ export class BusinessAssetsInfoComponent implements OnInit { this.yearErrorMessage[i] = ''; } } + setRequiredValidation2(value, ParInx,ChdInx, flag) { + if (flag == 4) { + let ParCtrls = this._businessAssetsQuesFrom.controls.assets_details; + let ChdCtrls:any = ParCtrls.controls[ParInx]; + let Avaliablity = 1; + value.forEach(option => { + if(option.id == 0 && option.group_id == 2){ + Avaliablity = option.id; + } + }); + if(Avaliablity == 0){ + + ChdCtrls.controls.business_name_of_the_other_owner.setValidators([Validators.required]); + this.isOtherOwner[ParInx] = true; + }else{ + + ChdCtrls.controls.business_name_of_the_other_owner.setValue(''); + ChdCtrls.controls.business_name_of_the_other_owner.clearValidators(); + this.isOtherOwner[ParInx] = false; + } + + ChdCtrls.controls.business_name_of_the_other_owner.updateValueAndValidity(); + + } + if(flag == 8){ + let ParCtrls = this._businessAssetsQuesFrom.controls.business_assets_for_address; + let ChdCtrls:any = ParCtrls.controls[ParInx]; + + let Avaliablity = 1; + value.forEach(option => { + if(option.id == 0 && option.group_id == 2){ + Avaliablity = option.id; + } + }); + + if(Avaliablity == 0){ + + ChdCtrls.controls.business_name_of_the_other_owner.setValidators([Validators.required]); + this.isOtherOwnerForAddress[ParInx] = true; + }else{ + + ChdCtrls.controls.business_name_of_the_other_owner.setValue(''); + ChdCtrls.controls.business_name_of_the_other_owner.clearValidators(); + this.isOtherOwnerForAddress[ParInx] = false; + } + + ChdCtrls.controls.business_name_of_the_other_owner.updateValueAndValidity(); + + } + } setRequiredValidation(value, item, flag) { if (flag == 1) { @@ -879,27 +933,7 @@ export class BusinessAssetsInfoComponent implements OnInit { item.controls.business_monthly_rented_amt.updateValueAndValidity(); item.controls.business_name_of_the_owner.updateValueAndValidity(); } - if (flag == 4) { - let Avaliablity = 1; - value.forEach(option => { - if(option.id == 0 && option.group_id == 2){ - Avaliablity = option.id; - } - }); - if(Avaliablity == 0){ - - item.controls.business_name_of_the_other_owner.setValidators([Validators.required]); - this.isOtherOwner = true; - }else{ - - item.controls.business_name_of_the_other_owner.setValue(''); - item.controls.business_name_of_the_other_owner.clearValidators(); - this.isOtherOwner = false; - } - - item.controls.business_name_of_the_other_owner.updateValueAndValidity(); - - } + if (flag == 5) { value == 1 ? item.controls.other_vehicle_type.setValidators([Validators.required]) @@ -929,28 +963,7 @@ export class BusinessAssetsInfoComponent implements OnInit { item.controls.business_monthly_rented_amt.updateValueAndValidity(); item.controls.business_name_of_the_owner.updateValueAndValidity(); } - if(flag == 8){ - let Avaliablity = 1; - value.forEach(option => { - if(option.id == 0 && option.group_id == 2){ - Avaliablity = option.id; - } - }); - - if(Avaliablity == 0){ - - item.controls.business_name_of_the_other_owner.setValidators([Validators.required]); - this.isOtherOwnerForAddress = true; - }else{ - - item.controls.business_name_of_the_other_owner.setValue(''); - item.controls.business_name_of_the_other_owner.clearValidators(); - this.isOtherOwnerForAddress = false; - } - - item.controls.business_name_of_the_other_owner.updateValueAndValidity(); - - } + } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html index 1f7f9c71e..5a7ae5e8e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html @@ -59,8 +59,8 @@
- Remarks - + Other Remarks +
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 b838ebc35..ec0710802 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 @@ -622,10 +622,12 @@ export class GeneralInfoComponent implements OnInit { } else { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.disableAfterSubmit = false; // this.errorMessage = "Some Thing Wents Wrong Try Again !"; } }, error => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.disableAfterSubmit = false; // this.errorMessage = "Something Wents Wrong Try Again !"; }); } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.html index e9dc2d35d..2d37dca4c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.html @@ -163,7 +163,7 @@
-
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.ts index f2dc7f4de..ec0499193 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/lender-representative/lender-representative.component.ts @@ -30,7 +30,7 @@ export class LenderRepresentativeComponent implements OnInit { pageTitle: string ="Lender Representative Details"; pdid: number; form_id: number; - + disableAfterSubmit : boolean = false; //snack bar @@ -141,9 +141,11 @@ export class LenderRepresentativeComponent implements OnInit { submitLRForm() { if (!this.representativeForm.valid) { this.validateAllFormFields(this.representativeForm); + this.disableAfterSubmit = false; this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); return; } + this.disableAfterSubmit = true; let records: any = {}; records.pdid = this.pdid; records.formid = this.form_id; @@ -158,13 +160,16 @@ export class LenderRepresentativeComponent implements OnInit { this.notifier.notify('success', 'Saved Successfully.'); setTimeout(() =>{ this.dialogRef.close(); + this.disableAfterSubmit = false; },3000); } else { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.disableAfterSubmit = false; } }, error => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.disableAfterSubmit = false; }) } validateAllFormFields(formGroup: FormGroup) { 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 a48bbb000..0d2f8e9fe 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 @@ -377,7 +377,7 @@
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 7c119dd59..eb7badb24 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 @@ -31,7 +31,7 @@ export class LoanDetailsComponent implements OnInit { lender_applicant_id: any; main_applicant: any; pageTitle: string = "Loan Details"; - + disableAfterSubmit : boolean = false; /**Declaration of formfields Variables */ private notifier: NotifierService; @@ -655,9 +655,10 @@ export class LoanDetailsComponent implements OnInit { if (!this.loanDetailsForm.valid) { this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); + this.disableAfterSubmit = false; return; } - + this.disableAfterSubmit = true; let records: any = {}; records.pdid = this.pdid; records.formid = this.form_id; @@ -746,13 +747,16 @@ export class LoanDetailsComponent implements OnInit { // this.dialogRef.close(); setTimeout(() => { this.dialogRef.close(); + this.disableAfterSubmit = false; }, 3000); } else { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.disableAfterSubmit = false; } }, error => { this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + this.disableAfterSubmit = false; }) } 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 47ac52c6e..aa52bbbca 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 @@ -56,6 +56,12 @@ formControlName="others_source"> + + + Click Here To view Rental Info Form + + 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 d70049e4e..193103930 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 @@ -24,6 +24,8 @@ import { import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; import {ActivatedRoute, Router} from '@angular/router'; +import { RentalInfoComponent} from './../rental-info/rental-info.component'; + @Component({ selector: 'app-other-income', templateUrl: './other-income.component.html', @@ -58,6 +60,7 @@ export class OtherIncomeComponent implements OnInit { private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService, + private dialog: MatDialog, private dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public pd_all_details: any) { @@ -154,6 +157,7 @@ public viewerOptions: any = { return this.fb.group({ source: [''], others_source : [''], + address : [''], income_earned_by:[''], others_income_earned_by:[''], amount: [''], @@ -246,5 +250,30 @@ public viewerOptions: any = { inWords(e,i){ this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value); } + + Toview(){ + alert('Rental Info '); + // const dialogRef = this.dialog.open(RentalInfoComponent, { + // data: {} + // }); + + // dialogRef.afterClosed() + // .subscribe(dataresult => { + + // }); + const dialogRef = this.dialog.open(RentalInfoComponent, { + data: this.pd_all_details, + maxWidth: '100vw', + maxHeight: '100vh', + height: '100%', + width: '100%', + disableClose: true + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + // this.getCompanyListForBusiness(); + }); + + } } 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 8a45db85a..1c1eabe67 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 @@ -5,6 +5,7 @@ {{main_applicant}} ({{lender_applicant_id}}), {{customer_segment_abbr}} - {{subproduct_abbr}}
{{pageTitle}}
--> +
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 3fe463f71..1e28c4809 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 @@ -333,11 +333,14 @@ export class StockComponent implements OnInit { manufacturingFormCreation(record) { let arr = record.from_business.filter(data => data.type_of_activity_id == 2); + let arrlength = arr[0].hasOwnProperty("products") ? arr[0].products.length : 0; let rm_arr = record.from_supplier; - // let rm_arr = 0; - this.manufacturingForm = true; - if(arr.length > 0){ + console.log('manu arr',arr); + console.log('rm_arr',rm_arr); + // let rm_arr = 0; + if(arrlength > 0){ + this.manufacturingForm = true; return this.fb.group({ manufacturing_raw_materials: this.fb.array([]), is_sufficiant_raw: [], @@ -345,9 +348,8 @@ export class StockComponent implements OnInit { manufacturing_finished_goods: this.fb.array([]), }) } - - else { - return; + else { + return; } }
business Income Business Income {{element.business_income_item}} Total of Income