merge commit : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-01-11 18:28:59 +05:30
parent 54a147b15f
commit d02a6fddb7
9 changed files with 186 additions and 239 deletions

View File

@ -115,7 +115,7 @@
</mat-form-field>
<mat-form-field style="width: 28%">
<input matInput autocomplete="off" placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" required autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="pdMain.loan_amount.value">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:100%" *ngIf="pdMain.loan_amount.value">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
<!-- <mat-error *ngIf="pdMain.loan_amount.hasError('required')">Amount Required.</mat-error> -->
<mat-error *ngIf="pdMain.loan_amount.hasError('pattern')">Enter valid amount. </mat-error>

View File

@ -28,7 +28,7 @@
<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">{{ asset.name | titlecase }}</mat-option>
<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>
@ -55,26 +55,27 @@
</div>
</div>
<!--Four Wheeler-->
<!--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:30%">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_four_weeler" autocomplete="off">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_vehicle" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
<!--Two Wheeler-->
<!-- 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:30%">
<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>
@ -174,7 +175,7 @@
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" (selectionChange)="selectedAssetLoanType($event.value,2)">
<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>
@ -186,24 +187,6 @@
</div>
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off">
</mat-form-field>
<!-- <mat-form-field class="ml-xs example-full-width"> -->
<!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" > -->
<!-- </mat-form-field> --
<mat-form-field style="width:30%">
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" (selectionChange)="selectedAssetLoanType($event.value,2)">
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue}}</mat-option>
</mat-select>
</mat-form-field>
<!-- <mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'"> --
<mat-form-field style="width:95%" *ngIf="businessEmiAmtFlag">
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off">
<!-- <span matSuffix>.00</span> --
</mat-form-field>
</div>-->
</div>
</div>
</div>
@ -238,40 +221,29 @@
<span *ngIf="sup.get('business_assets_mode').value != ''">
<mat-form-field style="width:30%">
<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:30%">
<mat-label>Purchase Year</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="business_purchase_year" (keypress)="keyPress($event)">
<mat-error> Invalid year format</mat-error>
<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-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>
<mat-form-field style="width:95%" *ngIf="sup.get('business_emi').value === 'yes'">
<input matInput placeholder="Amount of EMI on This Loan?" formControlName="business_emi_paid" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,3)">
<mat-hint align="start" style="font-size:70%" *ngIf="sup.get('business_emi_paid').value != ''">{{"&#8377;"}} {{emiAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field *ngIf="sup.get('business_emi').value === 'yes'" style="width:30%">
<input matInput placeholder="Original Loan Tenure in Months" formControlName="business_original_loan_tenure" autocomplete="off" (change)="loanTenureCalc(sup,2)" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field *ngIf="sup.get('business_emi').value === 'yes'" style="width:30%">
<input matInput placeholder="Balance Tenure in Months" formControlName="business_balance_tenure" autocomplete="off" (change)="loanTenureCalc(sup,2)" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field *ngIf="sup.get('business_emi').value === 'yes' && sup.get('business_original_loan_tenure').value != '' && sup.get('business_balance_tenure').value != '' " style="width:30%">
<input matInput placeholder="Elapsed Tenure in Months" formControlName="business_elapsed_tenure" autocomplete="off" readonly>
</mat-form-field>
</div>
</span>
@ -305,7 +277,7 @@
</div>
</ng-template>
</mat-tab>
<mat-tab label="Other Personal Assets">
<mat-tab label="Other Assets">
<ng-template matTabContent>
<div fxLayout="row wrap">
<div fxFlex="100">
@ -350,19 +322,20 @@
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_four_weeler" autocomplete="off">
<input matInput placeholder="Manufacturer, Model" formControlName="manufacturer_model_vehicle" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
<!--Two Wheeler-->
<!-- Eqipment Manufacturing -->
<div *ngIf="sup.get('assets_mode').value == 3">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<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>
@ -448,7 +421,7 @@
<mat-form-field style="width:30%">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,10)">
<mat-hint align="start" style="font-size:70%" *ngIf="sup.get('amount_of_invest').value != ''">{{"&#8377;"}} {{OtherAmtInvestInwords[i]}} Only</mat-hint>
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('amount_of_invest').value != ''">{{"&#8377;"}} {{OtherAmtInvestInwords[i]}} Only</mat-hint>
</mat-form-field>
</div>
@ -474,26 +447,34 @@
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<mat-select placeholder="Name of the Owner"
<mat-form-field style="width:45%">
<!-- <mat-select placeholder="Name of the Owner"
formControlName="name_of_the_owner" >
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name | titlecase}}</mat-option>
</mat-select>
</mat-select> -->
<mat-select placeholder="Name of the Owner"
formControlName="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="sup.get('name_of_the_owner').value == 0" style="width:30%">
<mat-form-field *ngIf="checkOthers(sup.get('name_of_the_owner').value)===true" style="width:45%">
<input matInput placeholder="Specify Owner Name"
formControlName="other_owner" autocomplete="off">
</mat-form-field>
<mat-form-field style="width:30%">
<!-- <mat-form-field style="width:30%">
<mat-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}"
*ngFor="let relations of m_relation">
{{relations.name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
</mat-form-field> -->
</div>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -502,21 +483,11 @@
<input matInput placeholder="Value of the Assets" formControlName="any_other_asset_value" autocomplete="off" (keyup)="inWords($event,s,12)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('any_other_asset_value').value != ''">{{"&#8377;"}} {{OtherAssetValueInwords[s]}} Only</mat-hint>
</mat-form-field>
<!-- <mat-form-field class="ml-xs example-full-width"> -->
<!-- <input matInput placeholder="Is Any Loan" formControlName="any_other_asset_loan" > -->
<!-- </mat-form-field> -->
<mat-form-field style="width:30%">
<mat-select placeholder="Is there any asset loan?" formControlName="any_other_asset_loan" (selectionChange)="selectedAssetLoanType($event.value,1)">
<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>
<!-- <input matInput placeholder="What is the EMI amount ?" formControlName="any_other_asset_loan" autocomplete="off"> -->
</mat-form-field>
<!-- <mat-form-field class="ml-xs example-full-width" *ngIf="detail.get(any_other_asset_loan).value == 'yes'"> -->
<mat-form-field style="width:30%" *ngIf="otherEmiamtFlag">
<!-- <mat-form-field class="ml-xs example-full-width"> -->
<input matInput placeholder="What is the EMI amount ?" formControlName="other_asset_emi_amt" autocomplete="off"(keyup)="inWords($event,s,14)" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="detail.get('other_asset_emi_amt').value != ''">{{"&#8377;"}} {{O_emiAmtInwords[s]}} Only</mat-hint>
<!-- <span matSuffix>.00</span> -->
</mat-form-field>
</div>
</div>
@ -530,63 +501,62 @@
<mat-hint align="start" style="font-size:70%" *ngIf="sup.get('approximate_market_value').value != ''">{{"&#8377;"}} {{OtherAppxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5" style="width:30%">
<mat-select placeholder="Name of the Owner" formControlName="name_of_the_owner" >
<mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5" style="width:45%">
<!-- <mat-select placeholder="Name of the Owner" formControlName="name_of_the_owner" >
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name | titlecase}}</mat-option>
</mat-select>
</mat-select> -->
<mat-select placeholder="Name of the Owner"
formControlName="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="sup.get('name_of_the_owner').value == 0 && sup.get('name_of_the_owner').value != ''" style="width:30%">
<mat-form-field *ngIf="checkOthers(sup.get('name_of_the_owner').value)===true" style="width:45%">
<input matInput placeholder="Specify Owner Name"
formControlName="other_owner" autocomplete="off">
</mat-form-field>
<!-- check -->
<mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5" style="width:30%">
<!-- <mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5" style="width:30%">
<mat-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}"
*ngFor="let relations of m_relation">
{{relations.name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
</mat-form-field> -->
</div>
<span *ngIf="sup.get('assets_mode').value != ''">
<mat-form-field style="width:30%">
<mat-label>Purchase Year</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="purchase_year" (keypress)="keyPress($event)">
<mat-error> Invalid year format</mat-error>
</mat-form-field>
<mat-form-field style="width:30%">
<mat-label>Vintage</mat-label>
<input matInput autocomplete="off" placeholder="eg.999" formControlName="vintage_personal" minlength="1" maxlength="3" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,3)">
<!-- <mat-error> Invalid format</mat-error> -->
</mat-form-field>
<mat-form-field style="width:30%">
<mat-label>Purchase Year</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="purchase_year" minlength="4" maxlength="4" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,4)">
<!-- <mat-error> Invalid year format</mat-error> -->
</mat-form-field>
</span>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5" style="width:95%">
<mat-select placeholder="Is there a loan existing against this asset?" formControlName="emi">
<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>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="sup.get('emi').value === 'yes'" style="width:95%">
<input matInput placeholder="Amount of EMI on This Loan?" formControlName="emi_paid" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,4)">
<mat-hint align="start" style="font-size:70%" *ngIf="sup.get('emi_paid').value != ''">{{"&#8377;"}} {{OtherEmiAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field *ngIf="sup.get('emi').value === 'yes'" style="width:30%">
<input matInput placeholder="Original Loan Tenure in Months" formControlName="original_loan_tenure" (change)="loanTenureCalc(sup,1)" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
<mat-form-field *ngIf="sup.get('emi').value === 'yes'" style="width:30%">
<input matInput placeholder="Balance Tenure in Months" formControlName="balance_tenure" (change)="loanTenureCalc(sup,1)"(keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
<mat-form-field *ngIf="sup.get('emi').value === 'yes' && sup.get('original_loan_tenure').value != '' && sup.get('balance_tenure').value != '' " style="width:30%">
<input matInput placeholder="Elapsed Tenure in Months" formControlName="elapsed_tenure" autocomplete="off" readonly>
</mat-form-field>
</div>
</div>
<div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none">

View File

@ -37,7 +37,7 @@ export class AssetsInfoComponent implements OnInit {
public _assetsQuesFrom: FormGroup;
public submitted = false;
public m_assets_type = [];
public m_relation = [];
//public m_relation = [];
public applicants: any;
otherEmiamtFlag : boolean = false;
businessEmiAmtFlag : boolean = false;
@ -186,7 +186,7 @@ public m_investmentType = [];
private notifier: NotifierService;
existCompanyList: any =[];
mergeCompanyApplicant: any=[];
currentYear:any=new Date().getFullYear();
constructor(
notifier: NotifierService,
private _formBuilder: FormBuilder,
@ -225,7 +225,7 @@ public m_investmentType = [];
// });
this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){
this.existCompanyList = data.records.filter(val =>val.is_active);
this.existCompanyList = data.records.filter(val =>val.is_active===true && val.is_company_applicant===true);
}
let modifyCompanyList : any=[];
@ -234,9 +234,7 @@ public m_investmentType = [];
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 => {
@ -252,7 +250,7 @@ public m_investmentType = [];
this.getM_PropertyType();
this.getM_InvestmentType();
this.getM_FreqOfPurchase();
this.getM_Relation();
//this.getM_Relation();
//this.getM_InsuranceType();
}
@ -295,16 +293,16 @@ public m_investmentType = [];
)
}
getM_Relation() {
this.pdTrigerService.getAllMasterDatas('RELATIONSHIPS').subscribe(
data => {
this.m_relation = data.records.filter(data => data.isactive == 1);
},
error => {
this.notifier.notify('warning', 'No Category Records Found.!');
}
)
}
// getM_Relation() {
// this.pdTrigerService.getAllMasterDatas('RELATIONSHIPS').subscribe(
// data => {
// this.m_relation = data.records.filter(data => data.isactive == 1);
// },
// error => {
// this.notifier.notify('warning', 'No Category Records Found.!');
// }
// )
// }
getM_FreqOfPurchase() {
this.pdTrigerService.getAllMasterDatas('FREQUENCY').subscribe(
@ -395,14 +393,11 @@ public m_investmentType = [];
approximate_market_value: [''],
name_of_the_owner: [''],
other_owner:[''],
relation: [''],
purchase_year: ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])],
// relation: [''],
vintage_personal : [''],
purchase_year: ['',Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
//purchase_month: [''],
emi: [''],
emi_paid: [''],
original_loan_tenure: [''],
balance_tenure: [''],
elapsed_tenure: [''],
});
}
@ -415,13 +410,10 @@ public m_investmentType = [];
business_name_of_the_other_owner: [],
//other_owner:[''],
//relation:[''],
business_purchase_year: ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])],
business_vintage: [''],
business_purchase_year: ['',Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
//purchase_month: [''],
business_emi: [''],
business_emi_paid: [''],
business_original_loan_tenure: [''],
business_balance_tenure: [''],
business_elapsed_tenure: [''],
});
}
@ -454,7 +446,7 @@ public m_investmentType = [];
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 ;
control.push(this.load_Two_Weeler());
control.push(this.loadEquipmentManufacturingDescription());
break;
}
case '4': {
@ -518,15 +510,20 @@ public m_investmentType = [];
});
}
loadEquipmentManufacturingDescription() {
return this._formBuilder.group({
equipment_manufacturing_description: ['']
});
}
otherAssetsDescription() {
return this._formBuilder.group({
any_other_assets: [''],
name_of_the_owner:[''],
other_owner:[''],
relation:[''],
//relation:[''],
any_other_asset_value : [''],
any_other_asset_loan : [''],
other_asset_emi_amt : ['']
});
}
@ -535,9 +532,7 @@ public m_investmentType = [];
return this._formBuilder.group({
any_other_assets: [''],
any_other_asset_value : [''],
any_other_asset_loan : [''],
other_asset_emi_amt : ['']
any_other_asset_loan : [''],
});
}
@ -556,20 +551,20 @@ public m_investmentType = [];
return this._formBuilder.group({
investments_type: [''],
other_investments_type:[''],
amount_of_invest: [''],
amount_of_invest: [],
bank_name: ['']
});
}
load_Four_Weeler() {
return this._formBuilder.group({
manufacturer_model_four_weeler: ['']
manufacturer_model_vehicle: ['']
});
}
load_Two_Weeler() {
return this._formBuilder.group({
manufacturer_model_two_weeler: ['']
manufacturer_model_vehicle: ['']
});
}
@ -592,16 +587,20 @@ public m_investmentType = [];
consumer_durable_description: [data.consumer_durable_description]
});
}
loadEquipmentManufacturingDescriptionWithData(data) {
return this._formBuilder.group({
equipment_manufacturing_description: [data.equipment_manufacturing_description]
});
}
otherAssetsDescriptionWithData(data) {
return this._formBuilder.group({
any_other_assets: [data.any_other_assets],
name_of_the_owner:[data.name_of_the_owner],
other_owner:[data.other_owner],
relation:[data.relation],
// relation:[data.relation],
any_other_asset_value : [data.any_other_asset_value],
any_other_asset_loan : [data.any_other_asset_loan],
other_asset_emi_amt : [data.other_asset_emi_amt]
});
}
@ -610,7 +609,6 @@ public m_investmentType = [];
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],
other_asset_emi_amt : [data.other_asset_emi_amt]
});
}
@ -638,13 +636,13 @@ public m_investmentType = [];
load_Four_WeelerWithData(data) {
return this._formBuilder.group({
manufacturer_model_four_weeler: [data.manufacturer_model_four_weeler]
manufacturer_model_vehicle: [data.manufacturer_model_vehicle]
});
}
load_Two_WeelerWithData(data) {
return this._formBuilder.group({
manufacturer_model_two_weeler: [data.manufacturer_model_two_weeler]
manufacturer_model_vehicle: [data.manufacturer_model_vehicle]
});
}
@ -657,34 +655,29 @@ public m_investmentType = [];
approximate_market_value: [data.approximate_market_value],
name_of_the_owner: [data.name_of_the_owner],
other_owner:[data.other_owner || ''],
relation: [data.relation || ''],
purchase_year: [data.purchase_year],
//relation: [data.relation || ''],
vintage_personal : [data. vintage_personal],
purchase_year: [data. purchase_year,Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
// purchase_month: [data.purchase_month],
emi: [data.emi || 0],
emi_paid: [data.emi_paid || ''],
original_loan_tenure: [data.original_loan_tenure || ''],
balance_tenure: [data.balance_tenure || ''],
elapsed_tenure: [data.elapsed_tenure || '']
});
}
initBusinessDetailsWithdata(data) {
return this._formBuilder.group({
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_purchase_year: [data. business_purchase_year],
business_vintage: [data. business_vintage],
business_purchase_year: [data. business_purchase_year,Validators.compose([Validators.pattern("[1-9]{1}[0-9]{3}")])],
// purchase_month: [data.purchase_month],
business_emi: [data.business_emi || 0],
business_emi_paid: [data.business_emi_paid || ''],
business_original_loan_tenure: [data.business_original_loan_tenure || ''],
business_balance_tenure: [data.business_balance_tenure || ''],
business_elapsed_tenure: [data.business_elapsed_tenure || '']
});
return formGroup;
}
loadDetails: boolean;
@ -695,7 +688,6 @@ public m_investmentType = [];
result.forEach((datas,index) => {
this.OtherAppxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.approximate_market_value);
this.OtherEmiAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.emi_paid);
});
if (result.length > 0) {
@ -705,14 +697,11 @@ public m_investmentType = [];
approximate_market_value: val.approximate_market_value,
name_of_the_owner: val.name_of_the_owner,
other_owner:val.other_owner,
relation: val.relation,
// relation: val.relation,
vintage_personal: val.vintage_personal,
purchase_year: val.purchase_year,
// purchase_month: val.purchase_month,
emi: val.emi,
emi_paid: val.emi_paid,
original_loan_tenure: val.original_loan_tenure,
elapsed_tenure: val.elapsed_tenure,
balance_tenure: val.balance_tenure
};
const control = <FormArray>this._assetsQuesFrom.controls['assets_details'];
control.push(this.initDetailsWithdata(vals));
@ -731,7 +720,6 @@ public m_investmentType = [];
if (result.length > 0) {
result.forEach((datas,index) => {
this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value);
this.emiAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_emi_paid);
});
for (let val of result) {
@ -742,12 +730,9 @@ public m_investmentType = [];
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,
business_emi_paid: val.business_emi_paid,
business_original_loan_tenure: val.business_original_loan_tenure,
business_elapsed_tenure: val.business_elapsed_tenure,
business_balance_tenure: val.business_balance_tenure
};
const control = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
@ -782,7 +767,7 @@ public m_investmentType = [];
case '2': {
let array_data : any;
data.forEach((datas,i) => {
array_data = { 'manufacturer_model_four_weeler': datas.manufacturer_model_four_weeler };
array_data = { 'manufacturer_model_vehicle': datas.manufacturer_model_vehicle };
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.load_Four_WeelerWithData(array_data));
@ -791,10 +776,10 @@ public m_investmentType = [];
case '3': {
let array_data : any;
data.forEach((datas,i) => {
array_data = { 'manufacturer_model_two_weeler': datas.manufacturer_model_two_weeler };
array_data = { 'equipment_manufacturing_description': datas.equipment_manufacturing_description };
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.load_Two_WeelerWithData(array_data));
control.push(this.loadEquipmentManufacturingDescriptionWithData(array_data));
break;
}
case '4': {
@ -847,13 +832,11 @@ public m_investmentType = [];
array_data = { 'any_other_assets': datas.any_other_assets,
'name_of_the_owner':datas.name_of_the_owner,
'other_owner':datas.other_owner,
'relation':datas.relation,
//'relation':datas.relation,
'any_other_asset_value' : datas.any_other_asset_value,
'any_other_asset_loan' : datas.any_other_asset_loan,
'other_asset_emi_amt' : datas.other_asset_emi_amt
};
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.any_other_asset_value);
this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt);
});
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.otherAssetsDescriptionWithData(array_data));
@ -886,19 +869,19 @@ public m_investmentType = [];
case '2': {
let business_Four_Weeler_datas : any;
data.forEach((datas,i) => {
business_Four_Weeler_datas = { 'manufacturer_model_four_weeler': datas.manufacturer_model_four_weeler };
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 business_Two_Weeler_datas : any;
let equipment_manufacturing_description_datas : any;
data.forEach((datas,i) => {
business_Two_Weeler_datas = { 'manufacturer_model_two_weeler': datas.manufacturer_model_two_weeler };
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.load_Two_WeelerWithData(business_Two_Weeler_datas));
control.push(this.loadEquipmentManufacturingDescriptionWithData(equipment_manufacturing_description_datas));
break;
}
case '4': {
@ -947,12 +930,10 @@ public m_investmentType = [];
let array_datas : any;
data.forEach((datas,i) => {
this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+data.any_other_asset_value);
this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.other_asset_emi_amt);
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,
'other_asset_emi_amt' : datas.other_asset_emi_amt
};
});
const control = (<FormArray>this._assetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
@ -997,19 +978,6 @@ public m_investmentType = [];
selectedFreqPurchase(e) {
this.freqPurchaseTextBox = e.value;
}
/** Show/hide EMI amount Field using Flag Both "other Asset" and "business"
* REF = "Other Asset type at last Field"
**/
selectedAssetLoanType(e: any,flag): void {
if(flag == 1){
this.otherEmiamtFlag = (e == 'yes') ? true : false;
}
else if(flag == 2){
this.businessEmiAmtFlag = (e == 'yes') ? true : false;
}
}
// compare objects for merge two master table details
compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id)
@ -1028,6 +996,29 @@ public m_investmentType = [];
}
// calculate vintage and purchase {}
calculateVintagePurchase(value: any, controlKey: any,type: number){
if(type==1){
let control: any = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
control.controls[controlKey].controls['business_purchase_year'].setValue(value!='' ? parseInt(this.currentYear)-parseInt(value) : '');
}
else if(type==2) {
let control: any = <FormArray>this._assetsQuesFrom.controls['business_assets_details'];
value!='' && value<=this.currentYear ? control.controls[controlKey].controls['business_purchase_year'].setValue(value) : control.controls[controlKey].controls['business_purchase_year'].setValue('');
value!='' && value<=this.currentYear ? control.controls[controlKey].controls['business_vintage'].setValue(parseInt(this.currentYear)-parseInt(value)) : control.controls[controlKey].controls['business_vintage'].setValue('')
}
else if(type==3){
let control: any = <FormArray>this._assetsQuesFrom.controls['assets_details'];
control.controls[controlKey].controls['purchase_year'].setValue(value!='' ? parseInt(this.currentYear)-parseInt(value) : '');
}
else if(type==4) {
let control: any = <FormArray>this._assetsQuesFrom.controls['assets_details'];
value!='' && value<=this.currentYear ? control.controls[controlKey].controls['purchase_year'].setValue(value) : control.controls[controlKey].controls['purchase_year'].setValue('');
value!='' && value<=this.currentYear ? control.controls[controlKey].controls['vintage_personal'].setValue(parseInt(this.currentYear)-parseInt(value)) : control.controls[controlKey].controls['vintage_personal'].setValue('')
}
}
/** To Save/Edited Popup Data */
onSubmit() {
this.submitted = true;
@ -1040,24 +1031,6 @@ public m_investmentType = [];
//To Remove The "Null" With Key also
Object.keys(answerFormValues).forEach((key) => (answerFormValues[key] == null) && delete answerFormValues[key]);
answerFormValues.assets_details.map(val => {
if (val.emi == '0') {
val.emi_paid = '';
val.original_loan_tenure = '';
val.balance_tenure = '';
val.elapsed_tenure = '';
}
});
//To Remove The "Null" With Key also
answerFormValues.business_assets_details.map(val => {
if (val.business_emi == '0') {
val.business_emi_paid = '';
val.business_original_loan_tenure = '';
val.business_balance_tenure = '';
val.business_elapsed_tenure = '';
}
});
// Save the data with help of Service
this.pdTrigerService.savePDFormDetailsWithID(answerFormValues).subscribe(
dataresult => {

View File

@ -63,11 +63,12 @@
<mat-card-content>
<div fxLayout="row wrap" formArrayName="companies">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" *ngFor="let com of _generalForm.controls.companies['controls']; let c = index; let last = last;" [formGroupName]="c">
<mat-form-field style="width: 60%" *ngIf="com.value.is_active==true">
<mat-form-field style="width: 45%" *ngIf="com.value.is_active==true">
<input matInput placeholder="Company/Firm" formControlName="company_name" type="text">
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeCompanies(c)" *ngIf="c>0 && com.value.is_active==true"
<mat-checkbox class="table-checkbox-com" color="primary" formControlName="is_company_applicant"> Is Applicant</mat-checkbox>
<button type="button" class="mr-1 mb-1 hover-icon table-checkbox-com" mat-raised-button mat-icon-button (click)="removeCompanies(c)" *ngIf="c>0 && com.value.is_active==true"
matTooltip="Remove Company/Firm" matTooltipPosition="above">
<mat-icon>delete</mat-icon>
</button>

View File

@ -20,6 +20,9 @@
.table-checkbox {
margin-left: 15% !important;
}
.table-checkbox-com {
margin-left: 3% !important;
}
.p-text {
color:#e00201 !important;
font-weight: bold;

View File

@ -217,13 +217,13 @@ export class GeneralInfoComponent implements OnInit {
// create companies
if(element.company_name!='' && element.company_name!=null){
let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:element.company_name,is_active:true}
let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:element.company_name,is_company_applicant:element.is_company_applicant,is_active:true}
companyControl.push(this.createCompanies(setCompanyValues))
}
});
// check company if null update one row
if(companyControl.controls.length ==0){
let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:'',is_active:true}
let setCompanyValues: any = {company_order_id :companyControl.controls.length+1,company_name:'',is_company_applicant:false,is_active:true,is_new:false}
companyControl.push(this.createCompanies(setCompanyValues))
}
@ -258,7 +258,9 @@ export class GeneralInfoComponent implements OnInit {
company_order_id: [elementValue.company_order_id],
company_name: [elementValue.company_name],
company_messrs_name: ['M/s'],
is_active: [elementValue.is_active]
is_company_applicant:[elementValue.is_company_applicant],
is_active: [elementValue.is_active],
is_new:[elementValue.is_new]
});
}
@ -305,7 +307,7 @@ export class GeneralInfoComponent implements OnInit {
// add more companies
addMoreCompanies() {
let control: any = this._generalForm.get('companies') as FormArray;
let setValues: any = {company_order_id :control.controls.length+1,company_name:'',is_active:true}
let setValues: any = {company_order_id :control.controls.length+1,company_name:'',is_company_applicant:false,is_active:true,is_new: true}
control.push(this.createCompanies(setValues))
}

View File

@ -20,14 +20,11 @@
<mat-card>
<mat-card-content class="matcard">
<div fxLayout="row wrap">
<div fxFlex="33">
<mat-form-field style="width: 80%">
<mat-form-field style="width: 64%">
<input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
</mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field style="width: 80%">
<mat-form-field style="width: 28%">
<mat-select multiple (selectionChange)="endUserChange($event.value)" placeholder="What is the end use" formControlName="end_use" >
<mat-option *ngFor="let enduse of m_endUseForLoan" [value]="enduse.enduse_of_loan_id">{{ enduse.enduse_of_loan}}</mat-option>
</mat-select>
@ -43,12 +40,9 @@
<mat-option value="other">Other purpose</mat-option>
</mat-select>-->
</mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field *ngIf="isOtherPurpose" style="width: 80%">
<mat-form-field *ngIf="isOtherPurpose" style="width: 28%">
<input matInput placeholder="Specify End Use" formControlName="end_use_other" autocomplete="off">
</mat-form-field>
</div>
</div>
<div fxLayout="row wrap">
@ -68,7 +62,7 @@
<div *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes' && loanDetailsForm.controls['is_transfer'].value != ''">
<mat-form-field style="width: 60%">
<input matInput placeholder="What is the amount for Balance Transfer ? " (keypress)="keyPress($event)" formControlName="balance_transfer_amount" (keyup)="inWords($event,2)" (change)="loanCalc()" autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{balTxrfAmtInWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{balTxrfAmtInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Is there a Top Up"
@ -90,7 +84,7 @@
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 60%">
<input matInput placeholder="Top Up Amount" (keypress)="keyPress($event)" formControlName="topup_amount" (keyup)="inWords($event,5)" autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 30%">
@ -101,7 +95,7 @@
<mat-form-field style="width: 30%">
<input matInput placeholder="Amount of Own Contribution" formControlName="own_contribution" (keypress)="keyPress($event)" (keyup)="inWords($event,4)" autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ownContributionInWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ownContributionInWords}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 30%">
@ -137,7 +131,7 @@
<mat-form-field style="width: 60%">
<input matInput placeholder="EMI Amount Comfortable Paying" formControlName="emi_level" (keypress)="keyPress($event)" (keyup)="inWords($event,6)" autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['emi_level'].value != ''">{{"&#8377;"}} {{emiAmtInWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['emi_level'].value != ''">{{"&#8377;"}} {{emiAmtInWords}} Only</mat-hint>
</mat-form-field>
</mat-card-content>
</mat-card>
@ -204,12 +198,12 @@
<mat-form-field>
<input matInput placeholder="Estimate Market Value as Per Customer"
formControlName="emv_per_customer" (keypress)="keyPress($event)" (keyup)="inWords($event,7)" autocomplete="off">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['emv_per_customer'].value != ''">{{"&#8377;"}} {{emvAmtInWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['emv_per_customer'].value != ''">{{"&#8377;"}} {{emvAmtInWords}} Only</mat-hint>
</mat-form-field>
<!-- <mat-form-field>
<input matInput placeholder="Value as Per Agreement"
formControlName="value_per_agreement" (keypress)="keyPress($event)" (keyup)="inWords($event,3)">
<mat-hint align="start" style="font-size:70%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{valAsPerAgmtInWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{valAsPerAgmtInWords}} Only</mat-hint>
</mat-form-field> -->
</mat-card-content>
</mat-card>

View File

@ -10,6 +10,10 @@
.matcard > * {
width: 80%;
}
.mat-form-field-appearance-legacy .mat-hint{
color:rgba(0, 0, 0, 0.8) !important;
}
.matcard mat-form-field {
margin: 0 2%;
width:26%;

View File

@ -20,7 +20,7 @@
<span *ngIf="master.pd_status!=pdStatusCheck.SCHEDULED && master.pd_status!=pdStatusCheck.QC_COMPLETED " style="text-align:left">{{master.pd_status | titlecase}}</span>
<span *ngIf="master.pd_status==pdStatusCheck.QC_COMPLETED " style="text-align:left">QC Completed</span>
</button>&nbsp;&nbsp;
<button *ngIf="master.pd_type_name && currentPDStatus==pdStatusCheck.DRAFT" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger" matTooltipPosition="above" (click)="editPdMaster(master)"><mat-icon>save</mat-icon></button>
<button *ngIf="master.pd_type_name && currentPDStatus==pdStatusCheck.DRAFT" mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Trigger" matTooltipPosition="above" (click)="editPdMaster(master)" style="cursor: not-allowed !important;"><mat-icon>flash_on</mat-icon></button>
<br>
<small *ngIf="master.pd_allocated_to && master.fk_pd_type==1" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.pd_allocated_to | titlecase}}</small>
<small *ngIf="master.executive_name && master.centralofficer && master.fk_pd_type==2" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.executive_name | titlecase}}/{{master.centralofficer | titlecase}}</small>