loan details : ps

This commit is contained in:
venbatechnologies@gmail.com 2018-12-13 11:13:25 +05:30
parent ccb5ead9d6
commit fcbdc8db99
2 changed files with 57 additions and 32 deletions

View File

@ -17,11 +17,11 @@
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">
<mat-card> <mat-card>
<mat-form-field> <mat-form-field style="width: 25%">
<input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" required > <input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,1)" (change)="loanCalc()" required>
<mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{loanAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field style="width: 25%">
<mat-select multiple (selectionChange)="endUserChange($event)" placeholder="What is the end use" formControlName="end_use" required> <mat-select multiple (selectionChange)="endUserChange($event)" placeholder="What is the end use" formControlName="end_use" required>
<mat-option *ngFor="let enduse of m_endUseofLoad" [value]="enduse.id">{{ enduse.name }}</mat-option> <mat-option *ngFor="let enduse of m_endUseofLoad" [value]="enduse.id">{{ enduse.name }}</mat-option>
</mat-select> </mat-select>
@ -37,49 +37,52 @@
<mat-option value="other">Other purpose</mat-option> <mat-option value="other">Other purpose</mat-option>
</mat-select>--> </mat-select>-->
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="isOtherPurpose"> <mat-form-field *ngIf="isOtherPurpose" style="width: 25%">
<input matInput placeholder="Specify End Use" formControlName="end_use_other"> <input matInput placeholder="Specify End Use" formControlName="end_use_other">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field style="width: 30%">
<mat-select placeholder="Is there a balance transfer ? " (selectionChange)="selectedBalancesTransferChanges($event)" <mat-select placeholder="Is there a balance transfer ? " (selectionChange)="selectedBalancesTransferChanges($event)"
formControlName="is_transfer" required > formControlName="is_transfer" required >
<mat-option value="yes">Yes</mat-option> <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option> <mat-option value="no">No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<div *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes' && loanDetailsForm.controls['is_transfer'].value != ''">
<mat-form-field *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes'"> <mat-form-field style="width: 50%">
<input matInput placeholder="What is the amount required for Balance Transfer ? " (keypress)="keyPress($event)" formControlName="balance_transfer_amount" (keyup)="inWords($event,2)"> <input matInput placeholder="What is the amount required for Balance Transfer ? " (keypress)="keyPress($event)" formControlName="balance_transfer_amount" (keyup)="inWords($event,2)" (change)="loanCalc()">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{balTxrfAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{balTxrfAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes'"> <mat-form-field style="width:20%">
<mat-select placeholder="Is there a Top Up" <mat-select placeholder="Is there a Top Up"
formControlName="is_topup" required> formControlName="is_topup" required>
<mat-option value="yes">Yes</mat-option> <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option> <mat-option value="no">No</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes'"> <mat-form-field style="width: 50%">
<mat-select placeholder="Lender from where balance transfer done" <mat-select placeholder="Lender from where balance transfer done"
formControlName="lender"> formControlName="lender">
<mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option> <mat-option *ngFor="let btLen of m_btLenderList" [value]="btLen.bt_lender_list_id">{{ btLen.lender_name }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['lender'].value == 3">
<mat-form-field *ngIf="loanDetailsForm.controls['lender'].value == 3" style="width: 25%">
<input matInput placeholder="Specify Others Lender" formControlName="other_bt_lender"> <input matInput placeholder="Specify Others Lender" formControlName="other_bt_lender">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['is_transfer'].value == 'yes' && loanDetailsForm.controls['is_topup'].value == 'yes'">
<input matInput placeholder="Top Up Amt" (keypress)="keyPress($event)" formControlName="topup_amount" (keyup)="inWords($event,5)"> <mat-form-field *ngIf="loanDetailsForm.controls['is_topup'].value == 'yes' && loanDetailsForm.controls['is_topup'].value != '' " style="width: 20%">
<input matInput placeholder="Top Up Amount" (keypress)="keyPress($event)" formControlName="topup_amount" (keyup)="inWords($event,5)">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{topUpAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div>
<div *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes' && loanDetailsForm.controls['is_transfer'].value != '' ">
<mat-form-field *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes'"> <mat-form-field style="width: 35%">
<input matInput placeholder="Amount of Own Contribution" formControlName="own_contribution" (keypress)="keyPress($event)" required (keyup)="inWords($event,4)"> <input matInput placeholder="Amount of Own Contribution" formControlName="own_contribution" (keypress)="keyPress($event)" required (keyup)="inWords($event,4)">
<mat-hint align="end" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ownContributionInWords}} Only</mat-hint> <mat-hint align="end" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ownContributionInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['is_transfer'].value != 'yes'"> <mat-form-field style="width: 35%">
<mat-select placeholder="Source" formControlName="source" required> <mat-select placeholder="Source" formControlName="source" required>
<mat-option *ngFor="let sour of m_sourceofamount" [value]="sour.id">{{ sour.name }}</mat-option> <mat-option *ngFor="let sour of m_sourceofamount" [value]="sour.id">{{ sour.name }}</mat-option>
</mat-select> </mat-select>
@ -90,11 +93,16 @@
<mat-option value="own_money">Own money</mat-option> <mat-option value="own_money">Own money</mat-option>
<mat-option value="other">Loan from another lender</mat-option> <mat-option value="other">Loan from another lender</mat-option>
</mat-select>--> </mat-select>-->
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="loanDetailsForm.controls['source'].value =='other'"> <mat-form-field *ngIf="loanDetailsForm.controls['source'].value =='other'" style="width: 35%">
<input matInput placeholder="Specify Lender Name and Type" formControlName="lender_name_type"> <input matInput placeholder="Specify Lender Name and Type" formControlName="lender_name_type">
</mat-form-field> </mat-form-field>
<mat-form-field>
</div>
<mat-form-field style="width: 50%">
<input matInput placeholder="EMI Comfort Level" formControlName="emi_level" (keypress)="keyPress($event)" required> <input matInput placeholder="EMI Comfort Level" formControlName="emi_level" (keypress)="keyPress($event)" required>
</mat-form-field> </mat-form-field>
<!-- <div *ngIf="productAbbr === 'HL' || productAbbr === 'LL' || productAbbr === 'LAP' "> --> <!-- <div *ngIf="productAbbr === 'HL' || productAbbr === 'LL' || productAbbr === 'LAP' "> -->

View File

@ -491,4 +491,21 @@ getM_sourceofamount() {
} }
/**
* LoanCalculation
*/
loanCalc()
{
let BtAmount = this.loanDetailsForm.value.balance_transfer_amount;
let loanAmount = this.loanDetailsForm.value.loan_amount;
let topupAmt ;
if(BtAmount !=null && BtAmount !='' && loanAmount !=null && loanAmount!='')
{
topupAmt = loanAmount - BtAmount;
//topUpAmtInWords
}
this.loanDetailsForm.controls['topup_amount'].setValue(topupAmt);
this.topUpAmtInWords = this._pd.convertNumberToWords(topupAmt);
}
} }