changes : ps
This commit is contained in:
parent
98b6ebd82a
commit
535d7a60f8
@ -281,7 +281,7 @@
|
||||
|
||||
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
|
||||
|
||||
<mat-form-field *ngIf="sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5 || sup.get('assets_mode').value == 6 || sup.get('assets_mode').value == 7" style="width:95%">
|
||||
<mat-form-field *ngIf="sup.get('assets_mode').value != ''" style="width:95%">
|
||||
<mat-select placeholder="Is There a Loan Existing Against This Asset?" formControlName="emi">
|
||||
<mat-option value="yes">Yes</mat-option>
|
||||
<mat-option value="no">No</mat-option>
|
||||
|
||||
@ -30,7 +30,13 @@
|
||||
<div fxLayout="row nowrap">
|
||||
<mat-form-field style="width: 45%;">
|
||||
<mat-select placeholder="Name" formControlName="partner_name" style="width: 90%;" (selectionChange)="changePartnerGroup(members.value.partner_name,i)" required>
|
||||
<mat-option *ngFor="let app_par of applicants" [value]="app_par.applicant_name">{{app_par.applicant_name | titlecase}}</mat-option>
|
||||
<!-- <mat-optgroup *ngFor="let group of personsList" [label]="group.applicant_type">
|
||||
<mat-option *ngFor="let val of group" [value]="val.applicant_name">
|
||||
{{val.name}}
|
||||
</mat-option>
|
||||
</mat-optgroup> -->
|
||||
|
||||
<mat-option *ngFor="let app_par of personsList" [value]="app_par.applicant_id">{{app_par.applicant_name | titlecase}}</mat-option>
|
||||
<mat-option value="Others">Others</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@ -38,6 +38,7 @@ export class BusinessInfoComponent implements OnInit {
|
||||
pageTitle: string ="About Business";
|
||||
relationData: any = [];
|
||||
titleData: any = [];
|
||||
personsList: any = [];
|
||||
companyRelationShipList: any =[];
|
||||
//industryData: any = [];
|
||||
activityData: any = [];
|
||||
@ -125,6 +126,7 @@ export class BusinessInfoComponent implements OnInit {
|
||||
this.initBusinessForm();
|
||||
this.getCompanyRelation();
|
||||
this.getTitle();
|
||||
this.getAllPersons();
|
||||
// const Desgn = <FormArray>this.businessForm.controls['designation'];
|
||||
// const Partnr = <FormArray>this.businessForm.controls['partners'];
|
||||
// const otherDoc = <FormArray>this.businessForm.controls['documents'];
|
||||
@ -1061,6 +1063,26 @@ export class BusinessInfoComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
// get title master
|
||||
getAllPersons() {
|
||||
this._pd.getAllPersonsName(this.pdid).subscribe(data => {
|
||||
if(data.dataStatus){
|
||||
this.personsList = data.record;
|
||||
// if(data.record.applicant_type == 1){
|
||||
// this.personsList.push({groupName:'APPLICANTS',groupValues:{name:data.record.applicant_name,group_id:data.record.applicant_type}});
|
||||
// }
|
||||
// if(data.record.applicant_type == 2){
|
||||
// this.personsList.push({groupName:'COMPANIES',groupValues:{name:data.record.applicant_name,group_id:data.record.applicant_type}});
|
||||
// }
|
||||
// if(data.record.applicant_type == 3){
|
||||
// this.personsList.push({groupName:'OTHER FAMILY MEMBER',groupValues:{name:data.record.applicant_name,group_id:data.record.applicant_type}});
|
||||
// }
|
||||
// this.personsList.push({groupName:'COMMON',groupValues:{name:'Others',group_id:4}});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
getCompanyRelation() {
|
||||
let master_name = 'COMPANYRELATIONSHIPS';
|
||||
this._pd.getAllMasterDatas(master_name).subscribe(data => {
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<div *ngFor="let details of currentLoanForm.get('loan_details').controls; let i=index; let last=last"
|
||||
[formGroupName]="i">
|
||||
<mat-card-header>
|
||||
<mat-card-title><p>Loan Details : {{details.get('label').value}}</p></mat-card-title>
|
||||
<mat-card-title><p>Loan Details {{details.get('label').value}}</p></mat-card-title>
|
||||
</mat-card-header>
|
||||
<!-- {{frequencyData | json}} -->
|
||||
<!-- Loan type, Loan amount, Lender, Loan Taken By, Instalment Frequency, Instalment Amount, Original Tenure, Balance Tenure -->
|
||||
|
||||
@ -41,6 +41,7 @@ export class CurrentLoanComponent implements OnInit {
|
||||
lenderData: any = [];
|
||||
frequencyData: any = [];
|
||||
loanTypeData: any = [];
|
||||
investmentTypeData: any = [];
|
||||
applicants: any;
|
||||
placeholderName : any = [];
|
||||
IDXval : any;
|
||||
@ -88,6 +89,8 @@ export class CurrentLoanComponent implements OnInit {
|
||||
this.getMasterDetails('BTLENDERLIST',1);
|
||||
this.getMasterDetails('FREQUENCY',2);
|
||||
this.getMasterDetails('EXISTINGLOANTYPES',3);
|
||||
this.getMasterDetails('INVESTMENTTYPE',4);
|
||||
|
||||
this.initCurrentloanForm();
|
||||
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
|
||||
if(data.dataStatus){
|
||||
@ -148,43 +151,91 @@ export class CurrentLoanComponent implements OnInit {
|
||||
// console.log(data);
|
||||
|
||||
if(data.dataStatus == true){
|
||||
// console.log(data.record);
|
||||
this.dataFromAssets = data.record;
|
||||
if(this.dataFromAssets.length > 0){
|
||||
|
||||
console.log(data.record);
|
||||
|
||||
let AssetData = data.record;
|
||||
|
||||
// console.log(AssetData.business_assets);
|
||||
// console.log(AssetData.other_assests);
|
||||
|
||||
if(AssetData.business_assets.length>0){
|
||||
AssetData.business_assets.map(element => {
|
||||
this.dataFromAssets.push({mode:element.business_assets_mode,
|
||||
mode_name:element.business_assets_mode_name,
|
||||
details:element.business_details,
|
||||
owner_name:element.business_name_of_the_owner})
|
||||
});
|
||||
}
|
||||
|
||||
if(AssetData.other_assests.length > 0){
|
||||
AssetData.other_assests.map(element => {
|
||||
this.dataFromAssets.push({mode:element.assets_mode,
|
||||
mode_name:element.assets_mode_name,
|
||||
details:element.details,
|
||||
owner_name:element.name_of_the_owner
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
// 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: "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", isactsive: "1", flag: "1", is_others: "0"
|
||||
// id: "1", name: "Others", isactive: "1", flag: "1", is_others: "1"}
|
||||
|
||||
if(this.dataFromAssets.length > 0){
|
||||
let labelarray : any = [];
|
||||
|
||||
this.dataFromAssets.forEach((val,index) => {
|
||||
|
||||
if(val.business_assets_mode == 1){
|
||||
if(val.mode == 1){
|
||||
let data;
|
||||
val.business_details.forEach((v,index) => {
|
||||
|
||||
val.details.forEach((v,index) => {
|
||||
data = v.any_other_assets;
|
||||
});
|
||||
labelarray[index] = val.business_name_of_the_owner +' - '+ data;
|
||||
let description = data != '' ? '( '+ data +' )' : '';
|
||||
labelarray[index] = ' : '+val.owner_name +' - '+ val.mode_name + description;
|
||||
}
|
||||
if(val.business_assets_mode == 2){
|
||||
if(val.mode == 2){
|
||||
let data;
|
||||
val.business_details.forEach((v,index) => {
|
||||
val.details.forEach((v,index) => {
|
||||
data = v.property_type_name;
|
||||
});
|
||||
labelarray[index] = val.business_name_of_the_owner +' - '+ data;
|
||||
let description = data != '' ? '( '+ data +' )' : '';
|
||||
labelarray[index] = ' : '+val.owner_name +' - '+ val.mode_name + description;
|
||||
}
|
||||
if(val.business_assets_mode == 3){
|
||||
if(val.mode == 3){
|
||||
let data;
|
||||
val.business_details.forEach((v,index) => {
|
||||
val.details.forEach((v,index) => {
|
||||
data = v.manufacturer_model_vehicle;
|
||||
});
|
||||
labelarray[index] = val.business_name_of_the_owner +' - '+ data;
|
||||
let description = data != '' ? '( '+ data +' )' : '';
|
||||
labelarray[index] = ' : '+val.owner_name +' - '+ val.mode_name + description;
|
||||
}
|
||||
if(val.business_assets_mode == 4){
|
||||
if(val.mode == 4){
|
||||
let data;
|
||||
val.business_details.forEach((v,index) => {
|
||||
val.details.forEach((v,index) => {
|
||||
data = v.equipment_manufacturing_description;
|
||||
});
|
||||
labelarray[index] = val.business_name_of_the_owner +' - '+ data;
|
||||
let description = data != '' ? '( '+ data +' )' : '';
|
||||
labelarray[index] = ' : '+val.owner_name +' - '+ val.mode_name + description;
|
||||
}
|
||||
if(val.mode == 6){
|
||||
labelarray[index] = ' : '+val.owner_name+' - '+ val.mode_name;
|
||||
}
|
||||
if(val.mode == 7){
|
||||
let data;
|
||||
val.details.forEach((v,index) => {
|
||||
data = v.investments_type != 1
|
||||
? this.investmentTypeData.filter(data => data.id == v.investments_type)[0].name
|
||||
: v.other_investments_type ;
|
||||
|
||||
});
|
||||
let description = data != '' ? '( '+ data +' )' : '';
|
||||
labelarray[index] = ' : '+val.owner_name +' - '+ val.mode_name + description;
|
||||
}
|
||||
});
|
||||
const control = <FormArray>this.currentLoanForm.controls['loan_details'];
|
||||
this.labelArr = labelarray;
|
||||
@ -213,8 +264,13 @@ export class CurrentLoanComponent implements OnInit {
|
||||
// this.currentLoanForm.controls['existing_loan'].setValue(arr);
|
||||
}
|
||||
}
|
||||
else{
|
||||
console.log('else,else.part');
|
||||
control.push(this.createLoanDetail(null));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -398,6 +454,9 @@ export class CurrentLoanComponent implements OnInit {
|
||||
else if(type==3 && val.isactive == 1){
|
||||
this.loanTypeData.push(val);
|
||||
}
|
||||
else if(type==4 && val.isactive == 1){
|
||||
this.investmentTypeData.push(val);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
@ -578,13 +578,15 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div fxFlex="40" align="end">
|
||||
<div fxFlex="20" align="end">
|
||||
<!-- <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>
|
||||
</div>
|
||||
<div fxFlex="20" align="end">
|
||||
<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>
|
||||
|
||||
@ -379,7 +379,7 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
name:element.applicant_name,
|
||||
relationship:element.relationship,
|
||||
relation_to:element.relation_to,
|
||||
age:'',
|
||||
age:element.age,
|
||||
data_gets_from:'GeneralForm'};
|
||||
});
|
||||
// console.log('familyMembersGeneralForm',familyMembersGeneralForm);
|
||||
@ -631,17 +631,44 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
}
|
||||
selectedPerson(e,inx){
|
||||
|
||||
// console.log('e,inx',e,inx);
|
||||
// console.log( e,inx, "Logged!");
|
||||
// console.info( e,inx, "Logged!");
|
||||
// console.warn( e,inx, "Logged!");
|
||||
// console.debug(e,inx, "Logged!");
|
||||
// console.error(e,inx, "Logged!");
|
||||
|
||||
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;
|
||||
console.log(control.length);
|
||||
|
||||
let newControlLength: number;
|
||||
let oldControlLength: number = control.length;
|
||||
|
||||
if(this.apiFamilyMembers.length>0){
|
||||
|
||||
let arraydata : any;
|
||||
let data = this.apiFamilyMembers.filter(item => item.relation_to == e);
|
||||
// console.log('this.apiFamilyMembers',this.apiFamilyMembers);
|
||||
// console.log('selectedPerson data',data);
|
||||
|
||||
if(data.length > 0){
|
||||
console.log(control.length);
|
||||
console.log(data.length);
|
||||
|
||||
newControlLength = data.length;
|
||||
let index: number = 0;
|
||||
while(index < oldControlLength)
|
||||
{
|
||||
control.removeAt(index);
|
||||
index++;
|
||||
}
|
||||
oldControlLength = newControlLength
|
||||
|
||||
|
||||
data.forEach((val,inx) => {
|
||||
|
||||
if(val.age){
|
||||
this.isReadOnly[inx] = true;
|
||||
}else{
|
||||
@ -662,15 +689,25 @@ export class FamilyDetailsComponent implements OnInit {
|
||||
'non_earning_if_retired_from': '',
|
||||
'non_earning_if_schoolorcollege': ''
|
||||
}
|
||||
control.push(this.initgenerateFamilyMembersDetailsGet(arraydata));
|
||||
|
||||
});
|
||||
control.push(this.initgenerateFamilyMembersDetailsGet(arraydata));
|
||||
}
|
||||
else{
|
||||
|
||||
let index: number = 0;
|
||||
while(index < oldControlLength)
|
||||
{
|
||||
control.removeAt(index);
|
||||
index++;
|
||||
}
|
||||
oldControlLength = 1;
|
||||
|
||||
control.push(this.generateFamilyMembersDetailsGet());
|
||||
}
|
||||
}
|
||||
else{
|
||||
// console.log('main else');
|
||||
control.push(this.generateFamilyMembersDetailsGet());
|
||||
}
|
||||
}
|
||||
|
||||
@ -497,7 +497,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
|
||||
if (salary != '' && profit != '') {
|
||||
if(+profit>+salary){
|
||||
alert("profit is greater than salary");
|
||||
alert("profit is greater than Annual Sale ");
|
||||
detail.controls.financial_net_profit.setValue(0);
|
||||
detail.controls.financial_margin_of_profit.setValue('');
|
||||
detail.controls.financial_profit_to_sale_variation.setValue('');
|
||||
@ -517,7 +517,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
|
||||
if (salary != '' && loss != '') {
|
||||
if(+loss>+salary){
|
||||
alert("Loss is greater than salary");
|
||||
alert("Loss is greater than Annual Sale ");
|
||||
detail.controls.financial_net_loss.setValue(0);
|
||||
detail.controls.financial_margin_of_loss.setValue('');
|
||||
detail.controls.financial_profit_to_sale_variation.setValue('');
|
||||
@ -536,8 +536,8 @@ export class FinancialInfoComponent implements OnInit {
|
||||
|
||||
|
||||
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 ;
|
||||
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 ;
|
||||
@ -662,7 +662,7 @@ export class FinancialInfoComponent implements OnInit {
|
||||
details.controls.estimate_sales_to.setValue(estimate_sales_to!= Infinity ? estimate_sales_to:0);
|
||||
}
|
||||
}
|
||||
else if(estimate_sales_from > 5000000 || estimate_sales_from <= 10000000){
|
||||
else if(estimate_sales_from > 5000000 && estimate_sales_from <= 10000000){
|
||||
if(D >= 15){
|
||||
var r = confirm("Given Sales Range is greater than 15%");
|
||||
if (r == true) {
|
||||
|
||||
@ -258,8 +258,10 @@
|
||||
<mat-card-actions align="center">
|
||||
<button type="button" mat-flat-button (click)="addCompanyRelationshipDialogue()"
|
||||
matTooltip="Add More" matTooltipPosition="left" color="primary">
|
||||
<span *ngIf="_generalForm.controls.company_with_relationships['controls'].length>0"><strong>Add Company Relationship</strong></span>
|
||||
<span *ngIf="_generalForm.controls.company_with_relationships['controls'].length>1"><strong>Add More Company Relationship</strong></span>
|
||||
<span *ngIf="_generalForm.controls.company_with_relationships['controls'].length == 0;else another;">
|
||||
<strong>Add Company Relationship</strong>
|
||||
</span>
|
||||
<ng-template #another><strong>Add More Company Relationship</strong></ng-template>
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
|
||||
@ -56,8 +56,8 @@
|
||||
<mat-form-field style="width:45%">
|
||||
<mat-select placeholder="Income earned by"
|
||||
formControlName="income_earned_by">
|
||||
<mat-option value="{{person}}" *ngFor="let person of incomeEarnedBy">
|
||||
{{person}}
|
||||
<mat-option value="{{person.applicant_id}}" *ngFor="let person of incomeEarnedBy">
|
||||
{{person.applicant_name}}
|
||||
</mat-option>
|
||||
<mat-option value="others">Others</mat-option>
|
||||
</mat-select>
|
||||
|
||||
@ -510,6 +510,7 @@ export class PdTrigerService {
|
||||
|
||||
/** To get Family Member Name For
|
||||
* 1) other income form - (income earned field)
|
||||
* 2) bussiness form - (partner_name field)
|
||||
*/
|
||||
getAllPersonsName(pdid:any): Observable<any> {
|
||||
return this._http.post<any>(this.apiUrl + "getAllPersonsName", { "pd_id" : pdid})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user