This commit is contained in:
dineshkumarkannan 2019-01-02 11:21:10 +05:30
commit 51d6012e37
19 changed files with 935 additions and 794 deletions

View File

@ -113,10 +113,10 @@
<div fxFlex="100">
<label>How long has business been operated from this premise?</label>
<mat-form-field>
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="business_years">
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="business_years" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field>
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="business_month" (change)="ConvertMonthintoYear($event.target.value)">
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="business_month" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear($event.target.value)">
</mat-form-field>
</div>
<div fxFlex="100">

View File

@ -507,4 +507,13 @@ export class AddressComponent implements OnInit {
this.addressForm.controls.business_month.setValue(Math.floor(converted_month));
}
/** On Key Press Event For Numbers */
keyPress(event: any) {
const pattern = /[0-9]/;
let inputChar = String.fromCharCode(event.charCode);
if (event.keyCode != 8 && !pattern.test(inputChar)) {
event.preventDefault();
}
}
}

View File

@ -6,7 +6,6 @@
</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>
@ -35,129 +34,118 @@
</div>
<!--Desction Dynamic details: START-->
<div formArrayName="business_details" class="example-full-width">
<!--Property-->
<div *ngIf="sup.get('business_assets_mode').value == 1 ">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div>
<mat-form-field style="width:100%">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<mat-select placeholder="Property Type" formControlName="property_type" >
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div>
<mat-form-field *ngIf="detail.get('property_type').value == 5">
<mat-form-field style="width:30%" *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>
</div>
<!--Four Wheeler-->
<div *ngIf="sup.get('business_assets_mode').value == 2">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div>
<mat-form-field class="ml-xs example-full-width">
<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">
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
<!--Two Wheeler-->
<div *ngIf="sup.get('business_assets_mode').value == 3">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div>
<mat-form-field class="ml-xs example-full-width">
<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">
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
<!--Consumer Durable-->
<div *ngIf="sup.get('business_assets_mode').value == 5">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div>
<mat-form-field class="ml-xs example-full-width">
<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>
</div>
<!--Insurance-->
<div *ngIf="sup.get('business_assets_mode').value == 6">
<div fxFill>
<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">
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<mat-form-field style="width:30%">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Frequency" formControlName="frequency_mode" >
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off">
<mat-form-field style="width:30%" *ngIf="detail.get('frequency_mode').value == 8 ">
<input matInput placeholder="Specify Frequency" formControlName="other_frequency_mode" autocomplete="off">
</mat-form-field>
</div>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<mat-form-field style="width:30%">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
<mat-form-field style="width:30%">
<input matInput placeholder="Members Covered" formControlName="members_coverd" autocomplete="off">
</mat-form-field>
</div>
</div>
</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">
<div fxFlex="33">
<mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Type" formControlName="investments_type" >
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxFlex="33" *ngIf="detail.get('investments_type').value == 6 ">
<mat-form-field>
<input matInput placeholder="Specify Other Type" formControlName="other_investments_type" autocomplete="off">
<mat-form-field style="width:30%" *ngIf="detail.get('investments_type').value == 6 ">
<input matInput placeholder="Specify Type" formControlName="other_investments_type" autocomplete="off">
</mat-form-field>
</div>
<div fxFlex="33" >
<mat-form-field class="ml-xs example-full-width">
<mat-form-field style="width:30%">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<mat-form-field style="width:30%">
<input matInput placeholder="Bank Name" formControlName="bank_name" autocomplete="off">
</mat-form-field>
</div>
@ -165,34 +153,29 @@
</div>
</div>
</div>
</div>
<!--other assets-->
<!-- <div *ngIf="sup.get('assets_mode').value == 8"> -->
<div *ngIf="sup.get('business_assets_mode').value == 8">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div>
<mat-form-field class="ml-xs example-full-width">
<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>
<mat-form-field class="ml-xs example-full-width">
</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 class="ml-xs example-full-width">
<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">{{d.viewValue}}</mat-option>
<!-- <mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="nan">NA</mat-option> -->
<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 class="ml-xs example-full-width" *ngIf="businessEmiAmtFlag">
<!-- <mat-form-field class="ml-xs example-full-width"> -->
<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>
@ -200,100 +183,62 @@
</div>
</div>
</div>
</div>
</div>
<!--Desction Dynamic details : END -->
<!-- {{sup.get('business_assets_mode').value}} -->
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 4">
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
</div>
</div>
<div *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 fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<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:30%">
<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:70%" *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:30%">
<input matInput placeholder="Name of the Business Owner" formControlName="business_name_of_the_owner" autocomplete="off">
</mat-form-field>
</div>
<!-- <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<mat-select placeholder="Name of the Owner"
formControlName="business_name_of_the_owner" >
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width" *ngIf="sup.get('business_name_of_the_owner').value == 0">
<input matInput placeholder="Specify Other Owner Name"
formControlName="other_owner" autocomplete="off">
</mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<mat-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}"
*ngFor="let relations of m_relation">
{{relations.name}}
</mat-option>
</mat-select>
</mat-form-field>
</div> -->
</div>
</div>
<div *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">
<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">
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width" style="width:95%">
<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>
<div *ngIf="sup.get('business_emi').value === 'yes'" fxFlex="33">
<mat-form-field class="ml-xs example-full-width" style="width:95%">
<input matInput placeholder="Amount of EMI on This Loan?" formControlName="business_emi_paid" (keypress)="keyPress($event)" autocomplete="off">
<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>
</div>
<div *ngIf="sup.get('business_emi').value === 'yes'" fxFlex="33">
<mat-form-field class="ml-xs example-full-width" style="width:95%">
<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)">
</mat-form-field>
</div>
<div *ngIf="sup.get('business_emi').value === 'yes'" fxFlex="33" style="width:95%">
<mat-form-field class="ml-xs example-full-width">
<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)">
</mat-form-field>
</div>
<div *ngIf="sup.get('business_emi').value === 'yes' && sup.get('business_original_loan_tenure').value != '' && sup.get('business_balance_tenure').value != '' " fxFlex="33" style="width:95%">
<mat-form-field class="ml-xs example-full-width">
<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">
</mat-form-field>
<!-- <p>Elapsed tenure is {{elapsed_tenure}}</p> -->
</div>
</div>
</div>
</span>
<div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none">
<div fxFlex="20">
<!-- <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>
</div>
</mat-card-content>
@ -340,53 +285,45 @@
<div formArrayName="details" class="example-full-width">
<!--Property-->
<div *ngIf="sup.get('assets_mode').value == 1 ">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div>
<mat-form-field style="width:100%">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<mat-select placeholder="Property Type" formControlName="property_type" >
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div>
<mat-form-field *ngIf="detail.get('property_type').value == 5">
<mat-form-field *ngIf="detail.get('property_type').value == 5" style="width:30%">
<input matInput placeholder="Other Property Type" formControlName="other_property_type" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
<!--Four Wheeler-->
<div *ngIf="sup.get('assets_mode').value == 2">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div>
<mat-form-field class="ml-xs example-full-width">
<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">
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
<!--Two Wheeler-->
<div *ngIf="sup.get('assets_mode').value == 3">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div>
<mat-form-field class="ml-xs example-full-width">
<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">
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
<!--jwell details -->
<!--<div *ngIf="sup.get('assets_mode').value == 4">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
@ -403,89 +340,73 @@
</div>-->
<!--Consumer Durable-->
<div *ngIf="sup.get('assets_mode').value == 5">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div>
<mat-form-field class="ml-xs example-full-width">
<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>
</div>
<!--Insurance-->
<div *ngIf="sup.get('assets_mode').value == 6">
<div fxFill>
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!---- <div fxFlex="33">
<mat-form-field>
<mat-select placeholder="Type" formControlName="insurance_type" >
<mat-option *ngFor="let ins_type of m_insuranceType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
</mat-select>
</mat-form-field>
</div>-->
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<mat-form-field style="width:30%">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Frequency" formControlName="frequency_mode" >
<mat-option *ngFor="let freqn of m_freqOfPurchase" [value]="freqn.frequency_id">{{ freqn.name }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:30%" *ngIf="detail.get('frequency_mode').value == 8 ">
<input matInput placeholder="Specify Frequency" formControlName="other_frequency_mode" autocomplete="off">
</mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
</div>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<mat-form-field style="width:30%">
<input matInput placeholder="Members Covered" formControlName="members_coverd" autocomplete="off">
</mat-form-field>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Investments-->
<div *ngIf="sup.get('assets_mode').value == 7">
<div>
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="33%" class="ml-xs example-full-width">
<mat-form-field>
<mat-form-field style="width:30%">
<mat-select placeholder="Type" formControlName="investments_type" >
<mat-option *ngFor="let ins_type of m_investmentType" [value]="ins_type.id">{{ ins_type.name }}</mat-option>
</mat-select>
</mat-form-field>
</div>
<!-- <div fxFlex="33" *ngIf="detail.get('investments_type').value == 6 "> -->
<div fxFlex="33%" >
<mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Specify Other Type" formControlName="other_investments_type" autocomplete="off">
<mat-form-field style="width:30%" *ngIf="detail.get('investments_type').value == 6">
<input matInput placeholder="Specify Type" formControlName="other_investments_type" autocomplete="off">
</mat-form-field>
</div>
<!-- </div> -->
<div fxFlex="33%" >
<mat-form-field class="ml-xs example-full-width">
<mat-form-field style="width:30%">
<input matInput placeholder="Amount of Investment" formControlName="amount_of_invest" (keypress)="keyPress($event)" autocomplete="off">
</mat-form-field>
</div>
</div>
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="33%">
<mat-form-field class="ml-xs example-full-width">
<mat-form-field style="width:30%">
<input matInput placeholder="Bank Name" formControlName="bank_name" autocomplete="off">
</mat-form-field>
</div>
@ -493,35 +414,35 @@
</div>
</div>
</div>
</div>
<!--other assets-->
<div *ngIf="sup.get('assets_mode').value == 8">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<div *ngFor="let detail of sup['controls'].details['controls']; let s = index">
<div [formGroupName]="s">
<div>
<mat-form-field class="ml-xs example-full-width">
<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>
<mat-form-field class="ml-xs example-full-width">
</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">
<mat-form-field style="width:30%">
<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}}</mat-option>
</mat-select>
</mat-form-field>
<div *ngIf="sup.get('name_of_the_owner').value == 0 && sup.get('name_of_the_owner').value != ''">
<mat-form-field class="ml-xs example-full-width" >
<input matInput placeholder="Specify Other Owner Name"
<mat-form-field *ngIf="sup.get('name_of_the_owner').value == 0 && sup.get('name_of_the_owner').value != ''" style="width:30%">
<input matInput placeholder="Specify Owner Name"
formControlName="other_owner" autocomplete="off">
</mat-form-field>
</div>
<div>
<mat-form-field class="ml-xs example-full-width">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:30%">
<mat-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}"
*ngFor="let relations of m_relation">
@ -529,18 +450,18 @@
</mat-option>
</mat-select>
</mat-form-field>
</div><!---- -->
<!-- <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 class="ml-xs example-full-width">
<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-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{d.viewValue}}</mat-option>
<mat-option value="{{data.value}}" *ngFor="let data of m_any_asset_loan_type">{{data.viewValue}}</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 class="ml-xs example-full-width" *ngIf="otherEmiamtFlag">
<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">
<!-- <span matSuffix>.00</span> -->
@ -550,41 +471,25 @@
</div>
</div>
</div>
</div>
<!--Desction Dynamic details : END -->
<!--<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">-->
<div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 4">
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Approximate Market Value" formControlName="approximate_market_value" (keypress)="keyPress($event)" autocomplete="off">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 4" style="width:30%">
<input matInput placeholder="Approximate Market Value" formControlName="approximate_market_value" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,2)">
<mat-hint align="start" style="font-size:70%" *ngIf="sup.get('approximate_market_value').value != ''">{{"&#8377;"}} {{OtherAppxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
</div>
</div>
<div *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">
<!-- <div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<input matInput placeholder="Name of the Owner" formControlName="name_of_the_owner" autocomplete="off">
</mat-form-field>
</div> -->
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<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:30%">
<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}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxFlex="33" *ngIf="sup.get('name_of_the_owner').value == 0 && sup.get('name_of_the_owner').value != ''">
<mat-form-field class="ml-xs example-full-width" >
<input matInput placeholder="Specify Other Owner Name"
<mat-form-field *ngIf="sup.get('name_of_the_owner').value == 0 && sup.get('name_of_the_owner').value != ''" style="width:30%">
<input matInput placeholder="Specify Owner Name"
formControlName="other_owner" autocomplete="off">
</mat-form-field>
</div>
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width">
<!-- 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-select placeholder="Relation" formControlName="relation" >
<mat-option value="{{relations.relationship_id}}"
*ngFor="let relations of m_relation">
@ -593,50 +498,33 @@
</mat-select>
</mat-form-field>
</div>
</div>
<!--</div>-->
<!---- <div *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 5">
<label>Year and Month of Purchase?</label>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field>
<input matInput type="number" placeholder="Year" formControlName="purchase_year">
</mat-form-field>
<mat-form-field>
<input matInput type="number" placeholder="Month" formControlName="purchase_month">
</mat-form-field>
</div>
</div>-->
<div *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">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<div fxFlex="33">
<mat-form-field class="ml-xs example-full-width" style="width:95%">
<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-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</div>
<div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33">
<mat-form-field class="ml-xs example-full-width" style="width:95%">
<input matInput placeholder="Amount of EMI on This Loan?" formControlName="emi_paid" (keypress)="keyPress($event)" autocomplete="off">
<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>
</div>
<div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33">
<mat-form-field class="ml-xs example-full-width" style="width:95%">
<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)" autocomplete="off">
</mat-form-field>
</div>
<div *ngIf="sup.get('emi').value === 'yes'" fxFlex="33" style="width:95%">
<mat-form-field class="ml-xs example-full-width">
<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)" autocomplete="off">
</mat-form-field>
</div>
<div *ngIf="sup.get('emi').value === 'yes' && sup.get('original_loan_tenure').value != '' && sup.get('balance_tenure').value != '' " fxFlex="33" style="width:95%">
<mat-form-field class="ml-xs example-full-width">
<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">
</mat-form-field>
<!-- <p>Elapsed tenure is {{elapsed_tenure}}</p> -->
</div>
</div>
</div>
<div fxLayout="row" fxLayoutGap="12px" fxLayoutAlign="start none">
@ -646,7 +534,7 @@
</span>
</div>
</div>
</div>
</mat-card-content>
</mat-card>
</div>

View File

@ -43,6 +43,10 @@ export class AssetsInfoComponent implements OnInit {
public m_any_asset_loan_type = [{'value': "yes",'viewValue': "Yes"},
{'value': "no",'viewValue': "No"},
{'value': "nan",'viewValue': "NA"}]
appxMarketAmtInwords : any = [];
OtherAppxMarketAmtInwords : any = [];
emiAmtInwords : any = [];
OtherEmiAmtInwords : any = [];
// public m_assets_type = [
// {
// 'id': "1",
@ -507,6 +511,7 @@ public m_investmentType = [];
//insurance_type: [''],
premium_paid: [''],
frequency_mode: [''],
other_frequency_mode:[''],
sum_assured: [''],
members_coverd: ['']
});
@ -582,6 +587,7 @@ public m_investmentType = [];
//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]
});
@ -958,14 +964,23 @@ public m_investmentType = [];
}
// {
// 'main_raw_materials': 'sdkjfal',
// 'supplier_details' ; [
// {
// 'supplier_name':'ldskjfalks',
// 'payment_mode': '1',
// 'payment_mode_value':''
// }
// ]
// }
/** Amount InWords */
inWords(e,i,flag){
switch(flag){
case 1 :
this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 2 :
this.OtherAppxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 3 :
this.emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 4 :
this.OtherEmiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
}

View File

@ -95,16 +95,13 @@
</mat-panel-title>
</mat-expansion-panel-header>
<mat-form-field>
<mat-select placeholder="Applicant Name"
formControlName="applicant_name" required>
<mat-select placeholder="Applicant Name" formControlName="applicant_name" required (selectionChange)="selectedBorrower($event.value,i)">
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="itemrow.get('applicant_name').value == 0">
<input matInput placeholder="Specify Other Applicant"
formControlName="other_applicant" autocomplete="off">
<!-- <mat-form-field *ngIf="itemrow.get('applicant_name').value == 0"> -->
<mat-form-field *ngIf="this.OtherFlag[i]">
<input matInput placeholder="Specify Applicant Name" formControlName="other_applicant" autocomplete="off">
</mat-form-field>
<!-- <mat-form-field>
@ -121,13 +118,13 @@
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="itemrow.get('bank_name').value == 3">
<input matInput placeholder="Specify Other Bank Name"
<input matInput placeholder="Specify Bank Name"
formControlName="other_bank" autocomplete="off">
</mat-form-field>
<mat-form-field>
<mat-select (selectionChange)="selectedAccTypeChanges($event)" placeholder="Account Type" formControlName="account_type" required >
<mat-select (selectionChange)="selectedAccTypeChanges($event.value,i)" placeholder="Account Type" formControlName="account_type" required >
<mat-option *ngFor="let prop of m_accountType" [value]="prop.id">{{ prop.name }}</mat-option>
</mat-select>
<!--<mat-select placeholder="Account Type"
@ -140,7 +137,16 @@
</mat-select>-->
</mat-form-field>
<mat-form-field *ngIf="salaryField">
<mat-form-field *ngIf="pd_cus_segment!='SAL'">
<mat-select placeholder="Is this the main business account"
formControlName="is_main" required>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
<div fxLayout="row" fxLayoutAlign="start none">
<mat-form-field style="width: 35%;" *ngIf="salaryField">
<mat-select placeholder="Salary Credited in this account"
formControlName="salary" required>
<mat-option value="Yes">Yes</mat-option>
@ -149,17 +155,12 @@
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="itemrow.get('account_type').value != 2">
<input matInput placeholder="Limit in case of OD / CC account"
formControlName="limit" (keypress)="keyPress($event)" required autocomplete="off">
</mat-form-field>
<mat-form-field *ngIf="pd_cus_segment!='SAL'">
<mat-select placeholder="Is this the main business account"
formControlName="is_main" required>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
<mat-form-field style="width: 35%;" *ngIf="this.limitCaseFlag[i]"> <!-- *ngIf="itemrow.get('account_type').value != 2"> -->
<input matInput autocomplete="off" placeholder="Limit in case of OD / CC account"
formControlName="limit" (keypress)="keyPress($event)" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:70%" *ngIf="itemrow.get('limit').value != ''">{{"&#8377;"}} {{amtInwords[i]}} Only</mat-hint>
</mat-form-field>
</div>
<!-- <mat-form-field>
<input matInput placeholder="Approximate Vintage"
formControlName="vintage" required>
@ -169,10 +170,10 @@
<br>
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field>
<input matInput type="number" placeholder="Year(s)" formControlName="vintage_year" required min='0' (keypress)="keyPress($event)" autocomplete="off">
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="vintage_year" required (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field>
<input matInput type="number" placeholder="Month(s)" formControlName="vintage_month" required min='0' max='11'(keypress)="keyPress($event)" autocomplete="off">
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="vintage_month" required (keypress)="keyPress($event)" (change)="ConvertMonthintoYear(itemrow,$event.target.value)">
</mat-form-field>
</div>
</div>

View File

@ -38,6 +38,10 @@ export class BankingDetailsComponent implements OnInit {
m_accountType= [];
m_btLenderList = [];
salaryField : boolean;
OtherFlag : any = [];
limitCaseFlag : any = [];
amtInwords : any = [];
emiAmtInwords : any = [];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
@ -99,7 +103,12 @@ export class BankingDetailsComponent implements OnInit {
if (result.length == 0) {
control.push(this.createBankarray());
} else {
result.forEach(datas => {
result.forEach((datas,index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(datas.limit);
this.selectedBorrower(datas.applicant_name,index);
this.selectedAccTypeChanges(datas.account_type,index)
// this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
control.push(this.createBankarray());
});
this.bankingForm.controls.itemRows.setValue(result);
@ -210,31 +219,58 @@ export class BankingDetailsComponent implements OnInit {
});
}
selectedAccTypeChanges(event: any){
// console.log('First Time',event);
// console.log('First Time Value',event.value);
if(event.value == 2) {
selectedBorrower(e,i){
if(e == 0){
this.OtherFlag[i] = true;
}
else{
this.OtherFlag[i] = false;
}
}
selectedAccTypeChanges(event: any,i){
if(event == 2 || event == 1) {
this.limitCaseFlag[i] = false;
const control = <FormArray>this.bankingForm.controls['itemRows'];
// console.log('Inside If Condition');
// console.log(control);
// console.log(control.controls);
control.controls[0].get('limit').clearValidators();
control.controls[0].get('limit').updateValueAndValidity();
//this.loanDetailsForm.controls['is_topup'].setValidators([Validators.required]);
// this.bankingForm.controls['itemRows'].
// this.bankingForm.controls.get('limit').clearValidators();
// this.bankingForm.controls.itemRows['controls'].get('limit').updateValueAndValidity();
// const control = <FormArray>this.bankingForm.controls['itemRows'];
// console.log(control.controls['limit'].value);
}
else{
//alert('sd');
this.limitCaseFlag[i] = true;
}
}
/** To Convert Month into Year */
ConvertMonthintoYear(itemrow,e){
//console.log(itemrow);
let year = itemrow.controls.vintage_year.value;
let converted_month : number = e%12;
let converted_year : number = e/12;
itemrow.controls.vintage_year.setValue(+year + +Math.floor(converted_year));
itemrow.controls.vintage_month.setValue(Math.floor(converted_month));
}
/** Amount InWords */
inWords(e,i,flag){
switch(flag){
case 1 :
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2 :
this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
/** On Key Press Event For Numbers */
keyPress(event: any) {

View File

@ -30,7 +30,7 @@
<mat-card *ngIf="currentLoanForm.controls.existing_loan.value == 'Yes'">
<mat-card-header>
<p>Loan Details<p>
<mat-card-title><p>Loan Details</p></mat-card-title>
</mat-card-header>
<div formArrayName="loan_details">
<div *ngFor="let details of currentLoanForm.get('loan_details').controls; let i=index"
@ -38,7 +38,8 @@
<!-- {{frequencyData | json}} -->
<mat-card-content class="matcard">
<mat-form-field>
<input matInput autocomplete="off" placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" >
<input matInput autocomplete="off" placeholder="Loan Amount" formControlName="loan_amount" (keypress)="keyPress($event)" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('loan_amount').value != ''">{{"&#8377;"}} {{amtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field>
<mat-select (selectionChange)="selectedfrequency($event.value,i)" placeholder="Frequency"
@ -46,8 +47,12 @@
<mat-option *ngFor="let freq of frequencyData" value="{{freq.frequency_id}}">{{freq.name}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="details.get('frequency').value != ''" >
<input matInput autocomplete="off" [placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' " formControlName="emi" (keypress)="keyPress($event)" >
<mat-form-field *ngIf="details.get('frequency').value == 8">
<input matInput autocomplete="off" placeholder="Specify Frequency" formControlName="other_frequency">
</mat-form-field>
<mat-form-field *ngIf="details.get('frequency').value != ''" style="width:35%">
<input matInput autocomplete="off" [placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' " formControlName="emi" (keypress)="keyPress($event)" (keyup)="inWords($event,i,2)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('emi').value != ''">{{"&#8377;"}} {{emiAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Loan Type" formControlName="loan_type" >
@ -56,16 +61,18 @@
<!-- <input matInput autocomplete="off" placeholder="Loan Type" formControlName="loan_type" > -->
</mat-form-field>
<mat-form-field *ngIf="details.get('loan_type').value == 9 ">
<input matInput autocomplete="off" placeholder="Specify Others Loan Type" formControlName="others_loan_type">
<input matInput autocomplete="off" placeholder="Specify Loan Type" formControlName="others_loan_type">
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Loan Taken By" formControlName="loan_taken_by">
<mat-select placeholder="Loan Taken By" formControlName="loan_taken_by" (selectionChange)="selectedBorrower($event.value,i)">
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
<!-- <mat-option value= 0 >Others</mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="details.get('loan_taken_by').value == 0">
<input matInput autocomplete="off" placeholder="Specify Others Loan Taken" formControlName="others_loan_taken">
<!-- {{details.get('loan_taken_by').value}} -->
<!-- <mat-form-field *ngIf="details.get('loan_taken_by').value == 0"> -->
<mat-form-field *ngIf="this.OtherFlag[i]">
<input matInput autocomplete="off" placeholder="Specify Borrower" formControlName="others_loan_taken">
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Lender" formControlName="lender" >
@ -73,17 +80,19 @@
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="details.get('lender').value == 3">
<input matInput autocomplete="off" placeholder="Specify Others Lender" formControlName="others_lender" >
<input matInput autocomplete="off" placeholder="Specify Lender" formControlName="others_lender" >
</mat-form-field>
<!-- <mat-form-field>
<input matInput autocomplete="off" placeholder="Lender" formControlName="lender" >
</mat-form-field> -->
<mat-form-field>
<div style="width:100%">
<mat-form-field style="width:35%">
<input matInput autocomplete="off" placeholder="Original Tenure in Months" formControlName="original_tenure" >
</mat-form-field>
<mat-form-field>
<mat-form-field style="width:35%">
<input matInput autocomplete="off" placeholder="Current Balance Tenure in Months" formControlName="current_balance_tenure" >
</mat-form-field>
</div>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Add More Loan Details" matTooltipPosition="above" color="primary" (click)="addLoanDetails()"
*ngIf="i==0">
<mat-icon>add</mat-icon>

View File

@ -44,7 +44,9 @@ export class CurrentLoanComponent implements OnInit {
applicants: any;
placeholderName : any = [];
IDXval : any;
OtherFlag : boolean = false;
OtherFlag : any = [];
amtInwords : any = [];
emiAmtInwords : any = [];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router,
@ -55,6 +57,7 @@ export class CurrentLoanComponent implements OnInit {
this.notifier = notifier;
this.applicants = this.pd_all_details.pdapplicants_detials;
this.applicants.push({'pd_co_applicant_id':'0','applicant_name':'Others'});
//this.OtherFlag[0] = false;
}
public viewerOptions: any = {
navbar: false,
@ -98,6 +101,8 @@ export class CurrentLoanComponent implements OnInit {
});
if (result.length > 0) {
result.forEach((val,index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(val.loan_amount);
this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
control.push(this.createLoanDetail());
this.selectedfrequency(val.frequency,index);
//this.selectedLoanTakenBy(val.loan_taken_by,index);
@ -133,6 +138,14 @@ export class CurrentLoanComponent implements OnInit {
arr.removeAt(0);
}
}
selectedBorrower(e,i){
if(e == 0){
this.OtherFlag[i] = true;
}
else{
this.OtherFlag[i] = false;
}
}
selectedfrequency(e,i){
@ -152,6 +165,7 @@ export class CurrentLoanComponent implements OnInit {
return this.fb.group({
loan_amount: [''],
frequency:[''],
other_frequency:[''],
emi: [''],
loan_type: [''],
others_loan_type: [''],
@ -227,4 +241,18 @@ export class CurrentLoanComponent implements OnInit {
event.preventDefault();
}
}
/** Amount InWords */
inWords(e,i,flag){
switch(flag){
case 1 :
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2 :
this.emiAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
}

View File

@ -11,9 +11,21 @@
<mat-dialog-content formArrayName="applicant_list">
<mat-card *ngFor="let applicant of _OtherForm.controls.applicant_list['controls']; let r = index;" [formGroupName]="r">
<mat-card-content>
<mat-form-field style="width: 100%">
<mat-form-field style="width: 75%">
<input matInput placeholder="Name" formControlName="applicant_name" type="text">
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeApplicant(r)" *ngIf="r>0"
matTooltip="Remove Individuals" matTooltipPosition="right">
<mat-icon>delete</mat-icon>
</button>
<div fxLayout="row wrap" class="example-section">
<div fxFlex="100%">
<mat-checkbox class="example-margin" color="primary" formControlName="is_person_met">Is Person Met</mat-checkbox>
</div>
<div fxFlex="100%">
<mat-checkbox class="example-margin" color="primary" formControlName="is_applicant">Is Applicant</mat-checkbox>
</div>
</div>
</mat-card-content>
</mat-card>

View File

@ -5,3 +5,10 @@
mat-form-field {
margin: 0 2%;
}
.example-section {
height: 120px;
}
.example-margin {
margin: 0 10px;
}

View File

@ -8,9 +8,9 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angul
styleUrls: ['./other-applicant-details.component.scss']
})
export class OtherApplicantDetailsComponent implements OnInit {
pageTitle: string ="Add Other Applicant Details";
pageTitle: string ="Add Individual Details";
public _OtherForm: FormGroup;
applicantInfo:any={'pd_co_applicant_id':"0",'applicant_name':'','company_name':''};
applicantInfo:any={'pd_co_applicant_id':"0",'applicant_name':'','is_applicant':false,'is_person_met':false};
constructor(private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef<OtherApplicantDetailsComponent>) { }
@ -30,7 +30,8 @@ createApplicant(elementValue:any){
return this._fb.group({
pd_co_applicant_id: [elementValue.pd_co_applicant_id],
applicant_name: [elementValue.applicant_name, Validators.required],
//company_name:[elementValue.company_name]
is_applicant:[false],
is_person_met:[false],
});
}

View File

@ -9,47 +9,96 @@
</div>
</h2>
<mat-dialog-content>
<!-- individuals details start-->
<mat-card>
<mat-card-header>
<mat-card-title>Name of Person Met</mat-card-title>
<mat-card-title>Individuals</mat-card-title>
</mat-card-header>
<mat-card-content>
<div fxLayout="row wrap" class="example-section" formArrayName="applicant_list">
<div fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="25" fxFlex.lg="25" fxFlex.xl="25" *ngFor="let applicant of _generalForm.controls.applicant_list['controls']; let c = index;" [formGroupName]="c">
<mat-checkbox class="example-margin" color="primary" formControlName="exist_status" (change)="checkboxChange($event, c, applicant.controls)">{{applicant.controls.applicant_name.value}}</mat-checkbox>
<mat-table [dataSource]="individualsSource" *ngIf="_generalForm.controls.individuals['controls'].length>0" formArrayName="individuals">
<ng-container matColumnDef="applicant_name">
<mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
{{details.value.applicant_name | titlecase}}
</mat-cell>
</ng-container>
<ng-container matColumnDef="is_person_met">
<mat-header-cell *matHeaderCellDef> Is Person Met </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
<mat-checkbox class="table-checkbox" color="primary" formControlName="is_person_met"></mat-checkbox>
</mat-cell>
</ng-container>
<ng-container matColumnDef="is_applicant">
<mat-header-cell *matHeaderCellDef> Is Applicant </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
<mat-checkbox class="table-checkbox" color="primary" formControlName="is_applicant"></mat-checkbox>
<!-- <button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeIndividuals(i)"
matTooltip="Remove Individuals" matTooltipPosition="below">
<mat-icon>delete</mat-icon>
</button> -->
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table>
</mat-card-content>
<mat-card-actions align="end">
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addMoreIndividuals()"
matTooltip="Add More Individual" matTooltipPosition="left" color="primary">
<mat-icon>add</mat-icon>
</button>
</mat-card-actions>
</mat-card>
<!-- end -->
<!-- companies start -->
<mat-card>
<mat-card-header>
<mat-card-title>Companies</mat-card-title>
</mat-card-header>
<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;" [formGroupName]="c">
<mat-form-field style="width: 60%">
<input matInput placeholder="Company/Firm" formControlName="company_name" type="text">
</mat-form-field>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More Company/Firm" matTooltipPosition="above" color="primary" (click)="addMoreCompanies()" *ngIf="c==0"><mat-icon>add</mat-icon></button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeCompanies(c)" *ngIf="c>0"
matTooltip="Remove Company/Firm" matTooltipPosition="above">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
</mat-card-content>
<mat-card-actions align="end">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add Other Applicant" matTooltipPosition="above" color="primary" (click)="addOtherApplicant()"><mat-icon>add</mat-icon></button>
</mat-card-actions>
</mat-card>
<mat-card>
<mat-card-header>
<mat-card-title>Applicant Details</mat-card-title>
</mat-card-header>
<mat-card-content formArrayName="applicant_relation">
<div fxLayout="row wrap">
<!-- companies end -->
<div fxLayout="row wrap" formArrayName="applicant_relation">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" *ngFor="let relation of _generalForm.controls.applicant_relation['controls']; let r = index;" [formGroupName]="r">
<mat-card >
<mat-card-header>
<mat-card-title>{{relation.controls.applicant_name.value | titlecase}}</mat-card-title>
<mat-card-title class="p-text">{{relation.controls.applicant_name.value | titlecase}}</mat-card-title>
</mat-card-header>
<mat-card-content>
<p>Personal Relationship</p>
<div formArrayName="multiple_relation">
<div *ngFor="let mulRel of relation.get('multiple_relation').controls; let m = index" [formGroupName]="m">
<div fxLayout="row nowrap">
<mat-form-field style="width: 45%">
<mat-form-field style="width: 40%">
<mat-select placeholder="Relation to" formControlName="applicant_relation_to">
<mat-option>Select</mat-option>
<mat-option *ngFor="let rel of fetch_related_details" [value]="rel">
<mat-option *ngFor="let rel of individualsList" [value]="rel.individuals_order_id">
<!-- [disabled]="relation.controls.applicant_name.value == rel" -->
{{rel | titlecase}}
{{rel.applicant_name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 40%">
<mat-form-field style="width: 30%">
<mat-select placeholder="Relation" formControlName="relationship">
<mat-option>Select</mat-option>
<mat-option *ngFor="let relShip of relationShipList" [value]="relShip.relationship_id">
@ -57,16 +106,25 @@
</mat-option>
</mat-select>
</mat-form-field>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More Relation" matTooltipPosition="above" color="primary" (click)="addMoreRelation(r,m)" *ngIf="m==0"><mat-icon>add</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More Personal Relationship" matTooltipPosition="above" color="primary" (click)="addMoreRelation(r,m)" *ngIf="m==0"><mat-icon>add</mat-icon></button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeRelation(r,m)" *ngIf="m>0"
matTooltip="Remove Relation" matTooltipPosition="above">
matTooltip="Remove Personal Relationship" matTooltipPosition="above">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
</div>
<p>Company Relationship</p>
<div formArrayName="multiple_company_relation">
<div fxLayout="row nowrap" *ngFor="let comRel of mulRel.get('multiple_company_relation').controls; let c = index" [formGroupName]="c">
<div fxLayout="row nowrap" *ngFor="let comRel of relation.get('multiple_company_relation').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width: 40%">
<input matInput placeholder="Company / Firm" formControlName="company_name" type="text">
<mat-select placeholder="Company / Firm" formControlName="company_name">
<mat-option>Select</mat-option>
<mat-option *ngFor="let comp of companyList" [value]="comp.company_order_id">
{{comp.company_name | titlecase}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%">
<mat-select placeholder="Relation" formControlName="company_relationship">
@ -76,31 +134,18 @@
</mat-option>
</mat-select>
</mat-form-field>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More Company" matTooltipPosition="above" color="primary" (click)="addMoreCompanyRelation(r,m,c)" *ngIf="c==0"><mat-icon>add</mat-icon></button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeCompanyRelation(r,m,c)" *ngIf="c>0"
matTooltip="Remove Company" matTooltipPosition="above">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More Company Relationship" matTooltipPosition="above" color="primary" (click)="addMoreCompanyRelation(r,c)" *ngIf="c==0"><mat-icon>add</mat-icon></button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeCompanyRelation(r,c)" *ngIf="c>0"
matTooltip="Remove Company Relationship" matTooltipPosition="above">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
</div>
</div>
</mat-card-content>
<mat-card-actions align="end" *ngIf="relation.controls.pd_co_applicant_id.value==0">
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeOthers(r,relation.value)"
matTooltip="Delete" matTooltipPosition="above">
<mat-icon>delete</mat-icon>
</button>
</mat-card-actions>
</mat-card>
</div>
</div>
</mat-card-content>
</mat-card>
</mat-dialog-content>
<mat-dialog-actions>
<div fxFlex="60" class="pb-0 text-sm-left" align="left">

View File

@ -12,3 +12,15 @@
mat-form-field {
margin: 0 2%;
}
mat-header-cell mat-cell {
display:flex;
justify-content:flex-end;
}
.table-checkbox {
margin-left: 15% !important;
}
.p-text {
color:#e00201 !important;
font-weight: bold;
}

View File

@ -1,6 +1,6 @@
import { Component, OnInit, Input, Output, Inject } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl, FormArray } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , MatTableDataSource} from '@angular/material';
import { NotifierService } from 'angular-notifier';
import { PdTrigerService } from './../../../../../pd-service/pd-triger.service';
import {OtherApplicantDetailsComponent} from './../dialogue/other-applicant-details/other-applicant-details.component';
@ -15,11 +15,15 @@ export class GeneralInfoComponent implements OnInit {
form_id:number;
private notifier: NotifierService;
public _generalForm: FormGroup;
displayedColumns = ['applicant_name','is_person_met','is_applicant'];
public individualsSource= new MatTableDataSource();
public pd_applicants_details: any;
relationShipList:any=[];
companyRelationShipList:any=[];
errorMessage:any;
fetch_related_details:any=[];
individualsList: any=[];
companyList: any=[];
constructor(notifier: NotifierService,private _fb: FormBuilder,private _pd: PdTrigerService , private dialog: MatDialog, @Inject(MAT_DIALOG_DATA) public pd_all_details: any,) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
@ -34,6 +38,17 @@ export class GeneralInfoComponent implements OnInit {
this.initFormDetails();
this.getMasterDetails('RELATIONSHIPS',1);
this.getMasterDetails('COMPANYRELATIONSHIPS',2);
// update data source table when change the individuals details
this._generalForm.controls['individuals'].valueChanges.subscribe(val=>{
let control = <FormArray>this._generalForm.controls['individuals'];
this.individualsSource.data =control.controls;
this.individualsList = control.value.filter(element =>element.is_applicant===true);
});
// update company details
this._generalForm.controls['companies'].valueChanges.subscribe(val=>{
let control = <FormArray>this._generalForm.controls['companies'];
this.companyList = control.value.filter(element =>element.company_name);
});
}
// init form
@ -41,8 +56,9 @@ export class GeneralInfoComponent implements OnInit {
this._generalForm = this._fb.group({
pdid:this.pdid,
formid:this.form_id,
applicant_list: this._fb.array([]),
applicant_relation: this._fb.array([]),
individuals: this._fb.array([]),
companies: this._fb.array([]),
general_remark:''
});
this.loadFormData();
@ -68,96 +84,122 @@ export class GeneralInfoComponent implements OnInit {
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = '18';
let applicantControl = <FormArray>this._generalForm.controls['applicant_list'];
let individualsControl = <FormArray>this._generalForm.controls['individuals'];
let companyControl = this._generalForm.get('companies') as FormArray;
let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
applicantControl.controls = [];
individualsControl.controls = [];
relationControl.controls = [];
let exist_data:any;
let exist_applicant_relation:any;
companyControl.controls = [];
let exist_individuals:any;
let exist_companies:any;
let exist_relation:any;
this._pd.retriveForm(params).subscribe(data => {
if(data.dataStatus) {
this._generalForm.controls['general_remark'].setValue(data.records.general_remark ? data.records.general_remark : '');
exist_data=Object.keys(data.records.selected_applicant).map(function(key) {
return data.records.selected_applicant[key].pd_co_applicant_id;
// create individuals
exist_individuals=Object.keys(data.records.individuals).map(function(key) {
return data.records.individuals[key];
});
exist_applicant_relation = Object.keys(data.records.applicant_relation).map(function(key) {
if(exist_individuals.length>0){
exist_individuals.forEach(element => {
individualsControl.push(this.createIndividulas(element))
});
}
// create companies
exist_companies = Object.keys(data.records.companies).map(function(key) {
return data.records.companies[key];
});
if(exist_companies.length>0){
exist_companies.forEach(element => {
companyControl.push(this.createCompanies(element))
});
}
// create relations
exist_relation = Object.keys(data.records.applicant_relation).map(function(key) {
return data.records.applicant_relation[key];
});
if(exist_relation.length>0){
exist_relation.forEach((element,index) => {
relationControl.push(this.createApplicantRelation(element));
let innerrelControl:any = relationControl.controls[index].get('multiple_relation') as FormArray;
element.multiple_relation.forEach((innereElement) => {
innerrelControl.push(this.createMultipleRelation(innereElement));
});
let innercomrelControl:any = relationControl.controls[index].get('multiple_company_relation') as FormArray;
element.multiple_company_relation.forEach((innerecomElement) => {
innercomrelControl.push(this.createMultipleCompanyRelation(innerecomElement));
});
});
}
}
else {
exist_data=[];
exist_applicant_relation=[];
}
//find exist and non-exist applicant details
let actual_applicant = this.pd_applicants_details.map(item => item.pd_co_applicant_id);
let checkApplicantExist =actual_applicant.map((id, index) => {
if (exist_data.indexOf(id) < 0) {
this.pd_applicants_details[index].exist_status=0;
return this.pd_applicants_details[index];
}
else{
this.pd_applicants_details[index].exist_status=1;
this.pd_applicants_details[index].applicant_relation_to='';
this.pd_applicants_details[index].relation='';
return this.pd_applicants_details[index];
}
}).filter(item => item != undefined);
this.pd_applicants_details.forEach((element,key) => {
element.is_applicant=true;
element.is_person_met=false;
element.individuals_order_id = key+1
individualsControl.push(this.createIndividulas(element));
let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name, 'individula_order_id':relationControl.controls.length+1};
relationControl.push(this.createApplicantRelation(applicant_details));
let mulRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
mulRelationControl.push(this.createMultipleRelation(applicant_details))
let mulCmyRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details))
if(checkApplicantExist.length > 0)
{
checkApplicantExist.forEach(val => {
applicantControl.push(this.createApplicant(val));
// 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}
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:''}
companyControl.push(this.createCompanies(setCompanyValues))
}
if(exist_applicant_relation.length > 0){
exist_applicant_relation.forEach((val,key) => {
let control: any = this._generalForm.get('applicant_relation') as FormArray;
control.push(this.createApplicantRelation(val));
control = control.controls[key].get('multiple_relation') as FormArray;
val.multiple_relation.forEach((firstInnerelement,firstInnerKey) => {
control.push(this.createMultipleRelation(firstInnerelement));
let innerControl = this._generalForm.get('applicant_relation') as FormArray;
innerControl = innerControl.controls[key].get('multiple_relation') as FormArray;
innerControl = innerControl.controls[firstInnerKey].get('multiple_company_relation') as FormArray;
firstInnerelement.multiple_company_relation.forEach((secondInnerValue,secondInnerKey) => {
innerControl.push(this.createMultipleCompanyRelation(secondInnerValue))
});
});
//push related to details
this.fetch_related_details.push(val.applicant_name);
});
}
}, error => this.errorMessage = <any> error);
}
// create individuals
createIndividulas(elementValue:any) {
return this._fb.group({
pd_co_applicant_id: [elementValue.pd_co_applicant_id],
applicant_name: [elementValue.applicant_name],
is_applicant:[elementValue.is_applicant],
is_person_met:[elementValue.is_person_met],
individuals_order_id: [elementValue.individuals_order_id],
});
}
// create companies
createCompanies(elementValue:any) {
return this._fb.group({
company_order_id: [elementValue.company_order_id],
company_name: [elementValue.company_name,Validators.required],
});
}
// check and uncheck function
checkboxChange(event, index, item) {
if(item.exist_status.value){
let relationControl: any = <FormArray>this._generalForm.controls['applicant_relation'];
let applicant_details: any= {'pd_co_applicant_id':item.pd_co_applicant_id.value,'applicant_name':item.applicant_name.value,'applicant_relation_to':'','relation':'','company_name':item.company_name.value,'company_relation':''};
relationControl.push(this.createApplicantRelation(applicant_details));
relationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
relationControl.push(this.createMultipleRelation(applicant_details))
relationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
relationControl.push(this.createMultipleCompanyRelation(applicant_details))
// to push selected persons names
this.fetch_related_details.push(item.applicant_name.value);
// 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:''}
control.push(this.createCompanies(setValues))
}
}
else {
if(item.pd_co_applicant_id.value!=0){
let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
let pos_id = relationControl.value.map(e=> e.pd_co_applicant_id).indexOf(item.pd_co_applicant_id.value);
relationControl.removeAt(pos_id);
// remove related to details
let pos_name=this.fetch_related_details.indexOf(item.applicant_name.value);
this.fetch_related_details.splice(pos_name, 1);
}
}
// remove companies
removeCompanies(indexValues) {
let control: any = this._generalForm.get('companies') as FormArray;
control.removeAt(indexValues);
}
// create applicant form array
@ -176,14 +218,15 @@ export class GeneralInfoComponent implements OnInit {
pd_co_applicant_id: [elementValue.pd_co_applicant_id],
applicant_name: [elementValue.applicant_name],
multiple_relation: this._fb.array([]),
multiple_company_relation : this._fb.array([]),
individuals_order_id:[elementValue.individuals_order_id]
});
}
// create multiple relation details
createMultipleRelation(elementValue: any) {
return this._fb.group({
applicant_relation_to: [elementValue.applicant_relation_to, Validators.required],
applicant_relation_to: [elementValue.applicant_relation_to],
relationship: [elementValue.relationship],
multiple_company_relation : this._fb.array([]),
});
}
@ -193,9 +236,6 @@ export class GeneralInfoComponent implements OnInit {
control = control.controls[rindex].get('multiple_relation') as FormArray;
let setValues: any = {applicant_relation_to :'',relationship:''}
control.push(this.createMultipleRelation(setValues))
let setCompanyValue = {company_name :'',company_relationship:''};
control = <FormArray> control.controls[control.controls.length-1].get('multiple_company_relation');
control.push(this.createMultipleCompanyRelation(setCompanyValue))
}
// remove relation
@ -208,29 +248,27 @@ export class GeneralInfoComponent implements OnInit {
// create multiple company relation
createMultipleCompanyRelation(elementValue: any) {
return this._fb.group({
company_name: [elementValue.company_name,elementValue.company_name ? Validators.required : Validators.nullValidator],
company_name: [elementValue.company_name,Validators.required],
company_relationship: [elementValue.company_relationship],
});
}
// add more company relation
addMoreCompanyRelation(rindex,mindex,cindex) {
addMoreCompanyRelation(rindex,cindex) {
let control: any = this._generalForm.get('applicant_relation') as FormArray;
control = control.controls[rindex].get('multiple_relation') as FormArray;
control = control.controls[mindex].get('multiple_company_relation') as FormArray;
control = control.controls[rindex].get('multiple_company_relation') as FormArray;
let setValues: any = {company_name :'',company_relationship:''}
control.push(this.createMultipleCompanyRelation(setValues))
}
// remove company relation
removeCompanyRelation(rindex,mindex,cindex) {
removeCompanyRelation(rindex,cindex) {
let control: any = this._generalForm.get('applicant_relation') as FormArray;
control = control.controls[rindex].get('multiple_relation') as FormArray;
control = control.controls[mindex].get('multiple_company_relation') as FormArray;
control = control.controls[rindex].get('multiple_company_relation') as FormArray;
control.removeAt(cindex);
}
// add more applicant details
addOtherApplicant() {
// add more individuals details
addMoreIndividuals() {
const dialogRef = this.dialog.open(OtherApplicantDetailsComponent, {
data: '',
width:'40%',
@ -240,15 +278,16 @@ export class GeneralInfoComponent implements OnInit {
.subscribe(dataresult => {
if(dataresult.data.length>0){
dataresult.data.forEach(element => {
let individualsControl = <FormArray>this._generalForm.controls['individuals'];
element.individuals_order_id = individualsControl.controls.length+1;
individualsControl.push(this.createIndividulas(element));
let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','company_name':element.company_name,'company_relation':''};
let applicant_details: any= {'pd_co_applicant_id':element.pd_co_applicant_id,'applicant_name':element.applicant_name,'applicant_relation_to':'','relation':'','company_name':'','company_relation':'','individuals_order_id':element.individuals_order_id};
relationControl.push(this.createApplicantRelation(applicant_details));
relationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
relationControl.push(this.createMultipleRelation(applicant_details))
relationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
relationControl.push(this.createMultipleCompanyRelation(applicant_details))
// push related to details
this.fetch_related_details.push(element.applicant_name);
let mulRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_relation');
mulRelationControl.push(this.createMultipleRelation(applicant_details))
let mulCmyRelationControl = <FormArray> relationControl.controls[relationControl.controls.length-1].get('multiple_company_relation');
mulCmyRelationControl.push(this.createMultipleCompanyRelation(applicant_details))
});
}
@ -256,16 +295,10 @@ export class GeneralInfoComponent implements OnInit {
}
// remove other details
removeOthers(index, item: any){
if(item.pd_co_applicant_id==0){
let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
relationControl.removeAt(index);
// remove related to details
let pos_name=this.fetch_related_details.indexOf(item.applicant_name);
this.fetch_related_details.splice(pos_name, 1);
}
// remove individuals
removeIndividuals(findex,order_id){
let control = <FormArray>this._generalForm.controls['individuals'];
control.removeAt(findex);
}
// submit form details
@ -280,34 +313,12 @@ export class GeneralInfoComponent implements OnInit {
}
else{
let saveRecords:any = {}
let applicantList:any=[];
let applicantRelationList:any=[];
// this for applicant list for selected
formData.applicant_list.forEach((element,key) => {
if(element.exist_status==1){
applicantList.push({
"pd_co_applicant_id":element.pd_co_applicant_id,
"applicant_name":element.applicant_name,
})
}
});
// this is for selected applicant relation
// formData.applicant_relation.forEach((element,key) => {
// applicantRelationList.push({
// "pd_co_applicant_id":element.pd_co_applicant_id,
// "applicant_name":element.applicant_name,
// "company_name":element.company_name,
// "company_relationship":element.company_relationship,
// "applicant_relation_to":element.applicant_relation_to,
// "relationship":element.relationship,
// })
// });
saveRecords.pdid=formData.pdid;
saveRecords.formid=formData.formid;
saveRecords.general_remark=formData.general_remark;
saveRecords.selected_applicant=applicantList;
saveRecords.individuals=formData.individuals;
saveRecords.companies=formData.companies;
saveRecords.applicant_relation=formData.applicant_relation;
saveRecords.general_remark=formData.general_remark;
this._pd.savePDFormDetailsWithID(saveRecords).subscribe(
dataresult => {
if (dataresult.status == 200) {
@ -325,6 +336,7 @@ export class GeneralInfoComponent implements OnInit {
}
}
// validate all form group and form array fields
validateAllFormFields(formGroup: any) {
Object.keys(formGroup.controls).forEach(field => {

View File

@ -1,6 +1,7 @@
<form [formGroup]="_neighbourhoodForm" novalidate>
<h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left">
<!-- <div fxFlex="70" align="left"> -->
<div fxFlex="70" align="left" style="padding: 10px !important;">
<div fxLayout="row wrap">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
{{pageTitle}}
@ -9,7 +10,7 @@
</div>
</div>
<div fxFlex="30" align="end">
<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>
@ -17,6 +18,7 @@
<mat-dialog-content>
<mat-card>
<mat-card-header>
<br>
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100">
<mat-radio-group formControlName="check_type" class="example-radio-group">
<mat-radio-button class="example-radio-button" color="primary" [value]="types.id" *ngFor="let types of check_type; let t = index">{{types.type_name}}</mat-radio-button>
@ -27,17 +29,17 @@
<mat-card *ngFor="let neighbourhood of _neighbourhoodForm.controls.neighbourhood_list['controls']; let n = index;" [formGroupName]="n">
<mat-card-content>
<mat-form-field style="width: 42%">
<input matInput placeholder="Neighbour Name" formControlName="neighbourhood_name" type="text">
<input matInput autocomplete="off" placeholder="Neighbour Name" formControlName="neighbourhood_name" type="text">
</mat-form-field>
<mat-form-field style="width: 40%">
<mat-select placeholder="Do You Know" formControlName="do_know">
<mat-select placeholder="Do You Know the Applicant" formControlName="do_know">
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 42%" *ngIf="neighbourhood.controls.do_know.value=='Yes'">
<input matInput placeholder="How Long to Know the Applicant " formControlName="how_long_do_know" type="text" (keypress)="keyPress($event)">
<input matInput autocomplete="off" placeholder="How Long to Know the Applicant " formControlName="how_long_do_know" type="text" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field style="width: 42%" *ngIf="neighbourhood.controls.do_know.value=='Yes'">
<mat-select placeholder="Is the Applicant Owner" formControlName="is_applicant_owner">
@ -54,23 +56,24 @@
<mat-card-content formArrayName="referencecheck_list" *ngIf="_neighbourhoodForm.controls.check_type.value==1">
<mat-card *ngFor="let reference of _neighbourhoodForm.controls.referencecheck_list['controls']; let r = index;" [formGroupName]="r">
<mat-card-content>
<mat-form-field style="width: 28%">
<input matInput placeholder="Name" formControlName="reference_name" type="text">
<mat-form-field style="width: 25%">
<input matInput autocomplete="off" placeholder="Name" formControlName="reference_name" type="text">
</mat-form-field>
<mat-form-field style="width: 24%">
<input matInput placeholder="Mobile Number" formControlName="mobile" type="text" (keypress)="keyPress($event)">
<input matInput autocomplete="off" placeholder="Mobile Number" formControlName="mobile" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="reference['controls'].mobile.hasError('maxlength') || reference['controls'].mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 10%">
<input matInput placeholder="STD" formControlName="std_code" type="text" (keypress)="keyPress($event)">
<mat-form-field style="width: 12%">
<input matInput autocomplete="off" placeholder=" STD " formControlName="std_code" type="text" (keypress)="keyPress($event)">
<span matPrefix>+91</span>
<mat-error *ngIf="reference['controls'].std_code.hasError('maxlength') || reference['controls'].std_code.hasError('minlength')">Enter Valid STD Code. </mat-error>
</mat-form-field> <span>-</span>
<mat-form-field style="width: 20%">
<input matInput placeholder="Landline Number" formControlName="landline" type="text" (keypress)="keyPress($event)">
<input matInput autocomplete="off" placeholder="Landline Number" formControlName="landline" type="text" (keypress)="keyPress($event)">
<mat-error *ngIf="reference['controls'].landline.hasError('maxlength') || reference['controls'].landline.hasError('minlength')">Enter Valid Landline Number. </mat-error>
</mat-form-field>
<mat-form-field style="width: 28%">
<textarea matInput placeholder="Location" formControlName="location"></textarea>
<textarea matInput autocomplete="off" placeholder="Location" formControlName="location"></textarea>
</mat-form-field>
<mat-form-field style="width: 28%">
@ -82,17 +85,18 @@
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%" *ngIf="reference.controls.relationship_with.value==5">
<input matInput placeholder="Others" formControlName="others" type="text">
<input matInput autocomplete="off" placeholder="Specify Business Relation" formControlName="others" type="text">
</mat-form-field>
<p #period_paragraph>Period of Relationship</p>
<mat-form-field style="width: 12%">
<input matInput placeholder="Year" formControlName="year_relation_applicant" type="text" (keypress)="keyPress($event)">
<input matInput autocomplete="off" placeholder="Year(s)" formControlName="year_relation_applicant" (keypress)="keyPress($event)">
</mat-form-field>
<mat-form-field style="width: 12%">
<input matInput placeholder="Month" formControlName="months_relation_applicant" type="text" (keypress)="keyPress($event)">
<input matInput autocomplete="off" placeholder="Month(s)" formControlName="months_relation_applicant" (keypress)="keyPress($event)" (change)="ConvertMonthintoYear(reference,$event.target.value)">
</mat-form-field>
<mat-form-field style="width: 28%">
<input matInput [placeholder]="reference.controls.relationship_with.value ==4 ? 'Rent Amount' : 'Volume of Business'" formControlName="business_volume_amount" type="text" (keypress)="keyPress($event)">
<input matInput autocomplete="off" [placeholder]="reference.controls.relationship_with.value ==4 ? 'Rent Amount' : 'Volume of Business'" formControlName="business_volume_amount" type="text" (keypress)="keyPress($event)" (keyup)="inWords($event,r)">
<mat-hint align="start" style="font-size:70%" *ngIf="reference.controls.business_volume_amount.value != ''">{{"&#8377;"}} {{amtInwords[r]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width: 22%">
<mat-select placeholder="Unit" formControlName="business_volume_unit">
@ -102,6 +106,23 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%" *ngIf="reference.controls.business_volume_unit.value==8">
<input matInput autocomplete="off" placeholder="Specify Unit" formControlName="others_unit" type="text">
</mat-form-field>
<span style="width:100%">
<mat-form-field style="width: 55%">
<mat-select placeholder=" Final remarks of PD officer on Reference Check done" formControlName="reference_final_remarks">
<mat-option>Select</mat-option>
<mat-option *ngFor="let remark of finalRemarksList" [value]="remark.id">
{{remark.name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 30%" *ngIf="reference.controls.reference_final_remarks.value != '' ">
<input matInput autocomplete="off" placeholder="Specify Remarks" formControlName="specify_final_remark" type="text">
</mat-form-field>
</span>
<button type="button" mat-raised-button mat-icon-button (click)="removeReferencecheck(r)"
matTooltip="Remove Reference Check" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="r!=0">
<mat-icon>delete</mat-icon></button>
@ -122,7 +143,7 @@
<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="neighbour_reference_remark" required></textarea>
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="neighbour_reference_remark" required></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">

View File

@ -16,12 +16,16 @@ export class NeighbourHoodComponent implements OnInit {
form_id:number;
private notifier: NotifierService;
check_type:any=[{'id':0,'type_name':'Neighbourhood'},{'id':1,'type_name':'Reference Check'}]
default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':''};
default_reference_details: any= {'reference_name':'','mobile':'','landline':'-','location':'','relationship_with':'','year_relation_applicant':'','months_relation_applicant':'','business_volume_amount':'','business_volume_unit':'','reference_final_remarks':'','positive_remark':'','negative_remark':'','insufficient_info_remark':''};
default_neighbourhood_details: any= {'neighbourhood_name':'','do_know':'','how_long_do_know':'','is_applicant_owner':''};
busineesRelationshipList:any=[];
volumeunitList:any=[];
errorMessage:any;
finalRemarksList : any = [{'id': 1,'name': "Positive"},
{'id': 2,'name': "Negative"},
{'id': 3,'name': "Insufficient information provided"}];
amtInwords : any = [];
constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,) {
this.pdid = this.data.pdmaster_details.pd_id;
this.notifier = notifier;
@ -90,7 +94,8 @@ export class NeighbourHoodComponent implements OnInit {
});
}
else if(exist_ref_details.length>0 && data.records.check_type==1){
exist_ref_details.forEach(element => {
exist_ref_details.forEach((element,index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount);
referencecheckControl.push(this.createReerenceCheck(element));
});
}
@ -143,6 +148,12 @@ export class NeighbourHoodComponent implements OnInit {
months_relation_applicant:[elementValue.months_relation_applicant,Validators.required],
business_volume_amount:[elementValue.business_volume_amount,Validators.required],
business_volume_unit:[elementValue.business_volume_unit, Validators.required],
others_unit : [elementValue.others_unit],
reference_final_remarks:[elementValue.reference_final_remarks],
specify_final_remark : [elementValue.specify_final_remark],
// positive_remark:[elementValue.positive_remark],
// negative_remark:[elementValue.negative_remark],
// insufficient_info_remark:[elementValue.insufficient_info_remark]
});
}
@ -229,6 +240,12 @@ export class NeighbourHoodComponent implements OnInit {
"months_relation_applicant":element.months_relation_applicant,
"business_volume_amount":element.business_volume_amount,
"business_volume_unit":element.business_volume_unit,
"others_unit":element.others_unit,
"reference_final_remarks":element.reference_final_remarks,
"specify_final_remark":element.specify_final_remark
// "positive_remark":element.positive_remark,
// "negative_remark":element.negative_remark,
// "insufficient_info_remark":element.insufficient_info_remark
})
});
saveRecords.referencecheck_list=referencecheck_list;
@ -270,5 +287,24 @@ validateAllFormFields(formGroup: any) {
});
}
/** To Convert Month into Year */
ConvertMonthintoYear(itemrow,e){
// console.log(itemrow);
// console.log(e);
let year = itemrow.controls.year_relation_applicant.value;
let converted_month : number = e%12;
let converted_year : number = e/12;
itemrow.controls.year_relation_applicant.setValue(+year + +Math.floor(converted_year));
itemrow.controls.months_relation_applicant.setValue(Math.floor(converted_month));
}
/** Amount InWords */
inWords(e,i){
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
}
}

View File

@ -31,32 +31,34 @@
</mat-card>
<mat-card *ngIf="otherIncomeForm.controls.other_income.value == 'Yes'">
<mat-card-header><p>Income Details<p></mat-card-header>
<mat-card-header><mat-card-title><p>Income Details</p></mat-card-title></mat-card-header>
<div formArrayName="income_details">
<div *ngFor="let details of otherIncomeForm.get('income_details').controls; let i=index"
[formGroupName]="i">
<mat-card-content class="matcard">
<mat-form-field>
<mat-form-field style="width:25%">
<mat-select placeholder="Source"
formControlName="source" required>
<mat-option value="rental_income">Rental Income</mat-option>
<mat-option value="{{src.id}}" *ngFor="let src of sourceData">{{src.name}}</mat-option>
<!-- <mat-option value="rental_income">Rental Income</mat-option>
<mat-option value="interest_income">Interest Income</mat-option>
<mat-option value="agricultural_income">Agricultural Income</mat-option>
<mat-option value="dividend_income">Dividend Income</mat-option>
<mat-option value="others">Others</mat-option>
<mat-option value="others">Others</mat-option> -->
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="details.get('source').value == 'others'">
<input matInput placeholder="Specify Others Source"
<mat-form-field style="width:25%" *ngIf="details.get('source').value == 5">
<input matInput autocomplete="off" placeholder="Specify Source"
formControlName="others_source">
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Amount" formControlName="amount" (keypress)="keyPress($event)" required>
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Amount" formControlName="amount" (keypress)="keyPress($event)" required (keyup)="inWords($event,i)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('amount').value != ''">{{"&#8377;"}} {{amtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field>
<mat-form-field style="width:25%">
<mat-select placeholder="Frequency" formControlName="frequency" required>
<mat-option value="{{frq.frequency_id}}" *ngFor="let frq of frequencyData">{{frq.name}}</mat-option>
</mat-select>
@ -64,8 +66,8 @@
<!-- {{otherIncomeForm.controls.frequency.value}} -->
<mat-form-field *ngIf="details.get('frequency').value == 8">
<input matInput placeholder="Specify Others Frequency"
<mat-form-field style="width:25%" *ngIf="details.get('frequency').value == 8">
<input matInput autocomplete="off" placeholder="Specify Frequency"
formControlName="others_frequency">
</mat-form-field>
@ -196,7 +198,7 @@
<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="otherincome_remarks" required></textarea>
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="otherincome_remarks" required></textarea>
</mat-form-field>
</div>
<div fxFlex="40" align="end">
@ -241,7 +243,7 @@
</mat-form-field>-->
<!--<mat-form-field>-->
<!--<input matInput placeholder="Amount" formControlName="amount">-->
<!--<input matInput autocomplete="off" placeholder="Amount" formControlName="amount">-->
<!--</mat-form-field>-->
<!--<mat-form-field>-->
<!--<mat-select placeholder="Frequency" formControlName="frequency">-->
@ -261,7 +263,7 @@
<!--</div>-->
<!--</mat-card>-->
<!--<mat-form-field>-->
<!--<input matInput placeholder="Remarks" formControlName="otherincome_remarks">-->
<!--<input matInput autocomplete="off" placeholder="Remarks" formControlName="otherincome_remarks">-->
<!--</mat-form-field>-->
<!--<button mat-raised-button type="submit" class="button" (click)="submitCurrentDetails()">Submit</button>-->
<!--</form>-->
@ -289,12 +291,12 @@
<!-- </mat-select>
</mat-form-field>
<mat-form-field *ngIf="details.get('source').value == 5 ">
<input matInput placeholder="Specify Others Source"
<input matInput autocomplete="off" placeholder="Specify Others Source"
formControlName="others_source">
</mat-form-field>
<mat-form-field>
<input matInput placeholder="Amount" formControlName="amount" (keypress)="keyPress($event)" required>
<input matInput autocomplete="off" placeholder="Amount" formControlName="amount" (keypress)="keyPress($event)" required>
</mat-form-field>
<mat-form-field>
<mat-select placeholder="Frequency" formControlName="frequency" required>
@ -305,7 +307,7 @@
<!-- {{otherIncomeForm.controls.frequency.value}} -->
<!-- <mat-form-field *ngIf="details.get('frequency').value == 8">
<input matInput placeholder="Specify Others Frequency"
<input matInput autocomplete="off" placeholder="Specify Others Frequency"
formControlName="others_frequency">
</mat-form-field>
<button type="button" matTooltip="Add More Income Details" class="mr-1 mb-1 hover-icon" matTooltipPosition="above" mat-raised-button mat-icon-button (click)="addIncomeDetails()"
@ -324,7 +326,7 @@
<div fxFlex="60" class="pb-0 text-sm-left">
<mat-form-field appearance="outline" style="width: 100%">
<mat-label>Remarks</mat-label>
<textarea matInput placeholder="Remarks" formControlName="otherincome_remarks" required></textarea>
<textarea matInput autocomplete="off" placeholder="Remarks" formControlName="otherincome_remarks" required></textarea>
</mat-form-field>
</div>
</div>

View File

@ -43,6 +43,7 @@ export class OtherIncomeComponent implements OnInit {
private notifier: NotifierService;
frequencyData: any = [];
sourceData : any = [];
amtInwords : any = [];
constructor(notifier: NotifierService,
private fb: FormBuilder,
@ -95,7 +96,8 @@ public viewerOptions: any = {
return value.records.income_details[key];
});
if (result.length > 0) {
result.forEach(val => {
result.forEach((val,index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(val.amount);
control.push(this.createDetail());
});
this.otherIncomeForm.controls['income_details'].setValue(result);
@ -208,4 +210,9 @@ public viewerOptions: any = {
event.preventDefault();
}
}
/** Amount InWords */
inWords(e,i){
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
}
}