Business asset component : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-01-22 17:34:26 +05:30
parent 4a1b0f679a
commit 86f215f7c0
11 changed files with 1336 additions and 600 deletions

View File

@ -12,292 +12,7 @@
<mat-dialog-content>
<mat-tab-group>
<mat-tab label="Assets Used For Business">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-card style="min-height: 550px;">
<mat-card-content>
<div fxLayout="row" fxLayoutAlign="start none">
<div formArrayName="business_assets_details" fxFill>
<div *ngFor="let sup of _assetsQuesFrom.controls.business_assets_details['controls']; let i=index; let last=last;">
<mat-card>
<mat-card-content>
<div [formGroupName]="i">
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
<mat-form-field style="width:100%">
<mat-select (selectionChange)="selectedAssetsType($event,i,2)" placeholder="Assets Type" formControlName="business_assets_mode" requried>
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id" [disabled]="asset.flag!=1">{{ asset.name | titlecase }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<!--Desction Dynamic details: START-->
<div formArrayName="business_details" class="example-full-width">
<!--Property-->
<div *ngIf="sup.get('business_assets_mode').value == 1 ">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<mat-select placeholder="Property Type" formControlName="property_type" >
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name | titlecase }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:40%" *ngIf="detail.get('property_type').value == 5">
<input matInput placeholder="Other Property Type" formControlName="other_property_type" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
<!--vehicle-->
<div *ngIf="sup.get('business_assets_mode').value == 2">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<!--<mat-form-field style="width:40%">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_four_weeler" autocomplete="off">-->
<mat-form-field style="width:40%">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_vehicle" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
<!-- Eqipment Manufacturing -->
<div *ngIf="sup.get('business_assets_mode').value == 3">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<!--<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_two_weeler" autocomplete="off">-->
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
<input matInput placeholder="Description" formControlName="equipment_manufacturing_description" >
</mat-form-field>
</div>
</div>
</div>
</div>
<!--Consumer Durable-->
<div *ngIf="sup.get('business_assets_mode').value == 5">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
<input matInput placeholder="Description" formControlName="consumer_durable_description" >
</mat-form-field>
</div>
</div>
</div>
</div>
<!--Insurance-->
<div *ngIf="sup.get('business_assets_mode').value == 6">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,5)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('premium_paid').value != ''">{{"&#8377;"}} {{PremiumPaidInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:40%">
<mat-select placeholder="Frequency" formControlName="frequency_mode" >
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name | titlecase }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:40%" *ngIf="detail.get('frequency_mode').value == 8 ">
<input matInput placeholder="Specify Frequency" formControlName="other_frequency_mode" autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,7)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('sum_assured').value != ''">{{"&#8377;"}} {{SumAssuredInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:40%">
<input matInput placeholder="Members Covered" formControlName="members_coverd" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
<!--Investments-->
<div *ngIf="sup.get('business_assets_mode').value == 7">
<div>
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<mat-select placeholder="Type" formControlName="investments_type" >
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name | titlecase }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:40%" *ngIf="detail.get('investments_type').value == 6 ">
<input matInput placeholder="Specify Type" formControlName="other_investments_type" autocomplete="off">
</mat-form-field>
<mat-form-field style="width:40%">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,9)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('amount_of_invest').value != ''">{{"&#8377;"}} {{AmtInvestInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:40%">
<input matInput placeholder="Bank Name" formControlName="bank_name" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
<!--other assets-->
<div *ngIf="sup.get('business_assets_mode').value == 8">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets" autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off" (keyup)="inWords($event,s,11)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('any_other_asset_value').value != ''">{{"&#8377;"}} {{AssetValueInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:40%">
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan">
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue | titlecase}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:40%" *ngIf="businessEmiAmtFlag">
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off" (keyup)="inWords($event,s,13)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('other_asset_emi_amt').value != ''">{{"&#8377;"}} {{B_emiAmtInwords[s]}} Only</mat-hint>
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
<!--Desction Dynamic details : END -->
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 4" style="width:45%">
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('business_approximate_market_value').value != ''">{{"&#8377;"}} {{appxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5" style="width:45%">
<mat-select placeholder="Asset Owned by"
formControlName="business_name_of_the_owner" [compareWith]="compareObjects" required>
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="checkOthers(sup.get('business_name_of_the_owner').value)===true" style="width:45%">
<input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner" autocomplete="off">
</mat-form-field>
</div>
<span *ngIf="sup.get('business_assets_mode').value != ''">
<mat-form-field style="width:45%">
<mat-label>Vintage</mat-label>
<input matInput autocomplete="off" placeholder="eg.999" formControlName="business_vintage" minlength="1" maxlength="3" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,1)">
<!-- <mat-error> Invalid format</mat-error> -->
</mat-form-field>
<mat-form-field style="width:45%">
<mat-label>Purchase Year</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="business_purchase_year" minlength="4" maxlength="4" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,2)">
<!-- <mat-error> Invalid year format</mat-error> -->
</mat-form-field>
</span>
<span *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
<mat-select placeholder="Is There a Loan Existing Against This Asset?" formControlName="business_emi">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</div>
</span>
<!-- <div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none"> -->
<!-- <div fxFlex="20"> -->
<!-- <span *ngIf="_assetsQuesFrom.controls.business_assets_details.controls.length > 1" (click)="removeAssetsDetails(i,2)">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above"><mat-icon>delete</mat-icon></button>
</span> -->
<!-- </div> -->
<!-- </div> -->
</div>
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addAssetDetails($event,2); false"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Business Asset </strong>
</button>
<button type="button" mat-flat-button (click)="removeAssetsDetails(i,2)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
<strong>Delete Business Assets </strong>
</button>
</mat-card-actions>
</mat-card>
</div>
</div>
</div>
<!-- <div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button mat-button color="primary" matTooltip="Add More Business Asset Details" matTooltipPosition="above"
class="mr-1 mb-1 hover-icon" (click)="addAssetDetails($event,2); false"><mat-icon>add</mat-icon></button>
</div> -->
</mat-card-content>
</mat-card>
</div>
</div>
</ng-template>
</mat-tab>
<mat-tab label="Other Assets">
<mat-tab label={{pageTitle}}>
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">

View File

@ -29,7 +29,7 @@ import { element } from '@angular/core/src/render3/instructions';
styleUrls: ['./assets-info.component.scss']
})
export class AssetsInfoComponent implements OnInit {
pageTitle: string ="Assets Details";
pageTitle: string ="Other Assets Details";
//@Input() pdid: number;
pdid:string;
//businessProfessionName :string;
@ -37,7 +37,7 @@ export class AssetsInfoComponent implements OnInit {
public _assetsQuesFrom: FormGroup;
public submitted = false;
public m_assets_type = [];
//public m_relation = [];
public applicants: any;
otherEmiamtFlag : boolean = false;
businessEmiAmtFlag : boolean = false;
@ -58,131 +58,13 @@ export class AssetsInfoComponent implements OnInit {
OtherAssetValueInwords: any = [];
B_emiAmtInwords: any = [];
O_emiAmtInwords: any = [];
// public m_assets_type = [
// {
// 'id': "1",
// 'name': "Property"
// },
// {
// 'id': "2",
// 'name': "Four Wheeler"
// },
// {
// 'id': "3",
// 'name': "Two Wheeler"
// },
// {
// 'id': "4",
// 'name': "Jewellery"
// },
// {
// 'id': "5",
// 'name': "Consumer Durable"
// },
// {
// 'id': "6",
// 'name': "Insurance"
// },
// {
// 'id': "7",
// 'name': "Investments"
// },
// {
// 'id': "8",
// 'name': "Others"
// }
// ]
public m_propertyType = [];
public m_propertyType = [];
// public m_propertyType = [
// {
// 'id': "1",
// 'name': 'Residential'
// },
// {
// 'id': "2",
// 'name': 'Commercial'
// },
// {
// 'id': "3",
// 'name': 'Industrial'
// },
// {
// 'id': "4",
// 'name': 'Land'
// }
// ];
//public m_insuranceType = [];
// public m_insuranceType = [{
// 'id': "1",
// 'name': 'Life'
// }, {
// 'id': "2",
// 'name': 'Health'
// }]
public m_investmentType = [];
// public m_investmentType = [{
// 'id': "1",
// 'name': 'FD'
// }, {
// 'id': "2",
// 'name': 'RD'
// }, {
// 'id': "3",
// 'name': 'Mutual Funds'
// }, {
// 'id': "4",
// 'name': 'PPF'
// }, {
// 'id': "5",
// 'name': 'Shares'
// }, {
// 'id': "6",
// 'name': 'Others'
// }]
public m_investmentType = [];
public m_freqOfPurchase = [];
// public m_freqOfPurchase = [
// {
// 'id': "1",
// 'name': 'Daily'
// },
// {
// 'id': "2",
// 'name': 'Weekly'
// },
// {
// 'id': "3",
// 'name': 'Monthly'
// },
// {
// 'id': "4",
// 'name': 'Every 3 months'
// },
// {
// 'id': "5",
// 'name': 'Half yearly'
// },
// {
// 'id': "6",
// 'name': 'Yearly'
// },
// {
// 'id': "7",
// 'name': 'As and when required'
// },
// {
// 'id': "8",
// 'name': 'Others'
// }
// ]
private notifier: NotifierService;
existCompanyList: any =[];
mergeCompanyApplicant: any=[];
@ -358,11 +240,11 @@ public m_investmentType = [];
assets_details: this._formBuilder.array([
// this.initDetails(),
]),
business_assets_details : this._formBuilder.array([]),
// business_assets_details : this._formBuilder.array([]),
assets_form_remark:[value.assets_form_remark || 'check']
});
this.addAssetsDetailsWithData(value.assets_details);
this.addBusinessAssetsDetailsWithData(value.business_assets_details);
// this.addBusinessAssetsDetailsWithData(value.business_assets_details);
} else {
this._assetsQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
@ -370,9 +252,9 @@ public m_investmentType = [];
assets_details: this._formBuilder.array([
this.initDetails(),
]),
business_assets_details : this._formBuilder.array([
this.initBusinessDetails(),
]),
// business_assets_details : this._formBuilder.array([
// this.initBusinessDetails(),
// ]),
assets_form_remark:['']
});
}
@ -402,22 +284,6 @@ public m_investmentType = [];
});
}
initBusinessDetails() {
return this._formBuilder.group({
business_assets_mode: [''],
business_details: this._formBuilder.array([]),
business_approximate_market_value: [''],
business_name_of_the_owner: [],
business_name_of_the_other_owner: [],
//other_owner:[''],
//relation:[''],
business_vintage: [''],
business_purchase_year: ['',Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
//purchase_month: [''],
business_emi: [''],
});
}
show: boolean;
selectedAssetsType(e: any, i: any,flag : any): void {
let val = i;
@ -425,64 +291,57 @@ public m_investmentType = [];
const arr = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
arr.controls.splice(0);
}
else if(flag == 2){
const arr = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray;
arr.controls.splice(0);
}
// else if(flag == 2){
// const arr = ;
// arr.controls.splice(0);
// }
switch (e.value) {
case '1': {
let val = i;
const control = (flag == 1) ? (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
: (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadProperty());
break;
}
case '2': {
const control = (flag == 1) ? (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
: (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.load_Four_Weeler());
break;
}
case '3': {
const control = (flag == 1) ? (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
: (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadEquipmentManufacturingDescription());
break;
}
case '4': {
const control = (flag == 1) ? (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
: (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
//control.push(this.loadJwellDescription());
break;
}
case '5': {
const control = (flag == 1) ? (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
: (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadConsumerDurableDescription());
break;
}
case '6': {
const control = (flag == 1) ? (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
: (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadInsuranceDescription());
break;
}
case '7': {
const control = (flag == 1) ? (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray
: (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.loadInvestDescription());
break;
}
case '8': {
if(flag == 1){
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray ;
control.push(this.otherAssetsDescription());
}
else if (flag == 2){
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.otherBusinessAssetsDescription());
}
break;
}
default: {
@ -712,38 +571,6 @@ public m_investmentType = [];
this.loadDetails = true;
}
addBusinessAssetsDetailsWithData(supp_data) {
var result = Object.keys(supp_data).map(function (key) {
return supp_data[key];
});
if (result.length > 0) {
result.forEach((datas,index) => {
this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value);
});
for (let val of result) {
let vals = {
business_assets_mode: val.business_assets_mode,
business_approximate_market_value: val.business_approximate_market_value,
business_name_of_the_owner: val.business_name_of_the_owner,
business_name_of_the_other_owner: val.business_name_of_the_other_owner,
// relation : val.relation,
business_purchase_year: val. business_purchase_year,
business_vintage : val.business_vintage,
// purchase_month: val.purchase_month,
business_emi: val.business_emi,
};
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
control.push(this.initBusinessDetailsWithdata(vals));
this.setBusinessAssetsDetailsWithData(vals.business_assets_mode, val.business_details, control.length - 1)
}
}
//this.loadDetails = true;
}
setAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
let val = i;
// let data = Object.keys(datas).map(function (key) {
@ -849,112 +676,12 @@ public m_investmentType = [];
}
}
setBusinessAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
let val = i;
let data = datas;
const arr = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
arr.controls.splice(0);
switch (assets_details_mode) {
case '1': {
let business_property_datas : any;
data.forEach((datas,i) => {
business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type };
});
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadPropertyWithData(business_property_datas));
break;
}
case '2': {
let business_Four_Weeler_datas : any;
data.forEach((datas,i) => {
business_Four_Weeler_datas = { 'manufacturer_model_vehicle': datas.manufacturer_model_vehicle };
});
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.load_Four_WeelerWithData(business_Four_Weeler_datas));
break;
}
case '3': {
let equipment_manufacturing_description_datas : any;
data.forEach((datas,i) => {
equipment_manufacturing_description_datas= { 'equipment_manufacturing_description': datas.equipment_manufacturing_description };
});
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadEquipmentManufacturingDescriptionWithData(equipment_manufacturing_description_datas));
break;
}
case '4': {
break;
}
case '5': {
let business_ConsumerDurableDescription_datas : any;
data.forEach((datas,i) => {
business_ConsumerDurableDescription_datas = { 'consumer_durable_description': datas.consumer_durable_description };
});
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadConsumerDurableDescriptionWithData(business_ConsumerDurableDescription_datas));
break;
}
case '6': {
let business_InsuranceDescription_datas : any;
data.forEach((datas,i) => {
this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured);
business_InsuranceDescription_datas = {
'premium_paid': datas.premium_paid,
'frequency_mode': datas.frequency_mode,
'other_frequency_mode':datas.other_frequency_mode,
'sum_assured': datas.sum_assured,
'members_coverd': datas.members_coverd
};
});
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadInsuranceDescriptionWithData(business_InsuranceDescription_datas));
break;
}
case '7': {
let business_InvestDescription_datas : any;
data.forEach((datas,i) => {
this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
business_InvestDescription_datas = { 'investments_type': datas.investments_type,
'other_investments_type' : datas.other_investments_type,
'amount_of_invest': datas.amount_of_invest,
'bank_name': datas.bank_name };
});
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadInvestDescriptionWithData(business_InvestDescription_datas));
break;
}
case '8': {
let array_datas : any;
data.forEach((datas,i) => {
this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value);
array_datas = {
'any_other_assets': datas.any_other_assets,
'any_other_asset_value' : datas.any_other_asset_value,
'any_other_asset_loan' : datas.any_other_asset_loan,
};
});
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.otherBusinessAssetsDescriptionWithData(array_datas));
break;
}
default: {
break;
}
}
}
/** Add More Asset using Flag Both "Other Asset" And "Business Asset" */
addAssetDetails(e,flag) {
if(flag == 1){
const control = <FormArray>this._assetsQuesFrom.controls['assets_details'];
control.push(this.initDetails());
}else if(flag == 2){
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
control.push(this.initBusinessDetails());
}
}
@ -963,9 +690,6 @@ public m_investmentType = [];
if(flag == 1){
const control = <FormArray>this._assetsQuesFrom.controls['assets_details'];
control.removeAt(i);
}else if(flag == 2){
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
control.removeAt(i);
}
}

View File

@ -0,0 +1,399 @@
<form *ngIf="apiLoadFinish && loadDetails" [formGroup]="_businessAssetsQuesFrom" (submit)="onSubmit()" novalidate>
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;">
{{pageTitle}}
</div>
<div fxFlex="30" align="end" style="padding: 10px !important;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" matTooltipPosition="right" mat-dialog-close><mat-icon>close</mat-icon></button>
</div>
</h2>
<mat-dialog-content>
<mat-tab-group>
<mat-tab label={{pageTitle}}>
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
<mat-card style="min-height: 550px;">
<mat-card-content>
<div fxLayout="row" fxLayoutAlign="start none">
<div formArrayName="business_assets_details" fxFill>
<div *ngFor="let sup of _businessAssetsQuesFrom.controls.business_assets_details['controls']; let i=index; let last=last;">
<mat-card>
<mat-card-content>
<div [formGroupName]="i">
<div fxLayout="row wrap" fxLayoutGap="5px" fxLayoutAlign="start none">
<mat-form-field style="width:100%">
<mat-select (selectionChange)="selectedAssetsType($event,i)" placeholder="Assets Type" formControlName="business_assets_mode" requried>
<mat-option *ngFor="let asset of m_assets_type" [value]="asset.id" [disabled]="asset.flag!=1">{{ asset.name | titlecase }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<!--Desction Dynamic details: START-->
<div formArrayName="business_details" class="example-full-width">
<!--Property-->
<div *ngIf="sup.get('business_assets_mode').value == 2 ">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<mat-select placeholder="Property Type" formControlName="property_type" >
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name | titlecase }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:40%" *ngIf="detail.get('property_type').value == 5">
<input matInput placeholder="Other Property Type" formControlName="other_property_type" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
<!--vehicle-->
<div *ngIf="sup.get('business_assets_mode').value == 3">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_vehicle" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
<!-- Eqipment Manufacturing -->
<div *ngIf="sup.get('business_assets_mode').value == 4">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
<input matInput placeholder="Description" formControlName="equipment_manufacturing_description" >
</mat-form-field>
</div>
</div>
</div>
</div>
<!--Consumer Durable--
<div *ngIf="sup.get('business_assets_mode').value == 6">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
<input matInput placeholder="Description" formControlName="consumer_durable_description" >
</mat-form-field>
</div>
</div>
</div>
</div>-->
<!--Insurance--
<div *ngIf="sup.get('business_assets_mode').value == 7">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,2)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('premium_paid').value != ''">{{"&#8377;"}} {{PremiumPaidInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:40%">
<mat-select placeholder="Frequency" formControlName="frequency_mode" >
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name | titlecase }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:40%" *ngIf="detail.get('frequency_mode').value == 8 ">
<input matInput placeholder="Specify Frequency" formControlName="other_frequency_mode" autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,4)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('sum_assured').value != ''">{{"&#8377;"}} {{SumAssuredInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:40%">
<input matInput placeholder="Members Covered" formControlName="members_coverd" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>-->
<!--Investments--
<div *ngIf="sup.get('business_assets_mode').value == 8">
<div>
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<mat-select placeholder="Type" formControlName="investments_type" >
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name | titlecase }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:40%" *ngIf="detail.get('investments_type').value == 6 ">
<input matInput placeholder="Specify Type" formControlName="other_investments_type" autocomplete="off">
</mat-form-field>
<mat-form-field style="width:40%">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,s,5)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('amount_of_invest').value != ''">{{"&#8377;"}} {{AmtInvestInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:40%">
<input matInput placeholder="Bank Name" formControlName="bank_name" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
</div>-->
<!--other assets-->
<div *ngIf="sup.get('business_assets_mode').value == 1">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
<input matInput placeholder="Description of the Assets" formControlName="any_other_assets" autocomplete="off">
</mat-form-field>
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off" (keyup)="inWords($event,s,6)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('any_other_asset_value').value != ''">{{"&#8377;"}} {{AssetValueInwords[s]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:40%">
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan">
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue | titlecase}}</mat-option>
</mat-select>
</mat-form-field>
<!-- <mat-form-field style="width:40%" *ngIf="businessEmiAmtFlag">
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off" (keyup)="inWords($event,s,7)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('other_asset_emi_amt').value != ''">{{"&#8377;"}} {{B_emiAmtInwords[s]}} Only</mat-hint>
</mat-form-field> -->
</div>
</div>
</div>
</div>
</div>
<!--Desction Dynamic details : END -->
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!-- <mat-form-field *ngIf="sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 5" style="width:45%"> -->
<mat-form-field *ngIf="sup.get('business_assets_mode').value == 2" style="width:45%">
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('business_approximate_market_value').value != ''">{{"&#8377;"}} {{appxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<!-- <mat-form-field *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5" style="width:45%">
<mat-select placeholder="Asset Owned by"
formControlName="business_name_of_the_owner" [compareWith]="compareObjects" required>
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="checkOthers(sup.get('business_name_of_the_owner').value)===true" style="width:45%">
<input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner" autocomplete="off">
</mat-form-field> -->
{{applicants | json}}
<!-- <mat-form-field *ngIf="sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5 || sup.get('business_assets_mode').value == 6" style="width:45%"> -->
<mat-form-field *ngIf="sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4" style="width:45%">
<mat-select placeholder="Asset Owned by" formControlName="business_name_of_the_owner" required>
<mat-option *ngFor="let status of applicants" [value]="status.pd_co_applicant_id">{{ status.applicant_name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="checkOthers(sup.get('business_name_of_the_owner').value)===true" style="width:45%">
<input matInput placeholder="Specify Asset Owned Name" formControlName="business_name_of_the_other_owner" autocomplete="off">
</mat-form-field>
</div>
<span *ngIf="sup.get('business_assets_mode').value != ''">
<mat-form-field style="width:45%">
<mat-label>Vintage</mat-label>
<input matInput autocomplete="off" placeholder="eg.999" formControlName="business_vintage" minlength="1" maxlength="3" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,1)">
<!-- <mat-error> Invalid format</mat-error> -->
</mat-form-field>
<mat-form-field style="width:45%">
<mat-label>Purchase Year</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="business_purchase_year" minlength="4" maxlength="4" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,2)">
<!-- <mat-error> Invalid year format</mat-error> -->
</mat-form-field>
</span>
<!-- <span *ngIf="sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5 || sup.get('business_assets_mode').value == 6"> -->
<span *ngIf="sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
<mat-select placeholder="Is There a Loan Existing Against This Asset?" formControlName="business_emi">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</div>
</span>
</div>
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addAssetDetails($event); false"
matTooltip="Add More" matTooltipPosition="left" color="primary" *ngIf="last">
<strong>Add More Business Asset </strong>
</button>
<button type="button" mat-flat-button (click)="removeAssetsDetails(i)"
matTooltip="Delete"matTooltipPosition="left" color="primary" *ngIf="!last">
<strong>Delete Business Assets </strong>
</button>
</mat-card-actions>
</mat-card>
</div>
</div>
</div>
</mat-card-content>
</mat-card>
</div>
</div>
</ng-template>
</mat-tab>
<mat-tab label="Docs">
<ng-template matTabContent>
<div ngxViewer>
<div fxLayout="row wrap" style="padding:20px;">
<div fxFlex="100">
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=2" alt="Image 2"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"><img src="https://picsum.photos/2000/1500/?random=3" alt="Image 3"></div>
</div>
</div>
</div>
<div fxFlex="20" class="m-gap p-gap">
<div class="p-list-main mb-2" style="width: 60%;height: auto;">
<div class="p-list">
<div class="top"> <img src="https://picsum.photos/2000/1500/?random=1" alt="Image 1"></div>
</div>
</div>
</div>
</div>
<div fxFlex="row">
<div fxFlex="100" class="m-gap p-gap">
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
<div fxLayout="row" fxLayoutWrap="wrap">
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
<div class="text-center mb-2 hover-icon" fxFlex.xs="50" fxFlex.sm="50" fxFlex.md="20" fxFlex.lg="20" fxFlex.xl="20">
<a href="http://www.google.com"><mat-icon style="color: #e00201;font-size: 60px !important;width:inherit !important;">picture_as_pdf</mat-icon> <span class="d-block">version_111</span></a>
</div>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</mat-tab>
</mat-tab-group>
</mat-dialog-content>
<mat-dialog-actions>
<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="business_assets_form_remark" autocomplete="off"></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" (click)="onReset(); false"><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit"><mat-icon>save</mat-icon></button>
</div>
</mat-dialog-actions>
</form>
<!-- <div class="loading" *ngIf="!apiLoadFinish && !loadDetails">Loading</div> -->
<div *ngIf="!apiLoadFinish && !loadDetails"> <i> Loading.... </i> </div>
<notifier-container></notifier-container>

View File

@ -0,0 +1,142 @@
.paragraph_change {
color: #fff !important;
background-color: #e00201 !important;
}
.mat-form-field-appearance-legacy .mat-hint{
color:rgba(0, 0, 0, 0.8) !important;
}
.mat-card-content {
background-color: white;
}
.mat-card-actions {
background-color: white;
}
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
mat-form-field {
margin: 0 2%;
}
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
$product-bg-color-hover: rgba(103, 58, 183, 0.7);
.p-list-main {
background: white;
margin: auto;
position: relative;
overflow: hidden !important;
border-radius: 10px 10px 10px 10px;
box-shadow: $base-card-box-shadow;
transform: scale(0.95);
transition: box-shadow 0.5s, transform 0.5s;
&:hover {
transform: scale(1);
box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
}
.p-list {
position: relative;
.top {
height: 100%;
width: 100%;
// background: url(https://s-media-cache-ak0.pinimg.com/736x/49/80/6f/49806f3f1c7483093855ebca1b8ae2c4.jpg) no-repeat center center;
-webkit-background-size: 100%;
-moz-background-size: 100%;
-o-background-size: 100%;
background-size: 100%;
}
.bottom {
width: 200%;
height: 15%;
transition: transform 0.5s;
h1 {
margin: 0;
padding: 0;
}
p {
margin: 0;
padding: 0;
}
.left {
height: 100%;
width: 50%;
background: #f4f4f4;
position: relative;
float: left;
.details {
padding: 5px;
float: left;
// width: calc(70% - 40px);
}
}
.right {
width: 50%;
background: #A6CDDE;
color: white;
float: right;
height: 200%;
overflow: hidden;
.details {
padding: 20px;
float: right;
width: calc(70% - 40px);
}
}
}
}
}
// .loading {
// position: fixed;
// z-index: 999;
// height: 2em;
// width: 2em;
// overflow: show;
// margin: auto;
// top: 0;
// left: 0;
// bottom: 0;
// right: 0;
// }
// /* Transparent Overlay */
// .loading:before {
// content: '';
// display: block;
// position: fixed;
// top: 0;
// left: 0;
// width: 100%;
// height: 100%;
// background-color: rgba(0,0,0,0.3);
// }
// /* :not(:required) hides these rules from IE9 and below */
// .loading:not(:required) {
// /* hide "loading..." text */
// font: 0/0 a;
// color: transparent;
// text-shadow: none;
// background-color: transparent;
// border: 0;
// }
// .loading:not(:required):after {
// content: '';
// display: block;
// font-size: 10px;
// width: 1em;
// height: 1em;
// margin-top: -0.5em;
// -webkit-animation: spinner 1500ms infinite linear;
// -moz-animation: spinner 1500ms infinite linear;
// -ms-animation: spinner 1500ms infinite linear;
// -o-animation: spinner 1500ms infinite linear;
// animation: spinner 1500ms infinite linear;
// border-radius: 0.5em;
// -webkit-box-shadow: rgba(0, 0, 0, 0.75) 1.5em 0 0 0, rgba(0, 0, 0, 0.75) 1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) 0 1.5em 0 0, rgba(0, 0, 0, 0.75) -1.1em 1.1em 0 0, rgba(0, 0, 0, 0.5) -1.5em 0 0 0, rgba(0, 0, 0, 0.5) -1.1em -1.1em 0 0, rgba(0, 0, 0, 0.75) 0 -1.5em 0 0, rgba(0, 0, 0, 0.75) 1.1em -1.1em 0 0;
// box-shadow: rgba(0, 0, 0, 0.75) 1.5em 0 0 0, rgba(0, 0, 0, 0.75) 1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) 0 1.5em 0 0, rgba(0, 0, 0, 0.75) -1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) -1.5em 0 0 0, rgba(0, 0, 0, 0.75) -1.1em -1.1em 0 0, rgba(0, 0, 0, 0.75) 0 -1.5em 0 0, rgba(0, 0, 0, 0.75) 1.1em -1.1em 0 0;
// }

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { BusinessAssetsInfoComponent } from './business-assets-info.component';
describe('BusinessAssetsInfoComponent', () => {
let component: BusinessAssetsInfoComponent;
let fixture: ComponentFixture<BusinessAssetsInfoComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ BusinessAssetsInfoComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(BusinessAssetsInfoComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,699 @@
import { Component,OnInit,Inject,Input } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormArray,} from '@angular/forms';
import { NotifierService } from 'angular-notifier';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';
/** Service */
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
@Component({
selector: 'app-business-assets-info',
templateUrl: './business-assets-info.component.html',
styleUrls: ['./business-assets-info.component.scss']
})
export class BusinessAssetsInfoComponent implements OnInit {
pageTitle: string ="Business Assets";
pdid:string;
public _businessAssetsQuesFrom: FormGroup;
public submitted = false;
public m_assets_type = [];
public applicants: any;
// businessEmiAmtFlag : boolean = false;
public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"},
{'value': "no",'viewValue': "No"},
{'value': "nan",'viewValue': "NA"}]
appxMarketAmtInwords : any = [];
// emiAmtInwords : any = [];
// PremiumPaidInwords : any = [];
// SumAssuredInwords: any = [];
// AmtInvestInwords: any = [];
AssetValueInwords: any = [];
// B_emiAmtInwords: any = [];
public m_propertyType = [];
// public m_investmentType = [];
// public m_freqOfPurchase = [];
private notifier: NotifierService;
existCompanyList: any =[];
mergeCompanyApplicant: any=[];
currentYear:any=new Date().getFullYear();
public viewerOptions: any = {
navbar: false,
toolbar: {
zoomIn: 4,
zoomOut: 4,
oneToOne: 4,
reset: 4,
prev: 4,
play: {
show: 4,
size: 'large',
},
next: 4,
rotateLeft: 4,
rotateRight: 4,
flipHorizontal: 4,
flipVertical: 4,
}
};
company_id: any;
constructor(
notifier: NotifierService,
private _formBuilder: FormBuilder,
private pdTrigerService: PdTrigerService,
private dialogRef: MatDialogRef<BusinessAssetsInfoComponent>,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
this.company_id =this.pd_all_details.company_id;
this.notifier = notifier;
}
ngOnInit() {
// this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => {
// this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
// });
this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){
this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true);
}
let modifyCompanyList : any=[];
if(this.existCompanyList.length>0){
modifyCompanyList = this.existCompanyList.map(element => {
return {id:element.company_order_id.toString(),name:element.company_name,group_id:1};
});
this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
}
let modifyApplicantList: any=[];
if(this.applicants.length > 0){
modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
});
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
}
})
this.getPdSupplierFormDetails();
this.getM_Assets_Type();
this.getM_PropertyType();
// this.getM_InvestmentType();
// this.getM_FreqOfPurchase();
}
/** Assets Type For Dropdown List */
getM_Assets_Type() {
this.pdTrigerService.getAllMasterDatas('ASSETTYPE').subscribe(
data => {
this.m_assets_type = data.records.filter(data => data.isactive == 1 && data.flag == 1);
},
error => {
this.notifier.notify('warning', 'No Category Records Found.!');
// this.m_assets_type = "No Category Records Found.";
}
)
}
/** Property Type For Dropdown List */
getM_PropertyType() {
this.pdTrigerService.getAllMasterDatas('PROPERTIES').subscribe(
data => {
this.m_propertyType = data.records.filter(data => data.isactive == 1);
},
error => {
this.notifier.notify('warning', 'No Category Records Found.!');
// this.m_assets_type = "No Category Records Found.";
}
)
}
// getM_InvestmentType() {
// this.pdTrigerService.getAllMasterDatas('INVESTMENTTYPE').subscribe(
// data => {
// this.m_investmentType = data.records.filter(data => data.isactive == 1);
// },
// error => {
// this.notifier.notify('warning', 'No Category Records Found.!');
// // this.m_assets_type = "No Category Records Found.";
// }
// )
// }
// getM_FreqOfPurchase() {
// this.pdTrigerService.getAllMasterDatas('FREQUENCY').subscribe(
// data => {
// this.m_freqOfPurchase = data.records.filter(data => data.isactive == 1);
// },
// error => {
// this.notifier.notify('warning', 'No Category Records Found.!');
// // this.m_assets_type = "No Category Records Found.";
// }
// )
// }
//Get Data Based on PDID and FORMID
apiLoadFinish: boolean = false;
getPdSupplierFormDetails() {
this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '22').subscribe(
data => {
if (data) {
if (data.dataStatus) {
this.formLoadData(data.records);
} else {
this.formLoadData(null);
}
this.apiLoadFinish = true;
} else {
// this.noRecordFound = true;
}
}
);
}
//load Form Data
formLoadData(val) {
if (val !== null) {
let value = val;
this._businessAssetsQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['22'],
company_id : [this.company_id],
business_assets_details : this._formBuilder.array([]),
business_assets_form_remark:[value.business_assets_form_remark || 'check']
});
this.addBusinessAssetsDetailsWithData(value.business_assets_details);
} else {
this._businessAssetsQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['22'],
company_id : [this.company_id],
business_assets_details : this._formBuilder.array([
this.initBusinessDetails(),
]),
business_assets_form_remark:['']
});
}
this.loadDetails = true;
}
// convenience getter for easy access to form fields
get f() { return this._businessAssetsQuesFrom.controls; }
// get f_assets_details() {
// return <FormArray>this._businessAssetsQuesFrom.get('assets_details');
// }
// Dynamic Form field creation Functionality : START ===>
initBusinessDetails() {
return this._formBuilder.group({
business_assets_mode: [''],
business_details: this._formBuilder.array([]),
business_approximate_market_value: [''],
business_name_of_the_owner: [],
business_name_of_the_other_owner: [],
business_vintage: [''],
business_purchase_year: ['',Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
business_emi: [''],
});
}
show: boolean;
selectedAssetsType(e: any, i: any): void {
let val = i;
const arr = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray;
arr.controls.splice(0);
switch (e.value) {
case '2': {
let val = i;
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadProperty());
break;
}
case '3': {
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.load_Four_Weeler());
break;
}
case '4': {
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadEquipmentManufacturingDescription());
break;
}
// case '5': {
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
// //control.push(this.loadJwellDescription());
// break;
// }
// case '8': {
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
// control.push(this.loadConsumerDurableDescription());
// break;
// }
// case '6': {
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
// control.push(this.loadInsuranceDescription());
// break;
// }
// case '7': {
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
// control.push(this.loadInvestDescription());
// break;
// }
case '1': {
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.otherBusinessAssetsDescription());
break;
}
default: {
break;
}
}
}
loadProperty() {
return this._formBuilder.group({
property_type: [''],
other_property_type: ['']
});
}
// loadJwellDescription() {
// return this._formBuilder.group({
// jwell_description: ['']
// });
// }
// loadConsumerDurableDescription() {
// return this._formBuilder.group({
// consumer_durable_description: ['']
// });
// }
loadEquipmentManufacturingDescription() {
return this._formBuilder.group({
equipment_manufacturing_description: ['']
});
}
otherBusinessAssetsDescription() {
return this._formBuilder.group({
any_other_assets: [''],
any_other_asset_value : [''],
any_other_asset_loan : [''],
});
}
// loadInsuranceDescription() {
// return this._formBuilder.group({
// //insurance_type: [''],
// premium_paid: [''],
// frequency_mode: [''],
// other_frequency_mode:[''],
// sum_assured: [''],
// members_coverd: ['']
// });
// }
// loadInvestDescription() {
// return this._formBuilder.group({
// investments_type: [''],
// other_investments_type:[''],
// amount_of_invest: [],
// bank_name: ['']
// });
// }
load_Four_Weeler() {
return this._formBuilder.group({
manufacturer_model_vehicle: ['']
});
}
// load_Two_Weeler() {
// return this._formBuilder.group({
// manufacturer_model_vehicle: ['']
// });
// }
loadPropertyWithData(data) {
return this._formBuilder.group({
property_type: [data.property_type],
other_property_type: [data.other_property_type]
//property_type:['']
});
}
// loadJwellDescriptionWithData(data) {
// return this._formBuilder.group({
// jwell_description: [data.jwell_description]
// });
// }
// loadConsumerDurableDescriptionWithData(data) {
// return this._formBuilder.group({
// consumer_durable_description: [data.consumer_durable_description]
// });
// }
loadEquipmentManufacturingDescriptionWithData(data) {
return this._formBuilder.group({
equipment_manufacturing_description: [data.equipment_manufacturing_description]
});
}
otherBusinessAssetsDescriptionWithData(data) {
return this._formBuilder.group({
any_other_assets: [data.any_other_assets],
any_other_asset_value : [data.any_other_asset_value],
any_other_asset_loan : [data.any_other_asset_loan],
});
}
// loadInsuranceDescriptionWithData(data) {
// return this._formBuilder.group({
// //insurance_type: [data.insurance_type],
// premium_paid: [data.premium_paid],
// frequency_mode: [data.frequency_mode],
// other_frequency_mode:[data.other_frequency_mode],
// sum_assured: [data.sum_assured],
// members_coverd: [data.members_coverd]
// });
// }
// loadInvestDescriptionWithData(data) {
// return this._formBuilder.group({
// investments_type: [data.investments_type],
// other_investments_type : [data.other_investments_type],
// amount_of_invest: [data.amount_of_invest],
// bank_name: [data.bank_name]
// });
// }
load_Four_WeelerWithData(data) {
return this._formBuilder.group({
manufacturer_model_vehicle: [data.manufacturer_model_vehicle]
});
}
// load_Two_WeelerWithData(data) {
// return this._formBuilder.group({
// manufacturer_model_vehicle: [data.manufacturer_model_vehicle]
// });
// }
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 || ''],
});
return formGroup;
}
loadDetails: boolean;
addBusinessAssetsDetailsWithData(supp_data) {
var result = Object.keys(supp_data).map(function (key) {
return supp_data[key];
});
if (result.length > 0) {
result.forEach((datas,index) => {
this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value);
});
for (let val of result) {
let vals = {
business_assets_mode: val.business_assets_mode,
business_approximate_market_value: val.business_approximate_market_value,
business_name_of_the_owner: val.business_name_of_the_owner,
business_name_of_the_other_owner: val.business_name_of_the_other_owner,
business_purchase_year: val. business_purchase_year,
business_vintage : val.business_vintage,
business_emi: val.business_emi,
};
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_details'];
control.push(this.initBusinessDetailsWithdata(vals));
this.setBusinessAssetsDetailsWithData(vals.business_assets_mode, val.business_details, control.length - 1)
}
}
this.loadDetails = true;
}
setBusinessAssetsDetailsWithData(assets_details_mode: any, datas: any, i: any): void {
let val = i;
let data = datas;
const arr = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
arr.controls.splice(0);
switch (assets_details_mode) {
case '2': {
let business_property_datas : any;
data.forEach((datas,i) => {
business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type };
});
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadPropertyWithData(business_property_datas));
break;
}
case '3': {
let business_Four_Weeler_datas : any;
data.forEach((datas,i) => {
business_Four_Weeler_datas = { 'manufacturer_model_vehicle': datas.manufacturer_model_vehicle };
});
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.load_Four_WeelerWithData(business_Four_Weeler_datas));
break;
}
case '4': {
let equipment_manufacturing_description_datas : any;
data.forEach((datas,i) => {
equipment_manufacturing_description_datas= { 'equipment_manufacturing_description': datas.equipment_manufacturing_description };
});
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadEquipmentManufacturingDescriptionWithData(equipment_manufacturing_description_datas));
break;
}
// case '4': {
// break;
// }
// case '5': {
// let business_ConsumerDurableDescription_datas : any;
// data.forEach((datas,i) => {
// business_ConsumerDurableDescription_datas = { 'consumer_durable_description': datas.consumer_durable_description };
// });
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
// control.push(this.loadConsumerDurableDescriptionWithData(business_ConsumerDurableDescription_datas));
// break;
// }
// case '6': {
// let business_InsuranceDescription_datas : any;
// data.forEach((datas,i) => {
// this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
// this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured);
// business_InsuranceDescription_datas = {
// 'premium_paid': datas.premium_paid,
// 'frequency_mode': datas.frequency_mode,
// 'other_frequency_mode':datas.other_frequency_mode,
// 'sum_assured': datas.sum_assured,
// 'members_coverd': datas.members_coverd
// };
// });
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
// control.push(this.loadInsuranceDescriptionWithData(business_InsuranceDescription_datas));
// break;
// }
// case '7': {
// let business_InvestDescription_datas : any;
// data.forEach((datas,i) => {
// this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
// business_InvestDescription_datas = { 'investments_type': datas.investments_type,
// 'other_investments_type' : datas.other_investments_type,
// 'amount_of_invest': datas.amount_of_invest,
// 'bank_name': datas.bank_name };
// });
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
// control.push(this.loadInvestDescriptionWithData(business_InvestDescription_datas));
// break;
// }
case '1': {
let array_datas : any;
data.forEach((datas,i) => {
this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value);
array_datas = {
'any_other_assets': datas.any_other_assets,
'any_other_asset_value' : datas.any_other_asset_value,
'any_other_asset_loan' : datas.any_other_asset_loan,
};
});
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.otherBusinessAssetsDescriptionWithData(array_datas));
break;
}
default: {
break;
}
}
}
/** Add More Asset using Flag Both "Other Asset" And "Business Asset" */
addAssetDetails(e) {
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_details'];
control.push(this.initBusinessDetails());
}
/** To remove The Added Asset using Flag Both "Other Asset" And "Business Asset" */
removeAssetsDetails(i: number) {
const control = <FormArray>this._businessAssetsQuesFrom.controls['business_assets_details'];
control.removeAt(i);
}
public paymentModeTextBox: number;
selectedPM(e) {
this.paymentModeTextBox = e.value;
// this.f.supplier_details.controls.get('payment_mode_value');
}
public freqPurchaseTextBox: number;
selectedFreqPurchase(e) {
this.freqPurchaseTextBox = e.value;
}
// // compare objects for merge two master table details
// compareObjects(o1: any, o2: any) {
// if(o1.id == o2.id && o1.group_id == o2.group_id)
// return true;
// else return false
// }
// // check others
checkOthers(values){
if(values!=null) {
return values.id==0 ? true : false;
}
else {
return false;
}
}
// calculate vintage and purchase {}
calculateVintagePurchase(value: any, controlKey: any,type: number){
if(type==1){
let control: any = <FormArray>this._businessAssetsQuesFrom.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._businessAssetsQuesFrom.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('')
}
}
/** To Save/Edited Popup Data */
onSubmit() {
this.submitted = true;
// stop here if form is invalid
if (this._businessAssetsQuesFrom.invalid) {
this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!');
return;
} else {
var answerFormValues = this._businessAssetsQuesFrom.value;
//To Remove The "Null" With Key also
Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]);
// Save the data with help of Service
this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe(
dataresult => {
if(dataresult.status == 200) {
this.notifier.notify('success', 'Saved Successfully.');
setTimeout(() =>{
this.dialogRef.close();
},3000);
}
else {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
}
}, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
});
}
}
/** To Reset Popup Data */
onReset() {
const arr = <FormArray>this._businessAssetsQuesFrom.controls.business_assets_details;
arr.controls.splice(0);
this.getPdSupplierFormDetails();
}
/** On Key Press Event For Number only Accepting */
keyPress(event: any) {
const pattern = /[0-9\-\.\ ]/;
let inputChar = String.fromCharCode(event.charCode);
if (event.keyCode != 8 && !pattern.test(inputChar)) {
event.preventDefault();
}
}
/** Amount InWords */
inWords(e,i,flag){
switch(flag){
case 1 :
this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
// case 2 :
// this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
// break;
// case 3 :
// this.emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
// break;
// case 4 :
// this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
// break;
// case 5 :
// this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
// break;
case 6 :
this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
// case 7 :
// this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
// break;
default:
break;
}
}
}

View File

@ -9,6 +9,7 @@ import {ClientInfoComponent} from './../../forms/client-info/client-info.compone
import {StockComponent} from './../../forms/stock/stock.component';
import {FinancialInfoComponent} from './../../forms/financial-info/financial-info.component';
import {BusinessInfoComponent} from './../../forms/business-info/business-info.component';
import { BusinessAssetsInfoComponent } from './../../forms/business-assets-info/business-assets-info.component';
@Component({
selector: 'app-business-info-group',
@ -116,6 +117,18 @@ export class BusinessInfoGroupComponent implements OnInit {
this.getCompanyListForBusiness();
});
}
else if(details.form_id==22){
const dialogRef = this.dialog.open(BusinessAssetsInfoComponent, {
data: this.pd_all_details,
position: { right: '0'},
width:'80%',
disableClose: true
});
dialogRef.afterClosed()
.subscribe(dataresult => {
this.getCompanyListForBusiness();
});
}
}

View File

@ -99,8 +99,9 @@ export class StockComponent implements OnInit {
// })
//this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(
this._pd.stockFormAccess({pd_id:this.pdid,company_id:this.company_id}).subscribe(data => {
this._pd.stockFormAccess(this.pdid,this.company_id).subscribe(data => {
console.log(data);
if(data.dataStatus == true){
let datas = data.records;
if(datas.type_of_activity != undefined){

View File

@ -27,6 +27,7 @@ import {GeneralInfoComponent} from './forms/general-info/general-info.component'
import {NeighbourHoodComponent} from './forms/neighbour-hood/neighbour-hood.component';
import {FinalRemarksComponent} from './forms/final-remarks/final-remarks.component';
import { BusinessInfoGroupComponent } from './forms/business-info-group/business-info-group.component';
import { BusinessAssetsInfoComponent } from './forms/business-assets-info/business-assets-info.component';
@Component({
selector: 'app-start-pd',
@ -417,6 +418,19 @@ export class StartPdComponent implements OnInit, OnDestroy {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD);
});
}else
if(this.selectedFormsCategory.form_id==22){
const dialogRef = this.dialog.open(BusinessAssetsInfoComponent, {
data: this.pdFullDetails,
position: { right: '0'},
width:'80%',
disableClose: true
});
dialogRef.afterClosed()
.subscribe(dataresult => {
// this.notifier.notify('success', 'Successfully allocated.!');
this.loadTemplates(this.startPD);
});
}

View File

@ -91,6 +91,7 @@ import { QcReviewComponent } from './list-pd/pd-report/qc-review/qc-review.compo
import { SharedModule } from "app/shared/shared.module";
import { BusinessInfoGroupComponent } from './list-pd/start-pd/forms/business-info-group/business-info-group.component';
import { SearchRelationPipe } from './../pd-pipes/search-relation.pipe';
import { BusinessAssetsInfoComponent } from './list-pd/start-pd/forms/business-assets-info/business-assets-info.component';
/**
* Custom angular notifier options
@ -268,7 +269,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
// OwlNativeDateTimeModule,
// ],
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe],
declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, BusinessAssetsInfoComponent],
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
// providers: [PdTrigerService, GetGeometricLocationService],
@ -311,7 +312,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent,
ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent],
})

View File

@ -461,9 +461,12 @@ export class PdTrigerService {
)
}
stockFormAccess(pdid: any): Observable<any> {
return this._http.post<any>(this.apiUrl + "getTypeOfActivetyFromBusinessForm", { "records": pdid })
/** For Stock Details
* To Get The Products With TypeofActivity From Business
**/
stockFormAccess(pdid: any,companyid: any): Observable<any> {
// - { "pd_id":"104","company_id":"1"}
return this._http.post<any>(this.apiUrl + "getProductsWithTypeofActivityFromBusiness", { "records": { "pd_id" : pdid , "company_id":companyid} })
.pipe(
catchError(this.handleError('operation', []))
)