Changes : ps
This commit is contained in:
parent
abafc5ad3d
commit
7906b237c1
Binary file not shown.
@ -161,7 +161,11 @@
|
||||
<mat-form-field style="width:40%" *ngIf="detail.get('investments_type').value == 1">
|
||||
<input matInput placeholder="Specify Type" formControlName="other_investments_type" autocomplete="off">
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
<mat-form-field style="width:54%" *ngIf="detail.get('investments_type').value == 6 || detail.get('investments_type').value == 5 || detail.get('investments_type').value == 4">
|
||||
<input matInput autocomplete="off" placeholder="Name of organisation in which investment done" formControlName="in_which_organisation">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:40%">
|
||||
<input matInput placeholder="Current Market Value" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,10)">
|
||||
|
||||
@ -227,7 +231,7 @@
|
||||
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('approximate_market_value').value != ''">{{"₹"}} {{OtherAppxMarketAmtInwords[i]}} Only</mat-hint>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5 || sup.get('assets_mode').value == 6" style="width:45%">
|
||||
<mat-form-field *ngIf="sup.get('assets_mode').value != ''" style="width:45%"><!-- 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5 || sup.get('assets_mode').value == 6" style="width:45%"> -->
|
||||
<!-- <mat-select placeholder="Name of the Owner" formControlName="name_of_the_owner" >
|
||||
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name | titlecase}}</mat-option>
|
||||
</mat-select> -->
|
||||
|
||||
@ -44,19 +44,19 @@ export class AssetsInfoComponent implements OnInit {
|
||||
public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"},
|
||||
{'value': "no",'viewValue': "No"},
|
||||
{'value': "nan",'viewValue': "NA"}]
|
||||
appxMarketAmtInwords : any = [];
|
||||
// appxMarketAmtInwords : any = [];
|
||||
OtherAppxMarketAmtInwords : any = [];
|
||||
emiAmtInwords : any = [];
|
||||
// emiAmtInwords : any = [];
|
||||
OtherEmiAmtInwords : any = [];
|
||||
PremiumPaidInwords : any = [];
|
||||
// PremiumPaidInwords : any = [];
|
||||
OtherPremiumPaidInwords: any = [];
|
||||
SumAssuredInwords: any = [];
|
||||
// SumAssuredInwords: any = [];
|
||||
OtherSumAssuredInwords: any = [];
|
||||
AmtInvestInwords: any = [];
|
||||
// AmtInvestInwords: any = [];
|
||||
OtherAmtInvestInwords: any = [];
|
||||
AssetValueInwords: any = [];
|
||||
// AssetValueInwords: any = [];
|
||||
OtherAssetValueInwords: any = [];
|
||||
B_emiAmtInwords: any = [];
|
||||
// B_emiAmtInwords: any = [];
|
||||
O_emiAmtInwords: any = [];
|
||||
|
||||
public m_propertyType = [];
|
||||
@ -146,7 +146,8 @@ export class AssetsInfoComponent implements OnInit {
|
||||
getM_Assets_Type() {
|
||||
this.pdTrigerService.getAllMasterDatas('ASSETTYPE').subscribe(
|
||||
data => {
|
||||
this.m_assets_type = data.records.filter(data => data.isactive == 1 && data.id != 4);
|
||||
this.m_assets_type = data.records.filter(data => data.isactive == 1 && data.id != 5
|
||||
);
|
||||
},
|
||||
error => {
|
||||
this.notifier.notify('warning', 'No Category Records Found.!');
|
||||
@ -387,13 +388,13 @@ export class AssetsInfoComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
otherBusinessAssetsDescription() {
|
||||
return this._formBuilder.group({
|
||||
any_other_assets: [''],
|
||||
any_other_asset_value : [''],
|
||||
any_other_asset_loan : [''],
|
||||
});
|
||||
}
|
||||
// otherBusinessAssetsDescription() {
|
||||
// return this._formBuilder.group({
|
||||
// any_other_assets: [''],
|
||||
// any_other_asset_value : [''],
|
||||
// any_other_asset_loan : [''],
|
||||
// });
|
||||
// }
|
||||
|
||||
loadInsuranceDescription() {
|
||||
return this._formBuilder.group({
|
||||
@ -411,7 +412,8 @@ export class AssetsInfoComponent implements OnInit {
|
||||
investments_type: [''],
|
||||
other_investments_type:[''],
|
||||
amount_of_invest: [''],
|
||||
bank_name: ['']
|
||||
bank_name: [''],
|
||||
in_which_organisation:['']
|
||||
});
|
||||
}
|
||||
|
||||
@ -489,6 +491,7 @@ export class AssetsInfoComponent implements OnInit {
|
||||
investments_type: [data.investments_type],
|
||||
other_investments_type : [data.other_investments_type],
|
||||
amount_of_invest: [data.amount_of_invest],
|
||||
in_which_organisation:[data.in_which_organisation],
|
||||
bank_name: [data.bank_name]
|
||||
});
|
||||
}
|
||||
@ -522,22 +525,22 @@ export class AssetsInfoComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
initBusinessDetailsWithdata(data) {
|
||||
// initBusinessDetailsWithdata(data) {
|
||||
|
||||
let formGroup= this._formBuilder.group({
|
||||
business_assets_mode: [data.business_assets_mode],
|
||||
business_details: this._formBuilder.array([]),
|
||||
business_approximate_market_value: [data.business_approximate_market_value],
|
||||
business_name_of_the_owner: [data.business_name_of_the_owner],
|
||||
business_name_of_the_other_owner:[data.business_name_of_the_other_owner || ''],
|
||||
// relation: [data.relation || ''],
|
||||
business_vintage: [data. business_vintage],
|
||||
business_purchase_year: [data. business_purchase_year,Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
|
||||
// purchase_month: [data.purchase_month],
|
||||
business_emi: [data.business_emi || 0],
|
||||
});
|
||||
return formGroup;
|
||||
}
|
||||
// let formGroup= this._formBuilder.group({
|
||||
// business_assets_mode: [data.business_assets_mode],
|
||||
// business_details: this._formBuilder.array([]),
|
||||
// business_approximate_market_value: [data.business_approximate_market_value],
|
||||
// business_name_of_the_owner: [data.business_name_of_the_owner],
|
||||
// business_name_of_the_other_owner:[data.business_name_of_the_other_owner || ''],
|
||||
// // relation: [data.relation || ''],
|
||||
// business_vintage: [data. business_vintage],
|
||||
// business_purchase_year: [data. business_purchase_year,Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
|
||||
// // purchase_month: [data.purchase_month],
|
||||
// business_emi: [data.business_emi || 0],
|
||||
// });
|
||||
// return formGroup;
|
||||
// }
|
||||
|
||||
loadDetails: boolean;
|
||||
addAssetsDetailsWithData(supp_data) {
|
||||
@ -654,6 +657,7 @@ export class AssetsInfoComponent implements OnInit {
|
||||
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
|
||||
array_data = { 'investments_type': datas.investments_type,
|
||||
'other_investments_type' : datas.other_investments_type,
|
||||
'in_which_organisation' : datas.in_which_organisation,
|
||||
'amount_of_invest': datas.amount_of_invest,
|
||||
'bank_name': datas.bank_name };
|
||||
});
|
||||
@ -715,24 +719,17 @@ export class AssetsInfoComponent implements OnInit {
|
||||
|
||||
// calculate vintage and purchase {}
|
||||
calculateVintagePurchase(value: any, controlKey: any,type: number){
|
||||
if(type==1){
|
||||
let control: any = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
|
||||
control.controls[controlKey].controls['business_purchase_year'].setValue(value!='' ? parseInt(this.currentYear)-parseInt(value) : '');
|
||||
}
|
||||
else if(type==2) {
|
||||
let control: any = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
|
||||
value!='' && value<=this.currentYear ? control.controls[controlKey].controls['business_purchase_year'].setValue(value) : control.controls[controlKey].controls['business_purchase_year'].setValue('');
|
||||
value!='' && value<=this.currentYear ? control.controls[controlKey].controls['business_vintage'].setValue(parseInt(this.currentYear)-parseInt(value)) : control.controls[controlKey].controls['business_vintage'].setValue('')
|
||||
}
|
||||
else if(type==3){
|
||||
if(type==1){}
|
||||
else if(type==2) {}
|
||||
else if(type==3){
|
||||
let control: any = <FormArray>this._assetsQuesFrom.controls['assets_details'];
|
||||
control.controls[controlKey].controls['purchase_year'].setValue(value!='' ? parseInt(this.currentYear)-parseInt(value) : '');
|
||||
}
|
||||
else if(type==4) {
|
||||
}
|
||||
else if(type==4) {
|
||||
let control: any = <FormArray>this._assetsQuesFrom.controls['assets_details'];
|
||||
value!='' && value<=this.currentYear ? control.controls[controlKey].controls['purchase_year'].setValue(value) : control.controls[controlKey].controls['purchase_year'].setValue('');
|
||||
value!='' && value<=this.currentYear ? control.controls[controlKey].controls['vintage_personal'].setValue(parseInt(this.currentYear)-parseInt(value)) : control.controls[controlKey].controls['vintage_personal'].setValue('')
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -798,14 +795,14 @@ export class AssetsInfoComponent implements OnInit {
|
||||
details.controls['elapsed_tenure'].setValue(ElapsedValues);
|
||||
}
|
||||
}
|
||||
else if(flag == 2){
|
||||
let BusinessElapsedValues;
|
||||
// else if(flag == 2){
|
||||
// let BusinessElapsedValues;
|
||||
|
||||
if(details.value.business_original_loan_tenure != null && details.value.business_original_loan_tenure != '' && details.value.business_balance_tenure != null && details.value.business_balance_tenure != ''){
|
||||
BusinessElapsedValues = details.value.business_original_loan_tenure - details.value.business_balance_tenure ;
|
||||
details.controls['business_elapsed_tenure'].setValue(BusinessElapsedValues);
|
||||
}
|
||||
}
|
||||
// if(details.value.business_original_loan_tenure != null && details.value.business_original_loan_tenure != '' && details.value.business_balance_tenure != null && details.value.business_balance_tenure != ''){
|
||||
// BusinessElapsedValues = details.value.business_original_loan_tenure - details.value.business_balance_tenure ;
|
||||
// details.controls['business_elapsed_tenure'].setValue(BusinessElapsedValues);
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@ -813,43 +810,43 @@ export class AssetsInfoComponent implements OnInit {
|
||||
inWords(e,i,flag){
|
||||
switch(flag){
|
||||
case 1 :
|
||||
this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 2 :
|
||||
this.OtherAppxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 3 :
|
||||
this.emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// this.emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 4 :
|
||||
this.OtherEmiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 5 :
|
||||
this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 6 :
|
||||
this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 7 :
|
||||
this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 8 :
|
||||
this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 9 :
|
||||
this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 10 :
|
||||
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 11 :
|
||||
this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 12 :
|
||||
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 13:
|
||||
this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
// this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
break;
|
||||
case 14:
|
||||
this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
|
||||
@ -858,4 +855,20 @@ inWords(e,i,flag){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// {id: "4", name: "Equipments and machinaries", isactive: "1", flag: "1", is_others: "0"}
|
||||
|
||||
// {id: "7", name: "Investments", isactive: "1", flag: "0", is_others: "0"}
|
||||
|
||||
// {id: "5", name: "Jewellery", isactive: "1", flag: "0", is_others: "0"}
|
||||
|
||||
// {id: "6", name: "Life Insurance Policy", isactive: "1", flag: "0", is_others: "0"}
|
||||
|
||||
// {id: "2", name: "Property", isactive: "1", flag: "1", is_others: "0"}
|
||||
|
||||
// {id: "3", name: "Vehicle", isactive: "1", flag: "1", is_others: "0"}
|
||||
|
||||
// {id: "1", name: "Others", isactive: "1", flag: "1", is_others: "1"}
|
||||
@ -49,7 +49,7 @@
|
||||
formControlName="shareholding">
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 45%;">
|
||||
<mat-select placeholder="Started Business" formControlName="started_business">
|
||||
<mat-select placeholder="Started Business" formControlName="started_business" (selectionChange)="changeOfStartedBusiness(members,i,$event.value);">
|
||||
<mat-option value="">Select</mat-option>
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
@ -62,11 +62,12 @@
|
||||
<div fxLayout="row nowrap" class="state-margin" *ngIf='!EntityTypeFlag'>
|
||||
|
||||
<mat-form-field style="width: 20%;">
|
||||
<input matInput placeholder="Year" formControlName="current_business_experiance_year" (keyup)="getWorkExperience(members.value,i)" required autocomplete="off" (keypress)="keyPress($event)" (change)="checkWithExistBusinessYear($event.target.value,i,members)" >
|
||||
<mat-hint style="color: red;">{{errorMessage[i]}}</mat-hint>
|
||||
<input matInput placeholder="Year" formControlName="current_business_experiance_year" (keyup)="getWorkExperience(members.value,i)" required autocomplete="off" (keypress)="keyPress($event)" (change)="checkWithExistBusinessYear($event.target.value,i,members)" [readonly]="isreadonlyyear[i]" >
|
||||
<mat-hint style="color: red;">{{yearErrorMessage[i]}}</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 21%;">
|
||||
<input matInput placeholder="Month" formControlName="current_business_experiance_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear(members,$event.target.value)" autocomplete="off">
|
||||
<input matInput placeholder="Month" formControlName="current_business_experiance_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear(members,$event.target.value,i)" autocomplete="off" [readonly]="isreadonlymonth[i]" >
|
||||
<mat-hint style="color: red;">{{monthErrorMessage[i]}}</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 35%;">
|
||||
<input matInput placeholder="Total Work Experience"
|
||||
@ -273,7 +274,7 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width:84%;" *ngIf="manufacturing.value.pan_india_options=='No'">
|
||||
<mat-label>Countries Where Max Sales Done for {{manufacturing.value.main_products}}</mat-label>
|
||||
<mat-label>Cities Where Max Sales Done for {{manufacturing.value.main_products}}</mat-label>
|
||||
<mat-select multiple placeholder="Cities" formControlName="city_name">
|
||||
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name,manufacturing.get('india_where_sale_done').value)" [value]="MCL.city_id">
|
||||
{{MCL.city_name}}
|
||||
|
||||
@ -67,10 +67,13 @@ export class BusinessInfoComponent implements OnInit {
|
||||
generalExistEntityType_other:string;
|
||||
generalExistBusinessYear:Number;
|
||||
generalExistBusinessMonth:Number;
|
||||
errorMessage: any = [];
|
||||
yearErrorMessage: any = [];
|
||||
monthErrorMessage: any = [];
|
||||
errorMessageForExistTotalWorkExperience:any = [];
|
||||
ExportFlag: boolean = false;
|
||||
appxSalaryAmtInwords: any;
|
||||
isreadonlyyear:any = [];
|
||||
isreadonlymonth:any = [];
|
||||
|
||||
constructor(notifier: NotifierService,
|
||||
private fb: FormBuilder,
|
||||
@ -89,7 +92,7 @@ export class BusinessInfoComponent implements OnInit {
|
||||
this.generalExistEntityType = this.pd_all_details.business_entity_type;
|
||||
this.generalExistEntityType_other = this.pd_all_details.business_entity_type_other;
|
||||
this.generalExistBusinessYear = this.pd_all_details.business_years;
|
||||
|
||||
this.generalExistBusinessMonth = this.pd_all_details.business_month;
|
||||
}
|
||||
public viewerOptions: any = {
|
||||
navbar: false,
|
||||
@ -200,6 +203,9 @@ export class BusinessInfoComponent implements OnInit {
|
||||
businessVal.formid = this.form_id;
|
||||
businessVal.company_id = this.company_id;
|
||||
businessVal.fk_createdby = this.pdid;
|
||||
if(businessVal.employees_appx_salary){
|
||||
this.appxSalaryAmtInwords = this._pd.convertNumberToWords(businessVal.employees_appx_salary);
|
||||
}
|
||||
//businessVal.designation = DesgnArray;
|
||||
businessVal.partners = PartnrArray;
|
||||
businessVal.documents = DocArray;
|
||||
@ -1282,15 +1288,38 @@ export class BusinessInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
/** To Convert Month into Year */
|
||||
ConvertMonthintoYear(itemrow,e){
|
||||
ConvertMonthintoYear(itemrow,e,i){
|
||||
|
||||
let year = itemrow.controls.current_business_experiance_year.value;
|
||||
|
||||
let converted_month : number = e%12;
|
||||
let converted_year : number = e/12;
|
||||
|
||||
itemrow.controls.current_business_experiance_year.setValue(+year + +Math.floor(converted_year));
|
||||
itemrow.controls.current_business_experiance_month.setValue(Math.floor(converted_month));
|
||||
let Year = +year + +Math.floor(converted_year);
|
||||
|
||||
if(Year > this.generalExistBusinessYear){
|
||||
this.yearErrorMessage[i] = "Higher than Business Vintage";
|
||||
itemrow.controls.current_business_experiance_year.setValue('');
|
||||
itemrow.controls.current_business_experiance_month.setValue('');
|
||||
|
||||
}
|
||||
else{
|
||||
if(Year == this.generalExistBusinessYear && +converted_month > this.generalExistBusinessMonth)
|
||||
{
|
||||
this.monthErrorMessage[i] = "Higher than Business Vintage";
|
||||
itemrow.controls.current_business_experiance_year.setValue('');
|
||||
itemrow.controls.current_business_experiance_month.setValue('');
|
||||
|
||||
}else{
|
||||
this.monthErrorMessage[i] = '';
|
||||
this.yearErrorMessage[i] = '';
|
||||
itemrow.controls.current_business_experiance_year.setValue(Year);
|
||||
itemrow.controls.current_business_experiance_month.setValue(Math.floor(converted_month));
|
||||
}
|
||||
}
|
||||
|
||||
// itemrow.controls.current_business_experiance_year.setValue(+year + +Math.floor(converted_year));
|
||||
// itemrow.controls.current_business_experiance_month.setValue(Math.floor(converted_month));
|
||||
|
||||
}
|
||||
|
||||
@ -1573,14 +1602,29 @@ export class BusinessInfoComponent implements OnInit {
|
||||
checkTotalEmployee(FormData){
|
||||
this.businessForm.controls['employees_total'].setValue((+FormData.value.employees_permanent ||0)+(+FormData.value.employees_temporary||0));
|
||||
}
|
||||
|
||||
changeOfStartedBusiness(members,i,e){
|
||||
if(e == 'yes'){
|
||||
members.controls.current_business_experiance_year.setValue(this.generalExistBusinessYear);
|
||||
this.isreadonlyyear[i] = this.generalExistBusinessYear != undefined ? true : false;
|
||||
members.controls.current_business_experiance_month.setValue(this.generalExistBusinessMonth);
|
||||
this.isreadonlymonth[i] = this.generalExistBusinessMonth != undefined ? true : false;
|
||||
}
|
||||
else{
|
||||
this.isreadonlyyear[i] =false;
|
||||
this.isreadonlymonth[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
checkWithExistBusinessYear(e,i,members){
|
||||
|
||||
if(+e > this.generalExistBusinessYear){
|
||||
this.errorMessage[i] = "Higher than Business Vintage";
|
||||
this.yearErrorMessage[i] = "Higher than Business Vintage";
|
||||
members.controls.current_business_experiance_year.setValue('');
|
||||
}
|
||||
else{
|
||||
this.errorMessage[i] = '';
|
||||
this.yearErrorMessage[i] = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field style="width: 60%" [style.visibility]="applicant.get('qualification').value == '' ? 'hidden':'visible'">
|
||||
<input matInput placeholder="Specify Qualification" formControlName="course_name" autocomplete="off">
|
||||
<input matInput placeholder="Qualification Details" formControlName="course_name" autocomplete="off">
|
||||
</mat-form-field>
|
||||
|
||||
<div fxLayout="row wrap">
|
||||
|
||||
@ -290,7 +290,7 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div>
|
||||
<h5>Residence Details</h5>
|
||||
<h5>Residence Details of {{FamilyMemberAsLabel[ix]}}</h5>
|
||||
<mat-form-field style="width:45%;">
|
||||
<mat-select matInput placeholder="State" formControlName="residence_state" required (selectionChange)="getCity($event.value,ix)" >
|
||||
<mat-option value="{{s.state_id}}" *ngFor="let s of stateData">
|
||||
@ -361,6 +361,7 @@
|
||||
<div formArrayName="family_members_details">
|
||||
<div *ngFor="let item of sup.controls.family_members_details['controls']; let i=index; let last=last " [formGroupName]="i">
|
||||
<mat-card>
|
||||
<h5>Address Details of {{FamilyMemberAsLabel[ix]}}</h5>
|
||||
<div>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Name" formControlName="family_member_name" required>
|
||||
@ -373,7 +374,7 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Age" formControlName="family_member_age" required>
|
||||
<input matInput placeholder="Age" formControlName="family_member_age" [readonly]="isReadOnly[i]">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div>
|
||||
@ -419,7 +420,7 @@
|
||||
<mat-form-field *ngIf="item.get('non_earning_occupation').value==1">
|
||||
<input matInput placeholder="Specify Others" formControlName="non_earning_if_others">
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="item.get('non_earning_occupation').value==2">
|
||||
<mat-form-field *ngIf="item.get('non_earning_occupation').value==2" style="width:30%">
|
||||
<input matInput placeholder="Specify School/College Name" formControlName="non_earning_if_schoolorcollege">
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="item.get('non_earning_occupation').value==3">
|
||||
@ -429,15 +430,15 @@
|
||||
</div>
|
||||
<mat-card-actions>
|
||||
<div align="right">
|
||||
<button type="button" mat-raised-button mat-icon-button (click)="removeFamilyMembers(i)"
|
||||
matTooltip="Delete Family Members" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last">
|
||||
<button type="button" mat-raised-button mat-icon-button (click)="removeFamilyMembers(ix,i)"
|
||||
matTooltip="Delete Family Members" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="sup.controls.family_members_details.controls.length>1">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div align="center">
|
||||
<button type="button" mat-flat-button (click)="addFamilyMembers(i)"
|
||||
<button type="button" mat-flat-button (click)="addFamilyMembers(ix,i)"
|
||||
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
|
||||
<strong>Add More Family Members </strong>
|
||||
<strong>Add More Family Members Of {{FamilyMemberAsLabel[ix]}} </strong>
|
||||
</button>
|
||||
</div>
|
||||
</mat-card-actions>
|
||||
@ -567,15 +568,23 @@
|
||||
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions>
|
||||
<!-- <div fxFlex="100" align="center">
|
||||
|
||||
</div> -->
|
||||
<div fxFlex="60" class="pb-0 text-sm-left" align="left">
|
||||
<mat-form-field appearance="outline" style="width: 100%">
|
||||
<mat-label>Remarks</mat-label>
|
||||
<textarea matInput placeholder="Remarks" formControlName="family_details_form_remark"></textarea>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxFlex="40" align="end">
|
||||
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Applicant Family Details" matTooltipPosition="above"
|
||||
class="mr-1 mb-1 hover-icon" (click)="addMoreApplicantFamilyDetails($event); false"><mat-icon>add</mat-icon></button>
|
||||
<!-- <button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="" matTooltipPosition="above"
|
||||
class="mr-1 mb-1 hover-icon" ><mat-icon>add</mat-icon></button> -->
|
||||
<button type="button" mat-flat-button (click)="addMoreApplicantFamilyDetails($event); false"
|
||||
matTooltip="Add More" matTooltipPosition="left" color="primary">
|
||||
<strong>Add Family Details of Other Applicant </strong>
|
||||
</button>
|
||||
<button type="submit" mat-raised-button mat-icon-button type="submit" matTooltip="Submit" matTooltipPosition="above" (click)="submitFamily()"><mat-icon>save</mat-icon></button>
|
||||
</div>
|
||||
</mat-dialog-actions>
|
||||
|
||||
@ -297,10 +297,12 @@ import { ActivatedRoute, Router } from "@angular/router";
|
||||
export class FamilyDetailsComponent implements OnInit {
|
||||
IncomePerMonth: any =[];
|
||||
RentAmount: any = [];
|
||||
FamilyMemberAsLabel: any = [];
|
||||
//@Input() pdid: number;
|
||||
pageTitle: string = "Family Details";
|
||||
pdid: string;
|
||||
form_id: number;
|
||||
isReadOnly:any = [];
|
||||
|
||||
private notifier: NotifierService;
|
||||
public familyForm: FormGroup;
|
||||
@ -377,6 +379,7 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
name:element.applicant_name,
|
||||
relationship:element.relationship,
|
||||
relation_to:element.relation_to,
|
||||
age:'',
|
||||
data_gets_from:'GeneralForm'};
|
||||
});
|
||||
// console.log('familyMembersGeneralForm',familyMembersGeneralForm);
|
||||
@ -393,6 +396,7 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
name:element.family_member_name,
|
||||
relationship:element.other_family_relationship_id,
|
||||
relation_to:element.relation_to_id,
|
||||
age:'',
|
||||
data_gets_from:'BusinessForm'};
|
||||
});
|
||||
// console.log('familyMembersGeneralForm',familyMembersBusinessForm);
|
||||
@ -623,24 +627,30 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
|
||||
addMoreApplicantFamilyDetails(e): void {
|
||||
e.stopPropagation();
|
||||
this.initFamilyForm('chck');
|
||||
this.initFamilyForm(null);
|
||||
}
|
||||
selectedPerson(e,inx){
|
||||
// console.log(e);
|
||||
// console.log(this.apiFamilyMembers);
|
||||
// return;
|
||||
|
||||
|
||||
|
||||
this.FamilyMemberAsLabel[inx] = this.selectPerson.filter(item => item.pd_co_applicant_id == e)[0].applicant_name;
|
||||
|
||||
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
|
||||
|
||||
if(this.apiFamilyMembers.length>0){
|
||||
let arraydata : any;
|
||||
let data = this.apiFamilyMembers.filter(item => item.relation_to == e);
|
||||
|
||||
if(data.length > 0){
|
||||
data.forEach(val => {
|
||||
data.forEach((val,inx) => {
|
||||
if(val.age){
|
||||
this.isReadOnly[inx] = true;
|
||||
}else{
|
||||
this.isReadOnly[inx] = false;
|
||||
}
|
||||
arraydata = {
|
||||
'family_member_name' : val.name,
|
||||
'family_member_relationship' : val.relationship,
|
||||
'family_member_age' : '',
|
||||
'family_member_age' : val.age,
|
||||
'family_member_earning_status': '',
|
||||
'earning_segment': '',
|
||||
'earning_gross_income_per_month': '',
|
||||
@ -654,7 +664,7 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
}
|
||||
|
||||
});
|
||||
control.push(this.initgenerateFamilyMembersDetailsGet(arraydata));
|
||||
control.push(this.initgenerateFamilyMembersDetailsGet(arraydata));
|
||||
}
|
||||
else{
|
||||
control.push(this.generateFamilyMembersDetailsGet());
|
||||
@ -665,15 +675,16 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
addFamilyMembers(inx) {
|
||||
console.log(inx);
|
||||
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
|
||||
control.push(this.generateFamilyMembersDetailsGet());
|
||||
addFamilyMembers(inx,i) {
|
||||
let mainControl = this.familyForm.get('family_details') as FormArray;
|
||||
let control = mainControl.controls[inx].get('family_members_details') as FormArray;
|
||||
control.push(this.generateFamilyMembersDetailsGet());
|
||||
}
|
||||
|
||||
removeFamilyMembers(index) {
|
||||
const control = <FormArray>this.familyForm.controls['family_details']['controls'][index].controls.family_members_details;
|
||||
control.removeAt(index);
|
||||
removeFamilyMembers(inx,i) {
|
||||
let mainControl = this.familyForm.get('family_details') as FormArray;
|
||||
let control = mainControl.controls[inx].get('family_members_details') as FormArray;
|
||||
control.removeAt(i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -139,8 +139,8 @@
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field style="width:45%">
|
||||
<input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_profit_to_sale_variation'].value > 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}" placeholder="Variation of Profit % over sales" formControlName="financial_profit_to_sale_variation" (keypress)="keyPress($event)">
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_profit_to_sale_variation').value != '' " [ngClass]="{'highlight': (details.controls['financial_profit_to_sale_variation'].value > 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}" readonly>
|
||||
<input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_profit_to_sale_variation'].value > 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}" placeholder="Variation of Profit % over sales" formControlName="financial_profit_to_sale_variation" (keypress)="keyPress($event)" readonly>
|
||||
<mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_profit_to_sale_variation').value != '' " [ngClass]="{'highlight': (details.controls['financial_profit_to_sale_variation'].value > 40) || (details.controls['financial_profit_to_sale_variation'].value < -40)}">
|
||||
<span *ngIf="details.get('financial_profit_to_sale_variation').value == 0">
|
||||
No difference in Profit sales % in FY <i> {{details.get('financial_year').value}} </i> over Profit sales % in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i>
|
||||
</span>
|
||||
|
||||
@ -501,7 +501,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
if (salary != '' && profit != '') {
|
||||
if(+profit>+salary){
|
||||
alert("profit is greater than salary");
|
||||
detail.controls.financial_net_profit.setValue('');
|
||||
detail.controls.financial_net_profit.setValue(0);
|
||||
detail.controls.financial_margin_of_profit.setValue('');
|
||||
detail.controls.financial_profit_to_sale_variation.setValue('');
|
||||
detail.controls.financial_variation.setValue('');
|
||||
@ -521,7 +521,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
if (salary != '' && loss != '') {
|
||||
if(+loss>+salary){
|
||||
alert("Loss is greater than salary");
|
||||
detail.controls.financial_net_loss.setValue('');
|
||||
detail.controls.financial_net_loss.setValue(0);
|
||||
detail.controls.financial_margin_of_loss.setValue('');
|
||||
detail.controls.financial_profit_to_sale_variation.setValue('');
|
||||
detail.controls.financial_variation.setValue('');
|
||||
@ -535,29 +535,28 @@ export class FinancialInfoComponent implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
if (((profit_margin != '' || profit_margin !== undefined) || (loss_margin != '' || loss_margin !== undefined) ) && index != 0) {
|
||||
if ((profit_margin != '' || loss_margin != '') && index != 0) {
|
||||
|
||||
console.log('Current profit_margin',profit_margin);
|
||||
|
||||
|
||||
let array = <FormArray>this.financialForm.controls['date_per_financial'];
|
||||
let prev_profit_margin = array.value[index - 1].financial__margin_of_profit != '' ? array.value[index - 1].financial_margin_of_profit : 0;
|
||||
let prev_loss_margin = array.value[index - 1].financial__margin_of_loss !='' ? array.value[index - 1].financial_margin_of_loss : 0 ;
|
||||
|
||||
loss_margin = loss_margin !== undefined ? loss_margin : 0;
|
||||
prev_loss_margin = prev_loss_margin !== undefined ? prev_loss_margin : 0 ;
|
||||
|
||||
console.log('pre profit_margin',prev_profit_margin);
|
||||
profit_margin = profit_margin !== undefined ? profit_margin:0;
|
||||
prev_profit_margin = prev_profit_margin !== undefined ? prev_profit_margin : 0 ;
|
||||
|
||||
let variation_percent : any ;
|
||||
|
||||
variation_percent = (((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))) * 100;
|
||||
|
||||
loss_margin = loss_margin != 0 ? loss_margin : loss_margin;
|
||||
prev_loss_margin = prev_loss_margin != 0 ? prev_loss_margin : prev_loss_margin ;
|
||||
// console.log((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ));
|
||||
// console.log((((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))));
|
||||
// console.log((((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))) * 100);
|
||||
|
||||
console.log('Current loss_margin',loss_margin);
|
||||
|
||||
console.log('pre loss_margin',prev_loss_margin);
|
||||
|
||||
let variation_percent = (((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))) * 100;
|
||||
console.log((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ));
|
||||
console.log((((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))));
|
||||
console.log((((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))) * 100);
|
||||
detail.controls.financial_profit_to_sale_variation.setValue(variation_percent.toFixed(2));
|
||||
detail.controls.financial_profit_to_sale_variation.setValue(variation_percent != Infinity ? variation_percent.toFixed(2) : 0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
<ng-container matColumnDef="course_name">
|
||||
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
|
||||
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i" [style.visibility]="_generalForm.controls.individuals.value[i].qualification == '' ? 'hidden':'visible'">
|
||||
<input matInput placeholder="Specify Qualification" formControlName="course_name" autocomplete="off">
|
||||
<input matInput placeholder="Qualification Details" formControlName="course_name" autocomplete="off">
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
|
||||
@ -55,8 +55,9 @@ export class StockComponent implements OnInit {
|
||||
public submitted = false;
|
||||
noRecordsFound: Boolean = false;
|
||||
serviceProviderForm: Boolean = false;
|
||||
suppliers_raw_materials : any = [];
|
||||
suppliers_trade_details : any = [];
|
||||
// suppliers_raw_materials : any = [];
|
||||
suppliers_retail_trade_details : any = [];
|
||||
suppliers_wholesale_trade_details : any = [];
|
||||
suppliers_finished_goods : any =[];
|
||||
suppliers_service_product : any = [];
|
||||
|
||||
@ -193,19 +194,19 @@ export class StockComponent implements OnInit {
|
||||
api.forEach(val => {
|
||||
if (val.type_of_activity_id == 2) {
|
||||
if(val.products){
|
||||
this.suppliers_raw_materials = val.products;
|
||||
this.suppliers_finished_goods = val.products;
|
||||
this.initManufacturingDetails(null);
|
||||
}
|
||||
}
|
||||
if (val.type_of_activity_id == 3) {
|
||||
if(val.products){
|
||||
this.suppliers_finished_goods = val.products;
|
||||
this.suppliers_retail_trade_details = val.products;
|
||||
this.initRetailDetails(null);
|
||||
}
|
||||
}
|
||||
if (val.type_of_activity_id == 4) {
|
||||
if(val.products){
|
||||
this.suppliers_trade_details = val.products;
|
||||
this.suppliers_wholesale_trade_details =val.products;
|
||||
this.initTradingDetails(null);
|
||||
}
|
||||
}
|
||||
@ -236,19 +237,19 @@ export class StockComponent implements OnInit {
|
||||
api.forEach(val => {
|
||||
if (val.type_of_activity_id == 2) {
|
||||
if(val.products){
|
||||
this.suppliers_raw_materials = val.products;
|
||||
this.suppliers_finished_goods = val.products;
|
||||
this.initManufacturingDetails(null);
|
||||
}
|
||||
}
|
||||
if (val.type_of_activity_id == 3) {
|
||||
if(val.products){
|
||||
this.suppliers_finished_goods = val.products;
|
||||
this.suppliers_retail_trade_details= val.products;
|
||||
this.initRetailDetails(null);
|
||||
}
|
||||
}
|
||||
if (val.type_of_activity_id == 4) {
|
||||
if(val.products){
|
||||
this.suppliers_trade_details = val.products;
|
||||
this.suppliers_wholesale_trade_details = val.products;
|
||||
this.initTradingDetails(null);
|
||||
}
|
||||
}
|
||||
@ -324,22 +325,22 @@ tradingFormCreation(val) {
|
||||
if(datas === null){
|
||||
|
||||
|
||||
if(this.suppliers_raw_materials.length > 0){
|
||||
this.suppliers_raw_materials.forEach(val => {
|
||||
let Ref_RawMaterials : any = {'raw_name': val,
|
||||
'stock_observed':'',
|
||||
'raw_quantity': '',
|
||||
'raw_uom': '',
|
||||
'other_uom': '',
|
||||
'raw_value': '',
|
||||
'is_sufficiant_raw': '',
|
||||
'rawmaterial_remarks':''};
|
||||
rawMaterial.push(this.createRawmaterial(Ref_RawMaterials));
|
||||
});
|
||||
}
|
||||
else{
|
||||
// if(this.suppliers_raw_materials.length > 0){
|
||||
// this.suppliers_raw_materials.forEach(val => {
|
||||
// let Ref_RawMaterials : any = {'raw_name': val,
|
||||
// 'stock_observed':'',
|
||||
// 'raw_quantity': '',
|
||||
// 'raw_uom': '',
|
||||
// 'other_uom': '',
|
||||
// 'raw_value': '',
|
||||
// 'is_sufficiant_raw': '',
|
||||
// 'rawmaterial_remarks':''};
|
||||
// rawMaterial.push(this.createRawmaterial(Ref_RawMaterials));
|
||||
// });
|
||||
// }
|
||||
// else{ }
|
||||
rawMaterial.push(this.createRawmaterial(null));
|
||||
}
|
||||
|
||||
if(this.suppliers_finished_goods.length > 0){
|
||||
// for (let val of this.suppliers_finished_goods) {
|
||||
this.suppliers_finished_goods.forEach(val => {
|
||||
@ -428,10 +429,10 @@ tradingFormCreation(val) {
|
||||
|
||||
if(datas === null){
|
||||
|
||||
if(this.suppliers_trade_details.length > 0){
|
||||
if(this.suppliers_retail_trade_details.length > 0){
|
||||
this.rawMaterialAccess = true;
|
||||
|
||||
this.suppliers_trade_details.forEach(val => {
|
||||
this.suppliers_retail_trade_details.forEach(val => {
|
||||
let Ref_Trade_Goods : any = {
|
||||
'traded_goods_name': val,
|
||||
'traded_goods_observed': '',
|
||||
@ -527,9 +528,9 @@ tradingFormCreation(val) {
|
||||
if(datas === null){
|
||||
|
||||
|
||||
if(this.suppliers_trade_details.length > 0){
|
||||
if(this.suppliers_wholesale_trade_details.length > 0){
|
||||
// for (let val of this.suppliers_trade_details) {
|
||||
this.suppliers_trade_details.forEach(val => {
|
||||
this.suppliers_wholesale_trade_details.forEach(val => {
|
||||
let Ref_Trade_Goods : any = {
|
||||
'traded_goods_name': val,
|
||||
'traded_goods_observed': '',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user