diff --git a/ng6-seed/sineedge_prod_090219.zip b/ng6-seed/sineedge_prod_090219.zip new file mode 100644 index 000000000..b277682ea Binary files /dev/null and b/ng6-seed/sineedge_prod_090219.zip differ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.scss index 99930d87a..f4b60c55c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.scss @@ -11,6 +11,9 @@ mat-form-field { margin: 0 2%; + } + .mat-form-field-appearance-legacy .mat-hint{ + color:rgba(0, 0, 0, 0.8) !important; } ::ng-deep .cdk-global-overlay-wrapper{ justify-content: center !important; 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 fef4bd971..3b37d1927 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 @@ -444,7 +444,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 c4b88bb54..823227eb4 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 @@ -776,11 +776,11 @@ export class AssetsInfoComponent implements OnInit { } /** To Reset Popup Data */ - onReset() { - const arr = this._assetsQuesFrom.controls.assets_details; - arr.controls.splice(0); - this.getPdSupplierFormDetails(); - } + // onReset() { + // const arr = this._assetsQuesFrom.controls.assets_details; + // arr.controls.splice(0); + // this.getPdSupplierFormDetails(); + // } /** On Key Press Event For Number only Accepting */ keyPress(event: 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 index 53765f261..8297a4653 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 @@ -39,12 +39,12 @@ {{yearErrorMessage}} - + Year's Required {{monthErrorMessage}} - + Month's Required @@ -55,13 +55,13 @@ Yes No - + Field Required - + Field Required @@ -73,7 +73,7 @@ Yes No - + Field Required @@ -88,12 +88,12 @@ - {{m_addressType.address_type}} + {{m_address_type.address_type}} - + Premises Type Required - {{m_addressType.address_type}} + {{m_address_type.address_type}} @@ -186,12 +186,7 @@ - Car / Jeep - Rickshaw / Tempo - Truck / Bus - Tractor - Two Wheeler - Others (Please Specify) + {{ vehicle.vehicle_type_name }} @@ -333,7 +328,7 @@
- + Owned Rented @@ -342,8 +337,9 @@ - - + + {{"₹"}} {{RentAmtInwords[i]}} Only + Monthly Rent Amount Required
@@ -363,7 +359,7 @@ - + Asset Owned by Required
@@ -534,7 +530,7 @@
- +
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 44f5ee44e..b43255d29 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 @@ -40,6 +40,7 @@ export class BusinessAssetsInfoComponent implements OnInit { // AmtInvestInwords: any = []; AssetValueInwords: any = []; // B_emiAmtInwords: any = []; + RentAmtInwords:any=[]; public m_propertyType = []; PropertyOwnedType : any = []; // public m_investmentType = []; @@ -49,7 +50,8 @@ export class BusinessAssetsInfoComponent implements OnInit { mergeCompanyApplicant: any=[]; currentYear:any=new Date().getFullYear(); addressLabel : any; - public m_addressType = []; + public m_address_type = []; + public m_vehicle_type = []; CustSegAbbr: any; generalExistBusinessYear:Number; generalExistBusinessMonth:Number; @@ -133,6 +135,7 @@ export class BusinessAssetsInfoComponent implements OnInit { // this.getM_InvestmentType(); // this.getM_FreqOfPurchase(); this.getM_Address_Type(); + this.getM_Vehicle_Type(); let params: any = {}; params.pd_id = this.pdid; @@ -144,7 +147,7 @@ export class BusinessAssetsInfoComponent implements OnInit { this.addressLabel = ''; - let selectedAddressType = this.m_addressType.filter(element =>element.address_type_id == data.records.address_type)[0]; + let selectedAddressType = this.m_address_type.filter(element =>element.address_type_id == data.records.address_type)[0]; let address = data.records.address; let addressType = data.records.address_type != 1 ? selectedAddressType.address_type : data.records.address_type_others; @@ -208,19 +211,26 @@ export class BusinessAssetsInfoComponent implements OnInit { getM_Address_Type() { this.pdTrigerService.getAllMasterDatas('ADDRESSTYPE').subscribe( data => { - this.m_addressType = data.records.filter(data => data.isactive == 1); - // console.log(this.m_addressType); + this.m_address_type = data.records.filter(data => data.isactive == 1); + // console.log(this.m_address_type); // if(this.CustSegAbbr == 'SENP' || this.CustSegAbbr == 'SEP'){ // // console.log('whole',FilteredAddressType); - // let index1 = this.m_addressType.map(data => data.address_type).indexOf("Residence"); - // this.m_addressType.splice(index1, 1); + // let index1 = this.m_address_type.map(data => data.address_type).indexOf("Residence"); + // this.m_address_type.splice(index1, 1); // // console.log('FirstOne',FilteredAddressType); - // let index2 = this.m_addressType.map(data => data.address_type).indexOf("Residence cum Office"); - // this.m_addressType.splice(index2, 1); + // let index2 = this.m_address_type.map(data => data.address_type).indexOf("Residence cum Office"); + // this.m_address_type.splice(index2, 1); // // console.log('SecondOne',FilteredAddressType); // } - // console.log(this.m_addressType); + // console.log(this.m_address_type); + }) + } + + getM_Vehicle_Type(){ + this.pdTrigerService.getAllMasterDatas('VEHICLETYPE').subscribe( + data => { + this.m_vehicle_type = data.records.filter(data => data.is_active == 1); }) } @@ -597,6 +607,7 @@ export class BusinessAssetsInfoComponent implements OnInit { if (result.length > 0) { result.forEach((datas,index) => { this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value); + this.RentAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_monthly_rented_amt); }); for (let val of result) { @@ -807,11 +818,11 @@ export class BusinessAssetsInfoComponent implements OnInit { } /** To Reset Popup Data */ - onReset() { - const arr = this._businessAssetsQuesFrom.controls.business_assets_details; - arr.controls.splice(0); - this.getPdSupplierFormDetails(); - } + // onReset() { + // const arr = this._businessAssetsQuesFrom.controls.business_assets_details; + // arr.controls.splice(0); + // this.getPdSupplierFormDetails(); + // } /** On Key Press Event For Number only Accepting */ keyPress(event: any) { @@ -919,17 +930,17 @@ if(flag == 2){ item.controls.premises_type_others.updateValueAndValidity(); } if(flag == 3){ - if(value == 'owned'){ - this._businessAssetsQuesFrom.controls.business_monthly_rented_amt.clearValidators(); - this._businessAssetsQuesFrom.controls.business_name_of_the_owner.setValidators([Validators.required]); + if(value == 'owned'){ + item.controls.business_monthly_rented_amt.clearValidators(); + item.controls.business_name_of_the_owner.setValidators([Validators.required]); + } + else{ + item.controls.business_monthly_rented_amt.setValidators([Validators.required]); + item.controls.business_name_of_the_owner.clearValidators(); + } + item.controls.business_monthly_rented_amt.updateValueAndValidity(); + item.controls.business_name_of_the_owner.updateValueAndValidity(); } - else{ - this._businessAssetsQuesFrom.controls.business_monthly_rented_amt.setValidators([Validators.required]); - this._businessAssetsQuesFrom.controls.business_name_of_the_owner.clearValidators(); - } - this._businessAssetsQuesFrom.controls.business_monthly_rented_amt.updateValueAndValidity(); - this._businessAssetsQuesFrom.controls.business_name_of_the_owner.updateValueAndValidity(); -} } @@ -971,6 +982,9 @@ if(flag == 3){ // case 7 : // this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); // break; + case 8: + this.RentAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value); + break; default: break; } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/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 70c372dff..774cce24a 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 @@ -220,7 +220,7 @@ - + Within India Export Both @@ -457,7 +457,7 @@ - + Within India Export Both @@ -696,7 +696,7 @@ - + Within India Export Both @@ -933,7 +933,7 @@ - + Within India Export Both @@ -1265,10 +1265,6 @@
- - - @@ -1277,6 +1273,10 @@ + + +
this.businessForm.controls['manufacturing_activity_details']; manufacturingControl.controls = []; manufacturingControl.setValue([]); } else if(event.value.exist_status==false && event.value.type_of_activity_id==2){ + console.log('changeBusinessActivity 2'); + this.ManufacturingChecked = event.value.exist_status; let manufacturingControl = this.businessForm.controls['manufacturing_activity_details']; manufacturingControl.push(this.createActivity()); } if(event.value.exist_status==true && event.value.type_of_activity_id==3){ + console.log('changeBusinessActivity 3'); + this.RetailedChecked = event.value.exist_status; let retailControl = this.businessForm.controls['retail_trading_activity_details']; retailControl.controls = []; retailControl.setValue([]); } else if(event.value.exist_status==false && event.value.type_of_activity_id==3){ + console.log('changeBusinessActivity 4'); + this.RetailedChecked = event.value.exist_status; let retailControl = this.businessForm.controls['retail_trading_activity_details']; retailControl.push(this.createActivity()); } if(event.value.exist_status==true && event.value.type_of_activity_id==4){ + console.log('changeBusinessActivity 5'); + this.WholeSalesChecked = event.value.exist_status; let wholesaleControl = this.businessForm.controls['wholesale_trading_activity_details']; wholesaleControl.controls = []; wholesaleControl.setValue([]); } else if(event.value.exist_status==false && event.value.type_of_activity_id==4){ + console.log('changeBusinessActivity 6'); + this.WholeSalesChecked = event.value.exist_status; let wholesaleControl = this.businessForm.controls['wholesale_trading_activity_details']; wholesaleControl.push(this.createActivity()); } if(event.value.exist_status==true && event.value.type_of_activity_id==5){ + console.log('changeBusinessActivity 7'); + this.ServiceChecked = event.value.exist_status; let serviceControl = this.businessForm.controls['service_provider_activity_details']; serviceControl.controls = []; serviceControl.setValue([]); } else if(event.value.exist_status==false && event.value.type_of_activity_id==5){ + console.log('changeBusinessActivity 8'); + this.ServiceChecked = event.value.exist_status; let serviceControl = this.businessForm.controls['service_provider_activity_details']; serviceControl.push(this.createServiceActivity()); } @@ -697,8 +721,9 @@ export class BusinessInfoComponent implements OnInit { this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('applicant_use_mobile_wallets', new FormControl(this.businessForm.value.applicant_use_mobile_wallets)) : this.businessForm.removeControl('applicant_use_mobile_wallets'); this.businessForm.value.service_provider_activity_details.length > 0 || this.businessForm.value.retail_trading_activity_details.length > 0 || this.businessForm.value.wholesale_trading_activity_details.length > 0 ? this.businessForm.addControl('applicant_use_pos_machines', new FormControl(this.businessForm.value.applicant_use_pos_machines)) : this.businessForm.removeControl('applicant_use_pos_machines'); - - + if(this.ManufacturingChecked && this.RetailedChecked && this.WholeSalesChecked && this.ServiceChecked){ + this.ExportFlag = false; + } } // change area of sale options in manufacturing changeManufacturingAreaSale(getDetails: any, getIndex){ @@ -1737,38 +1762,77 @@ WholeSaleCounterArray: any = []; ServiceCounterArray: any = []; CheckExport(value,stringFlag,index){ + const parentControl = this.businessForm.controls['select_business_activity_type']; + const childControl = parentControl.controls[0]; + // console.log('parentControl',parentControl); + // console.log('parentControl.controls',parentControl.controls); + // console.log('childControl',childControl.value); + // console.log('childControl',childControl.value.exist_status); + // childControl.forEach((datas,index) => { + + // console.log(datas); + // // exist_status==true && event.value.type_of_activity_id + // console.log(datas[index].); + // console.log(datas[index].controls.exist_status.value); + // }); + + console.log('CheckExport'); + console.log(value,stringFlag,index); + + console.log(this.ManufacturingChecked , this.RetailedChecked , this.WholeSalesChecked , this.ServiceChecked); + + if(!this.ManufacturingChecked){ if(stringFlag == 'MActivity' && value != "Within India"){ this.ManufacturingCounterArray[index] = 1; } - else{ + else if(stringFlag == 'MActivity' && value != "Within India"){ + this.ManufacturingCounterArray[index] = 0; + } + }else if (this.ManufacturingChecked && stringFlag == 'MActivity'){ this.ManufacturingCounterArray[index] = 0; } - if(stringFlag == 'RActivity' && value != "Within India"){ - this.RetailCounterArray[index] = 1; + if(!this.RetailedChecked){ + if(stringFlag == 'RActivity' && value != "Within India"){ + this.RetailCounterArray[index] = 1; + } + else if(stringFlag == 'RActivity' && value != "Within India"){ + this.RetailCounterArray[index] = 0; + } } - else{ + else if(stringFlag == 'RActivity' && this.RetailedChecked){ this.RetailCounterArray[index] = 0; } - if(stringFlag == 'WActivity' && value != "Within India"){ - this.WholeSaleCounterArray[index] = 1; + if(!this.WholeSalesChecked){ + if(stringFlag == 'WActivity' && value != "Within India"){ + this.WholeSaleCounterArray[index] = 1; + } + else if(stringFlag == 'WActivity' && value != "Within India"){ + this.WholeSaleCounterArray[index] = 0; + } } - else{ + else if(stringFlag == 'WActivity' && this.WholeSalesChecked){ this.WholeSaleCounterArray[index] = 0; } - if(stringFlag == 'SPActivity' && value != "Within India") - { - this.ServiceCounterArray[index] = 1; - } - else{ + if(!this.ServiceChecked){ + + if(stringFlag == 'SPActivity' && value != "Within India") + { + this.ServiceCounterArray[index] = 1; + } + else if(stringFlag == 'SPActivity' && value != "Within India"){ + this.ServiceCounterArray[index] = 0; + } + + }else if(stringFlag == 'SPActivity'){ this.ServiceCounterArray[index] = 0; - } + } let SumOfManufacturingCounter = this.ManufacturingCounterArray.reduce((sum, val) => sum + +val, 0); - // console.log(SumOfManufacturingCounter,this.ManufacturingCounterArray); + console.log(SumOfManufacturingCounter,this.ManufacturingCounterArray); let SumOfRetailCounter = this.RetailCounterArray.reduce((sum, val) => sum + +val, 0); // console.log(SumOfRetailCounter , this.RetailCounterArray); let SumOfWholeSaleCounter = this.WholeSaleCounterArray.reduce((sum, val) => sum + +val, 0); @@ -1777,10 +1841,11 @@ CheckExport(value,stringFlag,index){ // console.log(SumOfServiceCounter,this.ServiceCounterArray); let overallCounter = SumOfManufacturingCounter + SumOfRetailCounter + SumOfWholeSaleCounter + SumOfServiceCounter ; + this.ExportFlag = overallCounter > 0 ? true : false ; - // console.log('overallCounter , SumOfManufacturingCounter , SumOfRetailCounter , SumOfWholeSaleCounter , SumOfServiceCounter ' , overallCounter , SumOfManufacturingCounter , SumOfRetailCounter , SumOfWholeSaleCounter , SumOfServiceCounter); - // console.log('Current Flag Status : ',this.ExportFlag ); + console.log('overallCounter , SumOfManufacturingCounter , SumOfRetailCounter , SumOfWholeSaleCounter , SumOfServiceCounter ' , overallCounter , SumOfManufacturingCounter , SumOfRetailCounter , SumOfWholeSaleCounter , SumOfServiceCounter); + console.log('Current Flag Status : ',this.ExportFlag ); } inWords(e,flag){ 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 a35908c9c..a65042534 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 @@ -45,7 +45,7 @@ - + Select {{comrelShip.name}} @@ -73,16 +73,26 @@
- + + + {{ pm.name }} + + - + + + Payment received in Cash. + Payment received through Banking channels. + + + +
- No. of Days of Credit Given for Payment Receipt + No of days of Credit provided to Client for payment + @@ -106,7 +116,7 @@
-
@@ -147,7 +157,7 @@
- + Select {{comrelShip.name}} @@ -176,16 +186,27 @@
- + + + {{ pm.name }} + + + + + + Payment received in Cash. + Payment received through Banking channels. + +
- No. of Days of Credit Given for Payment Receipt + No of days of Credit provided to Client for payment @@ -209,7 +230,7 @@
-
@@ -250,7 +271,7 @@
- + Select {{comrelShip.name}} @@ -278,16 +299,27 @@
- + + + {{ pm.name }} + + + + + Payment received in Cash. + Payment received through Banking channels. + + +
- No. of Days of Credit Given for Payment Receipt + No of days of Credit provided to Client for payment @@ -311,7 +343,7 @@
-
@@ -319,10 +351,10 @@ - +
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 3eb58b505..585eaadc7 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 @@ -43,7 +43,7 @@ export class ClientInfoComponent implements OnInit { public _supplierQuesFrom: FormGroup; public submitted = false; - public m_paymentModeType = []; + public m_paymentType = []; private notifier: NotifierService; companyRelationShipList: any=[]; titleList: any=[]; @@ -139,7 +139,7 @@ export class ClientInfoComponent implements OnInit { // }; let datas = data.records; this.m_manufacturingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 2 ){return data}}).map(data=> [...data.prodcuts]); - this.m_tradingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 4){return data}}).map(data=> [...data.prodcuts]); + this.m_tradingProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 4 || data.type_of_activity_id == 3){return data}}).map(data=> [...data.prodcuts]); this.m_suplierProducts = datas.type_of_activity.filter(data=>{if(data.type_of_activity_id == 5 ){return data}}).map(data=> [...data.prodcuts]); // alert(JSON.stringify(this.m_manufacturingProducts[0])); this.initFormLoadDetails(datas.type_of_activity); @@ -161,7 +161,7 @@ export class ClientInfoComponent implements OnInit { this.getMasterDetails('TITLES',2); } - retaildTradingForm: Boolean = false; + // retaildTradingForm: Boolean = false; initFormLoadDetails(record) { let params: any = {}; params.pd_id = this.pdid; @@ -195,7 +195,7 @@ export class ClientInfoComponent implements OnInit { } // Load form details for the wholeshale trading details - let arr1 = record.filter(data => data.type_of_activity_id == 4); + let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id == 4); if (arr1.length > 0) { // let api_trading_products = Object.keys(dataForm.trading_products).map(function (key) { // return dataForm.trading_products[key]; @@ -218,9 +218,9 @@ export class ClientInfoComponent implements OnInit { } // Load form details for the retail trading details let arr3 = record.filter(data => data.type_of_activity_id == 3); - if (arr3.length > 0) { - this.retaildTradingForm = true; - } + // if (arr3.length > 0) { + // this.retaildTradingForm = true; + // } this.noRecordsFound = true; } else { this._supplierQuesFrom = this._formBuilder.group({ @@ -238,7 +238,7 @@ export class ClientInfoComponent implements OnInit { this.initManufacturingProductsDetails(null); this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null); } - let arr1 = record.filter(data => data.type_of_activity_id == 4); + let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id == 4); if (arr1.length > 0) { this.initTradingProductsDetails(null); this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null); @@ -253,9 +253,9 @@ export class ClientInfoComponent implements OnInit { } // Load form details for the retail trading details let arr3 = record.filter(data => data.type_of_activity_id == 3); - if (arr3.length > 0) { - this.retaildTradingForm = true; - } + // if (arr3.length > 0) { + // this.retaildTradingForm = true; + // } this.noRecordsFound = true; } } else { @@ -274,7 +274,7 @@ export class ClientInfoComponent implements OnInit { this.initManufacturingProductsDetails(null); this._supplierQuesFrom.controls['manufacturing_details']['controls'][0].controls['main_raw_materials_total_payments_percent_on_credit'].setValue(null); } - let arr1 = record.filter(data => data.type_of_activity_id == 4); + let arr1 = record.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id == 4); if (arr1.length > 0) { this.initTradingProductsDetails(null); this._supplierQuesFrom.controls['trade_details']['controls'][0].controls['trading_products_total_payments_percent_on_credit'].setValue(null); @@ -286,9 +286,9 @@ export class ClientInfoComponent implements OnInit { } // Load form details for the retail trading details let arr3 = record.filter(data => data.type_of_activity_id == 3); - if (arr3.length > 0) { - this.retaildTradingForm = true; - } + // if (arr3.length > 0) { + // this.retaildTradingForm = true; + // } this.noRecordsFound = true; } }, err => { @@ -315,7 +315,8 @@ export class ClientInfoComponent implements OnInit { tradingForm: Boolean = false; tradingFormCreation(val) { - let arr = val.filter(data => data.type_of_activity_id == 4); + // let arr = val.filter(data => data.type_of_activity_id == 4); + let arr = val.filter(data => data.type_of_activity_id == 3 || data.type_of_activity_id == 4); if (arr.length > 0) { this.tradingForm = true; return this._formBuilder.group({ @@ -360,12 +361,15 @@ export class ClientInfoComponent implements OnInit { manufacturing_contact_person_name: [''], manufacturing_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], manufacturing_payment_type: [''], - manufacturing_credit_days: [''], + manufacturing_payment_mode:[''], + // manufacturing_credit_days: [''], 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:[''], + manufacturing_credit_days_from:[''], + manufacturing_credit_days_to:[''] }) } else { return this._formBuilder.group({ @@ -374,12 +378,15 @@ export class ClientInfoComponent implements OnInit { 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_payment_mode:[records.manufacturing_payment_mode || null], manufacturing_credit_days: [records.manufacturing_credit_days || null], 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], + manufacturing_credit_days_from:[records.manufacturing_credit_days_from || null], + manufacturing_credit_days_to:[records.manufacturing_credit_days_to || null] }) } } @@ -403,6 +410,7 @@ export class ClientInfoComponent implements OnInit { trade_product_contact_person_name: [''], trade_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], trade_product_payment_type: [''], + trade_product_payment_mode:[''], trade_product_frequency_of_purchase: [''], trade_product_credit_days_from: [''], trade_product_credit_days_to: [''], @@ -419,6 +427,7 @@ export class ClientInfoComponent implements OnInit { 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)])], trade_product_payment_type: [records.trade_product_payment_type], + trade_product_payment_mode:[records.trade_product_payment_mode], trade_product_frequency_of_purchase: [records.trade_product_frequency_of_purchase], trade_product_credit_days_from: [records.trade_product_credit_days_from], trade_product_credit_days_to: [records.trade_product_credit_days_to], @@ -450,6 +459,7 @@ export class ClientInfoComponent implements OnInit { service_provider_product_contact_person_name: [''], service_provider_product_contact_person_mobile_number: ['',Validators.compose([Validators.minLength(10),Validators.maxLength(10)])], service_provider_product_payment_type: [''], + service_provider_product_payment_mode:[''], service_provider_product_frequency_of_purchase: [''], service_provider_product_credit_days_from: [''], service_provider_product_credit_days_to: [''], @@ -466,6 +476,7 @@ export class ClientInfoComponent implements OnInit { service_provider_product_contact_person_name: [records.service_provider_product_contact_person_name], 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_payment_mode: [records.service_provider_product_payment_mode], service_provider_product_frequency_of_purchase: [records.service_provider_product_frequency_of_purchase], 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], @@ -532,7 +543,7 @@ export class ClientInfoComponent implements OnInit { getM_PaymentModeType() { this.pdTrigerService.getAllMasterDatas('PAYMENTMODE').subscribe( data => { - this.m_paymentModeType = data.records.filter(data => data.isactive == 1); + this.m_paymentType = data.records.filter(data => data.isactive == 1); }, error => { // this.notifier.notify('warning', 'No Category Records Found.!'); @@ -624,6 +635,24 @@ export class ClientInfoComponent implements OnInit { } } + selectedPersonDesignation(items,e,flag){ + if(flag == 1){ + e==1 ? items.controls['other_person_designation'].setValidators([Validators.required]) + : items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue(''); + items.controls['other_person_designation'].updateValueAndValidity(); + } + else if(flag == 2){ + e==1 ?items.controls['other_person_designation'].setValidators([Validators.required]) + :items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue(''); + items.controls['other_person_designation'].updateValueAndValidity(); + } + else if(flag == 3){ + e==1 ?items.controls['other_person_designation'].setValidators([Validators.required]) + :items.controls['other_person_designation'].clearValidators(),items.controls['other_person_designation'].setValue(''); + items.controls['other_person_designation'].updateValueAndValidity(); + } + } + // { // 'main_raw_materials': 'sdkjfal', // 'supplier_details' ; [ 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 f254d43b7..b980ab036 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 @@ -406,7 +406,7 @@ -
@@ -431,7 +431,7 @@
- @@ -449,6 +449,14 @@
+ + + + + @@ -579,16 +587,12 @@
-
- - -
-
- +
+    +
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 d4be48427..01f887ecc 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 @@ -637,6 +637,12 @@ export class FamilyDetailsComponent implements OnInit { e.stopPropagation(); this.initFamilyForm(null); } + + removeOtherFamilyMembers(i): void { + let control = this.familyForm.get('family_details') as FormArray; + control.removeAt(i); + } + selectedPerson(e,inx){ // console.log('e,inx',e,inx); 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 966e16fa0..88f691d83 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 @@ -39,12 +39,14 @@ - - - Positive + {{m_recommendationList || json}} + + {{ list.pdofficer_recommendation }} + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts index b39722f4c..3028a7460 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts @@ -45,6 +45,7 @@ export class FinalRemarksComponent implements OnInit { public submitted = false; public m_remarkTypeCustomerBehaviour = []; + public m_recommendationList = []; private notifier: NotifierService; constructor( @@ -73,6 +74,7 @@ export class FinalRemarksComponent implements OnInit { final_form_remarks: ['',Validators.required] }); this.getM_Type(); + this.getM_Recommendation(); } public viewerOptions: any = { navbar: false, @@ -98,6 +100,8 @@ export class FinalRemarksComponent implements OnInit { ngOnInit() { this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '20').subscribe(data=>{ if(data.dataStatus){ + this.RecommendationChange(data.records.pd_officers_recommendation); + this._finalRemarkForm.controls.final_custormer_remark_type.setValue(data.records.final_custormer_remark_type); this._finalRemarkForm.controls.final_other_customer_behaviour.setValue(data.records.final_other_customer_behaviour); this._finalRemarkForm.controls.pd_officers_recommendation.setValue(data.records.pd_officers_recommendation); @@ -106,6 +110,7 @@ export class FinalRemarksComponent implements OnInit { this._finalRemarkForm.controls.enter_reason_for_refer_to_credit.setValue(data.records.enter_reason_for_refer_to_credit); this._finalRemarkForm.controls.is_service_provided.setValue(data.records.is_service_provided); this._finalRemarkForm.controls.final_form_remarks.setValue(data.records.final_form_remarks); + this.noRecordsFound = true; } else { this.noRecordsFound = true; @@ -115,10 +120,23 @@ export class FinalRemarksComponent implements OnInit { }) } + getM_Recommendation() { + this.pdTrigerService.getAllMasterDatas('PDOFFICERRECOMMENDATIONS').subscribe( + data => { + this.m_recommendationList = data.records; + }, + error => { + // this.notifier.notify('warning', 'No Category Records Found.!'); + // this.m_assets_type = "No Category Records Found."; + } + ) + } + getM_Type() { this.pdTrigerService.getAllMasterDatas('CUSTOMERBEHAVIOUR').subscribe( data => { this.m_remarkTypeCustomerBehaviour = data.records.filter(data => data.isactive == 1); + console.log(this.m_remarkTypeCustomerBehaviour); }, error => { // this.notifier.notify('warning', 'No Category Records Found.!'); @@ -137,18 +155,6 @@ export class FinalRemarksComponent implements OnInit { this._finalRemarkForm.controls['final_other_customer_behaviour'].setValidators([Validators.required]); this._finalRemarkForm.controls['final_other_customer_behaviour'].updateValueAndValidity(); } - if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){ - this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValidators([Validators.required]); - this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity(); - } - if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 3){ - this._finalRemarkForm.controls['enter_reason_for_negative'].setValidators([Validators.required]); - this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity(); - } - if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 4){ - this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValidators([Validators.required]); - this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity(); - } // stop here if form is invalid if (this._finalRemarkForm.invalid) { this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); @@ -196,4 +202,74 @@ export class FinalRemarksComponent implements OnInit { } } + RecommendationChange(e){ + if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 1){ + + } + if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 3){ + + } + if(this._finalRemarkForm.controls.pd_officers_recommendation.value == 4){ + + } + + if(e==1){ + + this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValidators([Validators.required]); + this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity(); + + this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators(); + this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity(); + this._finalRemarkForm.controls['enter_reason_for_negative'].setValue(''); + + this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].clearValidators(); + this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity(); + this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue(''); + } + if(e==2){ + + this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators(); + this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity(); + this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue(''); + + this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators(); + this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity(); + this._finalRemarkForm.controls['enter_reason_for_negative'].setValue(''); + + this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].clearValidators(); + this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity(); + this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue(''); + + } + if(e==3){ + + this._finalRemarkForm.controls['enter_reason_for_negative'].setValidators([Validators.required]); + this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity(); + + this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue(''); + this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators(); + this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity(); + + this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValue(''); + this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators(); + this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity(); + + } + if(e==4){ + + this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].setValidators([Validators.required]); + this._finalRemarkForm.controls['enter_reason_for_refer_to_credit'].updateValueAndValidity(); + + this._finalRemarkForm.controls['others_pd_officers_recommendation'].setValue(''); + this._finalRemarkForm.controls['others_pd_officers_recommendation'].clearValidators(); + this._finalRemarkForm.controls['others_pd_officers_recommendation'].updateValueAndValidity(); + + this._finalRemarkForm.controls['enter_reason_for_negative'].setValue(''); + this._finalRemarkForm.controls['enter_reason_for_negative'].clearValidators(); + this._finalRemarkForm.controls['enter_reason_for_negative'].updateValueAndValidity(); + } + } + + + } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html index 7e12dac5b..ed4b52230 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html @@ -249,7 +249,11 @@ - {{"₹"}} {{AV_marginProfitAmtInwords[i]}} Only ( {{"₹"}} {{details.get('estimate_profit_margin').value}} ) + + + + + {{"₹"}} {{AV_marginProfitAmtInwords[i]}} Only
@@ -261,9 +265,12 @@ {{"₹"}} {{AV_netProfitAmtToInwords[i]}} Only + + + - {{"₹"}} {{AV_netProfitAmtInwords[i]}} Only ( {{details.get('estimate_net_profit_percent').value }} % ) + {{"₹"}} {{AV_netProfitAmtInwords[i]}} Only
@@ -280,9 +287,13 @@ - {{"₹"}} {{AV_marginLossAmtInwords[i]}} Only ( {{"₹"}} {{details.get('estimate_loss_margin').value}} ) + + + + {{"₹"}} {{AV_marginLossAmtInwords[i]}} Only +
@@ -293,9 +304,12 @@ {{"₹"}} {{AV_netLossAmtToInwords[i]}} Only + + + - {{"₹"}} {{AV_netLossAmtInwords[i]}} Only ( {{details.get('estimate_net_loss_percent').value }} % ) + {{"₹"}} {{AV_netLossAmtInwords[i]}} Only diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.scss index 0903f5e91..50bb8d9e9 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.scss @@ -17,7 +17,9 @@ // background: #62B013; // color: white; // } - +.mat-form-field-appearance-legacy .mat-hint{ + color:rgba(0, 0, 0, 0.8) !important; +} .underline input { border: none; } 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 de9d1fa0f..c19781f41 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 @@ -491,7 +491,7 @@ export class FinancialInfoComponent implements OnInit { * And calculating Variation over sales */ calMargin(index, detail) { -// In financial details section please add the following validation: Net profit/loss can not be > sales. + // In financial details section please add the following validation: Net profit/loss can not be > sales. let salary = detail.value.financial_annual_sale; let profit_margin; let loss_margin; 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 f115114a7..ff46bccd8 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 @@ -72,12 +72,13 @@ - Business Use. + {{ list.end_use_of_topup }} + @@ -131,7 +132,7 @@ + formControlName="owner_name" [compareWith]="compareObjects" > {{val.name}} 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 a29b66f15..d17fd15d9 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 @@ -60,6 +60,7 @@ export class LoanDetailsComponent implements OnInit { m_mortageTypeProperty = []; m_statusofCunstruction = []; m_btLenderList = []; + m_endUseOFTopUpList = []; // existCompanyList: any =[]; CompanyApplicantGroupList: any=[]; CompanyApplicantGroupList2: any=[]; @@ -135,6 +136,7 @@ export class LoanDetailsComponent implements OnInit { this.getM_MortageTypeProperty(); this.getM_StatusofCunstruction(); this.getM_BTLenderList(); + this.getM_EndUseofTopUpList(); this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{ if(data.dataStatus){ @@ -304,8 +306,14 @@ export class LoanDetailsComponent implements OnInit { if(this.productAbbr == 'BL' || this.productAbbr == 'PL' || this.productAbbr == 'LL'){ this.mortageCardAccess = false; + this.loanDetailsForm.controls['owner_name'].clearValidators(); + this.loanDetailsForm.controls['owner_name'].updateValueAndValidity(); + }else{ this.mortageCardAccess = true; + this.loanDetailsForm.controls['owner_name'].setValidators([Validators.required]); + this.loanDetailsForm.controls['owner_name'].updateValueAndValidity(); + } } @@ -415,6 +423,17 @@ getM_sourceofamount() { }) } + + getM_EndUseofTopUpList(){ + this._pd.getAllMasterDatas('ENDUSEOFTOPUP').subscribe( + data => { + this.m_endUseOFTopUpList = data.records.filter(data => data.is_active == 1); + }) + } + + + + // compare objects for merge two master table details compareObjects(o1: any, o2: any) { if(o1.id == o2.id && o1.group_id == o2.group_id) @@ -491,11 +510,14 @@ getM_sourceofamount() { if(OthersAvaliable == 'others') { this.isOtherPurpose = true; + this.loanDetailsForm.controls['end_use_other'].setValidators([Validators.required]); + }else { + this.loanDetailsForm.controls['end_use_other'].clearValidators(); this.isOtherPurpose = false; } - + this.loanDetailsForm.controls['end_use_other'].updateValueAndValidity(); //this.isOtherPurpose = event.some(e => e == 'others') // this return true or false Only; } @@ -508,7 +530,13 @@ getM_sourceofamount() { 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; - + if(this.isOtherSource){ + this.loanDetailsForm.controls['other_source'].setValidators([Validators.required]); + this.loanDetailsForm.controls['other_source'].updateValueAndValidity(); + }else{ + this.loanDetailsForm.controls['other_source'].clearValidators(); + this.loanDetailsForm.controls['other_source'].updateValueAndValidity(); + } this.sourceList = []; evt.forEach(option => { @@ -534,22 +562,43 @@ getM_sourceofamount() { // }); } submitLoanDetails() { - // if (!this.loanDetailsForm.valid) { - // this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); - // return; - // } + + if(this.loanDetailsForm.controls['lender'].value == 1){ + this.loanDetailsForm.controls['other_bt_lender'].setValidators([Validators.required]); + this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity(); + } + else{ + this.loanDetailsForm.controls['other_bt_lender'].clearValidators(); + this.loanDetailsForm.controls['other_bt_lender'].updateValueAndValidity(); + } + + if(this.loanDetailsForm.controls['end_use_topup'].value == 1){ + this.loanDetailsForm.controls['other_end_use_topup'].setValidators([Validators.required]); + this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity(); + } + else{ + this.loanDetailsForm.controls['other_end_use_topup'].clearValidators(); + this.loanDetailsForm.controls['other_end_use_topup'].updateValueAndValidity(); + } + + if (!this.loanDetailsForm.valid) { + this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); + return; + } + let records: any = {}; records.pdid = this.pdid; records.formid = this.form_id; records.fk_createdby = this.pdid; records.loan_amount = this.loanDetailsForm.controls['loan_amount'].value; - // get end user final group data + // get end user final group data let dataEnd_user_data = []; this.loanDetailsForm.controls['end_use'].value.forEach(element => { dataEnd_user_data.push({end_use: element}) }); + records.end_use_group = dataEnd_user_data; if (this.isOtherPurpose) { @@ -599,44 +648,33 @@ getM_sourceofamount() { records.other_bt_lender = this.loanDetailsForm.controls['other_bt_lender'].value; } } - - + records.emi_level = this.loanDetailsForm.controls['emi_level'].value; if(this.mortageCardAccess == true){ + records.property_type = this.loanDetailsForm.controls['property_type'].value; records.property_type_others = this.loanDetailsForm.controls['property_type_others'].value; - // records.owner_name_group = this.ownerNames; - // console.log(this.loanDetailsForm.controls['owner_name'].value); let dataOwner_name = []; this.loanDetailsForm.controls['owner_name'].value.forEach(element => { dataOwner_name.push({owner_name: element}) }); - records.owner_name_group = dataOwner_name; - // if(this.loanDetailsForm.controls['other_owners_name'].value != null){ - // records.other_owners_name = this.loanDetailsForm.controls['other_owners_name'].value; - // }else{ records.other_owners_name = null; } + records.owner_name_group = dataOwner_name; records.construction_status = this.loanDetailsForm.controls['construction_status'].value; records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value; }else{ records.property_type = null; records.property_type_others = null; records.owner_name_group = null; - // records.other_owners_name = null; records.construction_status = null; records.emv_per_customer = null; } + if(this.isOtherSource){ 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 = ''; } - - - //records.percentage_of_construction = this.loanDetailsForm.controls['percentage_of_construction'].value; records.emv_per_customer = this.loanDetailsForm.controls['emv_per_customer'].value; - //records.value_per_agreement = this.loanDetailsForm.controls['value_per_agreement'].value; + records.loandetails_remarks = this.loanDetailsForm.controls['loandetails_remarks'].value; this._pd.saveForm(records).subscribe(data => { if(data.status == 200) { @@ -742,8 +780,12 @@ getM_sourceofamount() { // console.log(mortagetypes); if(mortagetypes.property_name=='Others (Please Specify)'){ this.mortageAccess = true; + this.loanDetailsForm.controls['property_type_others'].setValidators([Validators.required]); + this.loanDetailsForm.controls['property_type_others'].updateValueAndValidity(); }else{ this.mortageAccess = false; + this.loanDetailsForm.controls['property_type_others'].clearValidators(); + this.loanDetailsForm.controls['property_type_others'].updateValueAndValidity(); } } 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 d27bf2482..670a49894 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 @@ -34,7 +34,8 @@ - + + Yes No @@ -43,37 +44,88 @@ -
-
- - - - - - - -
+ +
+
+ + + + + + + +
+
+ +
+ +
+ +
+ - + + + + + +
+ +
+ + + {{list.applicant_name}} + + +
+ +
+ + + +
+ +
+ +
+
+ +
+ +
+
+
- +
+ + + Positive + Negative + + +
@@ -148,8 +200,8 @@ delete --> - 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 5d5ad9eb7..3fdc14c5f 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 @@ -15,21 +15,26 @@ export class NeighbourHoodComponent implements OnInit { lender_applicant_id: any; main_applicant: any; pageTitle: string = "Neighbourhood Check / Reference Check"; + isDisplay:any = []; + isDisplay2:any = []; public _neighbourhoodForm: FormGroup; pdid : string; form_id:number; private notifier: NotifierService; + 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':''}; + default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know_in_year':'','how_long_do_know_in_month':'','is_applicant_owner':'','did_not_know_the_business_operation':'','organisation_owner':'','other_organisation_owner':'','did_not_know_the_owner':''}; busineesRelationshipList:any=[]; volumeunitList:any=[]; + applicants:any = []; errorMessage:any; finalRemarksList : any = [{'id': 1,'name': "Positive"}, {'id': 2,'name': "Negative"}, {'id': 3,'name': "Insufficient information provided"}]; amtInwords : any = []; + isOtherApplicant: boolean; 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; this.notifier = notifier; @@ -38,6 +43,11 @@ export class NeighbourHoodComponent implements OnInit { this.lender_applicant_id = this.data.pdmaster_details.lender_applicant_id; this.subproduct_abbr = this.data.pdmaster_details.subproduct_abbr; this.customer_segment_abbr = this.data.pdmaster_details.customer_segment_abbr; + 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"}) + // console.log(this.applicants); + } ngOnInit() { @@ -73,6 +83,7 @@ export class NeighbourHoodComponent implements OnInit { formid:this.form_id, check_type:0, neighbourhood_list: this._fb.array([]), + neighbourhood_status:'', referencecheck_list: this._fb.array([]), neighbour_reference_remark:'' }); @@ -97,19 +108,24 @@ export class NeighbourHoodComponent implements OnInit { let exist_ref_details = data.records.referencecheck_list ? Object.keys(data.records.referencecheck_list).map((item)=>data.records.referencecheck_list[item]) : []; let exist_neighbourhood_details = data.records.neighbourhood_list ? Object.keys(data.records.neighbourhood_list).map((item)=>data.records.neighbourhood_list[item]) : []; if(exist_neighbourhood_details.length>0 && data.records.check_type==0){ - exist_neighbourhood_details.forEach(element => { + exist_neighbourhood_details.forEach((element,index) => { + this.toggleVisibility(element.did_not_know_the_business_operation,index,1); + this.toggleVisibility(element.did_not_know_the_owner,index,2); + this.selectedApplicants(referencecheckControl,element.organisation_owner); neighbourhoodControl.push(this.createNeighbourhood(element)); }); } else if(exist_ref_details.length>0 && data.records.check_type==1){ exist_ref_details.forEach((element,index) => { this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount); + referencecheckControl.push(this.createReerenceCheck(element)); }); } - + this._neighbourhoodForm.controls['neighbourhood_status'].setValue(data.records.check_type==0 ? data.records.neighbourhood_status : ''); this._neighbourhoodForm.controls['neighbour_reference_remark'].setValue(data.records.neighbour_reference_remark ? data.records.neighbour_reference_remark : ''); this._neighbourhoodForm.controls['check_type'].setValue(data.records.check_type==1 ? 1 : data.records.check_type==0 ? 0 : ''); + } else { @@ -183,9 +199,13 @@ export class NeighbourHoodComponent implements OnInit { return this._fb.group({ neighbourhood_name: [elementValue.neighbourhood_name], do_know: [elementValue.do_know], + did_not_know_the_business_operation: [elementValue.did_not_know_the_business_operation], how_long_do_know_in_year: [elementValue.how_long_do_know_in_year], how_long_do_know_in_month: [elementValue.how_long_do_know_in_month], is_applicant_owner: [elementValue.is_applicant_owner], + organisation_owner: [elementValue.organisation_owner], + other_organisation_owner:[elementValue.other_organisation_owner], + did_not_know_the_owner:[elementValue.did_not_know_the_owner] }); } @@ -229,9 +249,13 @@ export class NeighbourHoodComponent implements OnInit { neighbourhood_list.push({ "neighbourhood_name":element.neighbourhood_name, "do_know":element.do_know, + "did_not_know_the_business_operation":element.did_not_know_the_business_operation, "how_long_do_know_in_year":element.how_long_do_know_in_year, "how_long_do_know_month":element.how_long_do_know_month, "is_applicant_owner":element.is_applicant_owner, + "organisation_owner":element.organisation_owner, + "other_organisation_owner":element.other_organisation_owner, + "did_not_know_the_owner":element.did_not_know_the_owner }) }); saveRecords.neighbourhood_list=neighbourhood_list; @@ -266,6 +290,7 @@ export class NeighbourHoodComponent implements OnInit { saveRecords.check_type=formData.check_type; saveRecords.pdid=formData.pdid; saveRecords.formid=formData.formid; + saveRecords.neighbourhood_status = formData.check_type == 0 ? formData.neighbourhood_status : ''; saveRecords.neighbour_reference_remark=formData.neighbour_reference_remark; this._pd.savePDFormDetailsWithID(saveRecords).subscribe( dataresult => { @@ -320,6 +345,30 @@ validateAllFormFields(formGroup: any) { } } +toggleVisibility(e,index,flag){ + // console.log(e,index); + if(flag == 1){ + this.isDisplay[index] = e; + } + else if(flag==2){ + this.isDisplay2[index] = e; + } +} + +selectedApplicants(items,e){ + + if(e != 0){ + this.isOtherApplicant = false; + items.controls['other_organisation_owner'].setValue(''); + items.controls['other_organisation_owner'].clearValidators(); + }else{ + this.isOtherApplicant = true; + items.controls['other_organisation_owner'].setValidators([Validators.required]); + } + + items.controls['other_organisation_owner'].updateValueAndValidity(); +} + /** Amount InWords */ inWords(e,i){ this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value); 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 b04ebe0c8..02f50196e 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 @@ -50,7 +50,7 @@
- + @@ -483,7 +483,7 @@
-
Fill Business Form First! / No Company Found at this ID {{company_id}}! ....
+
Loading...
- + + + {{ pm.name }} + + +
+ + + Payment received in Cash. + Payment received through Banking channels. + + +
@@ -137,7 +149,7 @@ - + Select {{comrelShip.name}} @@ -166,9 +178,19 @@
- + + + {{ pm.name }} + + + + + Payment received in Cash. + Payment received through Banking channels. + +