amount in words : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-03-25 15:24:31 +05:30
parent a16432e118
commit 4a6b979d77
24 changed files with 472 additions and 531 deletions

View File

@ -173,11 +173,8 @@
<div [formGroupName]="s"> <div [formGroupName]="s">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<input matInput placeholder="Premium Paid" formControlName="premium_paid" <input OnlyNumber type="text" matInput placeholder="Premium Paid" formControlName="premium_paid">
OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,s,6)"> <mat-hint align="start" style="font-size:90%" *ngIf="detail.get('premium_paid').value != ''">{{"&#8377;"}} {{detail.get('premium_paid').value | numberToWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('premium_paid').value != ''">{{"&#8377;"}}
{{OtherPremiumPaidInwords[s]}} Only</mat-hint>
<!-- <mat-hint align="start" style="font-size:90%" *ngIf="detail.get('premium_paid').value != ''">{{ "&#8377;" + detail.get('premium_paid').value | numberToWords + 'Only'}} </mat-hint> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<mat-select placeholder="Frequency" formControlName="frequency_mode" <mat-select placeholder="Frequency" formControlName="frequency_mode"
@ -195,10 +192,8 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<input matInput placeholder="Sum Assured" formControlName="sum_assured" <input matInput placeholder="Sum Assured" formControlName="sum_assured" OnlyNumber type="text" autocomplete="off">
OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,s,8)"> <mat-hint align="start" style="font-size:90%" *ngIf="detail.get('sum_assured').value != ''">{{"&#8377;"}} {{detail.get('sum_assured').value | numberToWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('sum_assured').value != ''">{{"&#8377;"}}
{{OtherSumAssuredInwords[s]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
@ -239,12 +234,8 @@
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<input matInput placeholder="Current Market Value" formControlName="amount_of_invest" <input matInput placeholder="Current Market Value" formControlName="amount_of_invest"
OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,i,10)"> OnlyNumber type="text" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('amount_of_invest').value != ''">{{"&#8377;"}} {{detail.get('amount_of_invest').value | numberToWords}} Only</mat-hint>
<!--<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('amount_of_invest').value != ''">{{"&#8377;"}} {{OtherAmtInvestInwords[i]}} Only</mat-hint>-->
<mat-hint align="start" style="font-size:90%" *ngIf="detail.get('amount_of_invest').value != ''">{{"&#8377;"}}
{{OtherAmtInvestInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -305,9 +296,8 @@
<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" <mat-form-field *ngIf="sup.get('assets_mode').value == 1 || sup.get('assets_mode').value == 2 || sup.get('assets_mode').value == 3 || sup.get('assets_mode').value == 4 || sup.get('assets_mode').value == 5"
style="width:45%"> style="width:45%">
<input matInput placeholder="Approximate Market Value" formControlName="approximate_market_value" <input matInput placeholder="Approximate Market Value" formControlName="approximate_market_value"
OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,i,2)"> OnlyNumber type="text" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('approximate_market_value').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="sup.get('approximate_market_value').value != ''">{{"&#8377;"}} {{detail.get('approximate_market_value').value | numberToWords}} Only</mat-hint>
{{OtherAppxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="sup.get('assets_mode').value != ''" style="width:45%"> <mat-form-field *ngIf="sup.get('assets_mode').value != ''" style="width:45%">

View File

@ -51,20 +51,6 @@ export class AssetsInfoComponent implements OnInit {
public m_any_asset_loan_type = [{ 'value': "yes", 'viewValue': "Yes" }, public m_any_asset_loan_type = [{ 'value': "yes", 'viewValue': "Yes" },
{ 'value': "no", 'viewValue': "No" }, { 'value': "no", 'viewValue': "No" },
{ 'value': "nan", 'viewValue': "NA" }] { 'value': "nan", 'viewValue': "NA" }]
// appxMarketAmtInwords : any = [];
OtherAppxMarketAmtInwords: any = [];
// emiAmtInwords : any = [];
OtherEmiAmtInwords: any = [];
// PremiumPaidInwords : any = [];
OtherPremiumPaidInwords: any = [];
// SumAssuredInwords: any = [];
OtherSumAssuredInwords: any = [];
// AmtInvestInwords: any = [];
OtherAmtInvestInwords: any = [];
// AssetValueInwords: any = [];
OtherAssetValueInwords: any = [];
// B_emiAmtInwords: any = [];
O_emiAmtInwords: any = [];
public m_propertyType = []; public m_propertyType = [];
@ -625,7 +611,7 @@ export class AssetsInfoComponent implements OnInit {
// }); // });
// } // }
// this.isOtherOwner[index] = Avaliablity == 0 ? true : false; // this.isOtherOwner[index] = Avaliablity == 0 ? true : false;
this.OtherAppxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.approximate_market_value);
this.setRequiredValidation(datas.name_of_the_owner, index, '', 4); this.setRequiredValidation(datas.name_of_the_owner, index, '', 4);
}); });
} }
@ -655,7 +641,7 @@ export class AssetsInfoComponent implements OnInit {
// 'any_other_asset_value' : datas.any_other_asset_value, // 'any_other_asset_value' : datas.any_other_asset_value,
// 'any_other_asset_loan' : datas.any_other_asset_loan, // 'any_other_asset_loan' : datas.any_other_asset_loan,
}; };
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.any_other_asset_value);
}); });
const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray; const control = (<FormArray>this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
control.push(this.otherAssetsDescriptionWithData(array_data)); control.push(this.otherAssetsDescriptionWithData(array_data));
@ -706,8 +692,7 @@ export class AssetsInfoComponent implements OnInit {
case '6': { case '6': {
let array_data: any; let array_data: any;
data.forEach((datas, i) => { data.forEach((datas, i) => {
this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.premium_paid);
this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.sum_assured);
array_data = { array_data = {
'premium_paid': datas.premium_paid, 'premium_paid': datas.premium_paid,
'frequency_mode': datas.frequency_mode, 'frequency_mode': datas.frequency_mode,
@ -723,7 +708,6 @@ export class AssetsInfoComponent implements OnInit {
case '7': { case '7': {
let array_data: any; let array_data: any;
data.forEach((datas, i) => { data.forEach((datas, i) => {
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(+datas.amount_of_invest);
array_data = { array_data = {
'investments_type': datas.investments_type, 'investments_type': datas.investments_type,
'other_investments_type': datas.other_investments_type, 'other_investments_type': datas.other_investments_type,
@ -944,55 +928,6 @@ export class AssetsInfoComponent implements OnInit {
} }
/** 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;
case 5:
// this.PremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 6:
this.OtherPremiumPaidInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 7:
// this.SumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 8:
this.OtherSumAssuredInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 9:
// this.AmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 10:
this.OtherAmtInvestInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 11:
// this.AssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 12:
this.OtherAssetValueInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 13:
// this.B_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 14:
this.O_emiAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
} }

View File

@ -155,11 +155,14 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 45%;" *ngIf="this.limitCaseFlag[i]"> <mat-form-field style="width: 45%;" *ngIf="this.limitCaseFlag[i]">
<!-- *ngIf="itemrow.get('account_type').value != 2"> --> <!-- *ngIf="itemrow.get('account_type').value != 2">
<input matInput autocomplete="off" placeholder="Limit in case of OD / CC account" <input matInput autocomplete="off" placeholder="Limit in case of OD / CC account"
formControlName="limit" OnlyNumber type="text" (keyup)="inWords($event,i,1)"> formControlName="limit" OnlyNumber type="text" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('limit').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('limit').value != ''">{{"&#8377;"}}
{{amtInwords[i]}} Only</mat-hint> {{amtInwords[i]}} Only</mat-hint>-->
<input matInput autocomplete="off" placeholder="Limit in case of OD / CC account"
formControlName="limit" OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('limit').value != ''">{{"&#8377;"}} {{itemrow.get('limit').value | numberToWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<div> <div>

View File

@ -45,8 +45,6 @@ export class BankingDetailsComponent implements OnInit {
salaryField: boolean; salaryField: boolean;
OtherFlag: any = []; OtherFlag: any = [];
limitCaseFlag: any = []; limitCaseFlag: any = [];
amtInwords: any = [];
emiAmtInwords: any = [];
existCompanyList: any = []; existCompanyList: any = [];
mergeCompanyApplicant: any = []; mergeCompanyApplicant: any = [];
@ -149,7 +147,6 @@ export class BankingDetailsComponent implements OnInit {
control.push(this.createBankarray()); control.push(this.createBankarray());
} else { } else {
result.forEach((datas, index) => { result.forEach((datas, index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(+datas.limit);
// this.selectedBorrower(datas.applicant_name,index); // this.selectedBorrower(datas.applicant_name,index);
this.selectedAccTypeChanges(+datas.account_type, index) this.selectedAccTypeChanges(+datas.account_type, index)
@ -342,19 +339,4 @@ export class BankingDetailsComponent implements OnInit {
itemrow.controls.vintage_month.setValue(Math.floor(converted_month)); 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;
}
}
} }

View File

@ -91,11 +91,9 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%" *ngIf="(itemrow.get('business_ownership_type').value == 'rented')"> <mat-form-field style="width:45%" *ngIf="(itemrow.get('business_ownership_type').value == 'rented')">
<input matInput autocomplete="off" placeholder="Monthly Rent Amount" formControlName="business_monthly_rented_amt" <input matInput autocomplete="off" placeholder="Monthly Rent Amount" formControlName="business_monthly_rented_amt" OnlyNumber type="text">
OnlyNumber type="text" (keyup)="inWords($event,i,9)"> <mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('business_monthly_rented_amt').value != ''">{{"&#8377;"}} {{itemrow.get('business_monthly_rented_amt').value | numberToWords}} Only</mat-hint>
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('business_monthly_rented_amt').value != ''">{{"&#8377;"}} <mat-error>Monthly Rent Amount Required</mat-error>
{{RentAmtInwordsForAddress[i]}} Only</mat-hint>
<mat-error>Monthly Rent Amount Required</mat-error>
</mat-form-field> </mat-form-field>
@ -103,9 +101,8 @@
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value" <input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value"
OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,i,10)"> OnlyNumber type="text" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('business_approximate_market_value').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('business_approximate_market_value').value != ''">{{"&#8377;"}} {{itemrow.get('business_approximate_market_value').value | numberToWords}} Only</mat-hint>
{{appxMarketAmtInwordsForAddress[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
@ -289,10 +286,9 @@
<mat-form-field style="width:45%" *ngIf="(sup.get('business_assets_mode').value != '' && sup.get('business_ownership_type').value == 'rented')"> <mat-form-field style="width:45%" *ngIf="(sup.get('business_assets_mode').value != '' && sup.get('business_ownership_type').value == 'rented')">
<input matInput autocomplete="off" placeholder="Monthly Rent Amount" formControlName="business_monthly_rented_amt" <input matInput placeholder="Monthly Rent Amount" formControlName="business_monthly_rented_amt"
OnlyNumber type="text" (keyup)="inWords($event,i,8)"> OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('business_monthly_rented_amt').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="sup.get('business_monthly_rented_amt').value != ''">{{"&#8377;"}} {{sup.get('business_monthly_rented_amt').value | numberToWords}} Only</mat-hint>
{{RentAmtInwords[i]}} Only</mat-hint>
<mat-error>Monthly Rent Amount Required</mat-error> <mat-error>Monthly Rent Amount Required</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
@ -300,9 +296,8 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none" *ngIf="sup.get('business_assets_mode').value != '' && sup.get('business_ownership_type').value == 'owned'"> <div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none" *ngIf="sup.get('business_assets_mode').value != '' && sup.get('business_ownership_type').value == 'owned'">
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value" <input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value"
OnlyNumber type="text" autocomplete="off" (keyup)="inWords($event,i,1)"> OnlyNumber type="text" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('business_approximate_market_value').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="sup.get('business_approximate_market_value').value != ''">{{"&#8377;"}} {{sup.get('business_approximate_market_value').value | numberToWords}} Only</mat-hint>
{{appxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">

View File

@ -63,12 +63,6 @@ export class BusinessAssetsInfoComponent implements OnInit {
mergeCompanyApplicant: any = []; mergeCompanyApplicant: any = [];
endUserList = []; endUserList = [];
/**Declaration of amount in words */
appxMarketAmtInwords: any = [];
appxMarketAmtInwordsForAddress: any = [];
RentAmtInwords: any = [];
RentAmtInwordsForAddress: any = [];
/**Constructor of the class */ /**Constructor of the class */
constructor( constructor(
notifier: NotifierService, notifier: NotifierService,
@ -582,8 +576,7 @@ console.clear();
}); });
if (result.length > 0) { if (result.length > 0) {
result.forEach((datas, index) => { result.forEach((datas, index) => {
this.RentAmtInwordsForAddress[index] = this.pdTrigerService.convertNumberToWords(datas.business_monthly_rented_amt);
this.appxMarketAmtInwordsForAddress[index] = this.pdTrigerService.convertNumberToWords(datas.business_approximate_market_value);
let Avaliablity = 1; let Avaliablity = 1;
if (datas.business_name_of_the_owner.length > 0) { if (datas.business_name_of_the_owner.length > 0) {
@ -639,8 +632,7 @@ console.clear();
if (result.length > 0) { if (result.length > 0) {
result.forEach((datas, index) => { result.forEach((datas, index) => {
this.appxMarketAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_approximate_market_value);
this.RentAmtInwords[index] = this.pdTrigerService.convertNumberToWords(+datas.business_monthly_rented_amt);
let Avaliablity = 1; let Avaliablity = 1;
if (datas.business_name_of_the_owner.length > 0) { if (datas.business_name_of_the_owner.length > 0) {
@ -996,26 +988,6 @@ console.clear();
this.placeholderName = 'Was any business activity seen at the ' + e + ' during PD visit?'; this.placeholderName = 'Was any business activity seen at the ' + e + ' during PD visit?';
} }
/** Amount InWords */
inWords(e, i, flag) {
switch (flag) {
case 1:
this.appxMarketAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 8:
this.RentAmtInwords[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 9:
this.RentAmtInwordsForAddress[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
case 10:
this.appxMarketAmtInwordsForAddress[i] = this.pdTrigerService.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
/** For Docs Tab */ /** For Docs Tab */
public viewerOptions: any = { public viewerOptions: any = {

View File

@ -90,9 +90,8 @@
<mat-form-field style="width: 45%;" *ngIf="this.limitCaseFlag[i]"> <mat-form-field style="width: 45%;" *ngIf="this.limitCaseFlag[i]">
<!-- *ngIf="itemrow.get('account_type').value != 2"> --> <!-- *ngIf="itemrow.get('account_type').value != 2"> -->
<input matInput autocomplete="off" placeholder="Limit in case of OD / CC account" <input matInput autocomplete="off" placeholder="Limit in case of OD / CC account"
formControlName="limit" OnlyNumber type="text" (keyup)="inWords($event,i,1)"> formControlName="limit" OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('limit').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="itemrow.get('limit').value != ''">{{"&#8377;"}} {{itemrow.get('limit').value | numberToWords}} Only</mat-hint>
{{amtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<div> <div>

View File

@ -46,8 +46,6 @@ export class BusinessBankingDetailsComponent implements OnInit {
salaryField: boolean; salaryField: boolean;
OtherFlag: any = []; OtherFlag: any = [];
limitCaseFlag: any = []; limitCaseFlag: any = [];
amtInwords: any = [];
emiAmtInwords: any = [];
existCompanyList: any = []; existCompanyList: any = [];
mergeCompanyApplicant: any = []; mergeCompanyApplicant: any = [];
@ -146,11 +144,11 @@ export class BusinessBankingDetailsComponent implements OnInit {
control.push(this.createBankarray()); control.push(this.createBankarray());
} else { } else {
result.forEach((datas, index) => { result.forEach((datas, index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(+datas.limit);
// this.selectedBorrower(datas.applicant_name,index); // this.selectedBorrower(datas.applicant_name,index);
this.selectedAccTypeChanges(+datas.account_type, index) this.selectedAccTypeChanges(+datas.account_type, index)
// this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
control.push(this.createBankarray()); control.push(this.createBankarray());
}); });
this.bankingForm.controls.itemRows.setValue(result); this.bankingForm.controls.itemRows.setValue(result);
@ -356,20 +354,6 @@ export class BusinessBankingDetailsComponent implements OnInit {
} }
/** 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;
}
}
setRequiredValidation(value, item, flag) { setRequiredValidation(value, item, flag) {
if (flag == 1) { if (flag == 1) {

View File

@ -1510,10 +1510,15 @@
</div> </div>
<mat-form-field style="width:62%"> <mat-form-field style="width:62%">
<input matInput placeholder="Approximate total monthly salary paid to employees" <input matInput placeholder="Approximate total monthly salary paid to employees"
formControlName="employees_appx_salary"
required type="number">
<mat-hint align="start" style="font-size:90%" *ngIf="businessForm.controls['employees_appx_salary'].value != ''">{{"&#8377;"}} {{businessForm.controls['employees_appx_salary'].value | numberToWords}} Only</mat-hint>
<!-- <input matInput placeholder="Approximate total monthly salary paid to employees"
(keyup)="inWords($event,1)" formControlName="employees_appx_salary" (keyup)="inWords($event,1)" formControlName="employees_appx_salary"
required type="number"> required type="number">
<mat-hint align="start" style="font-size:90%" *ngIf="businessForm.controls['employees_appx_salary'].value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="businessForm.controls['employees_appx_salary'].value != ''">{{"&#8377;"}}
{{appxSalaryAmtInwords}} Only</mat-hint> {{appxSalaryAmtInwords}} Only</mat-hint> -->
</mat-form-field> </mat-form-field>
</mat-card-content> </mat-card-content>

View File

@ -66,7 +66,7 @@ export class BusinessInfoComponent implements OnInit {
//sourceNames: any = {"Private Limited Company": 'Director / Shareholder Details',"Proprietorship": 'Proprietor Details', "Sole Proprietorship": 'Proprietor Details',"Partnership": 'Partner Details',"Limited Liability Partnership (LLP)": 'Partner Details',"One Person Company (OPC)": 'Director Details',"Hindu Undivided Family (HUF)": 'Karta Details',"Society": 'Member Details',"Cooperative": 'Member Details',"Trust": 'Trustee Details',"Public Ltd Company": 'Director / Shareholder Details','Individual':'Self',"Others": 'Other Enitity Details'}; //sourceNames: any = {"Private Limited Company": 'Director / Shareholder Details',"Proprietorship": 'Proprietor Details', "Sole Proprietorship": 'Proprietor Details',"Partnership": 'Partner Details',"Limited Liability Partnership (LLP)": 'Partner Details',"One Person Company (OPC)": 'Director Details',"Hindu Undivided Family (HUF)": 'Karta Details',"Society": 'Member Details',"Cooperative": 'Member Details',"Trust": 'Trustee Details',"Public Ltd Company": 'Director / Shareholder Details','Individual':'Self',"Others": 'Other Enitity Details'};
sourceNames: { [k: string]: any } = {}; sourceNames: { [k: string]: any } = {};
maxDate: any; maxDate: any;
// InvestedAmountInWords:any;
public relationSource = new MatTableDataSource(); public relationSource = new MatTableDataSource();
displayedColumns = ['title', 'family_member_name', 'relation', 'relation_to', 'relationship_with_company', 'started_business']; displayedColumns = ['title', 'family_member_name', 'relation', 'relation_to', 'relationship_with_company', 'started_business'];
generalExistEntityType: string; generalExistEntityType: string;
@ -79,7 +79,6 @@ export class BusinessInfoComponent implements OnInit {
monthErrorMessage: any = []; monthErrorMessage: any = [];
errorMessageForExistTotalWorkExperience: any = []; errorMessageForExistTotalWorkExperience: any = [];
ExportFlag: boolean = false; ExportFlag: boolean = false;
appxSalaryAmtInwords: any;
isreadonlyyear: any = []; isreadonlyyear: any = [];
isreadonlymonth: any = []; isreadonlymonth: any = [];
ManufacturingUnChecked: boolean; ManufacturingUnChecked: boolean;
@ -225,9 +224,9 @@ export class BusinessInfoComponent implements OnInit {
businessVal.formid = this.form_id; businessVal.formid = this.form_id;
businessVal.company_id = this.company_id; businessVal.company_id = this.company_id;
businessVal.fk_createdby = this.pdid; businessVal.fk_createdby = this.pdid;
if (businessVal.employees_appx_salary) {
this.appxSalaryAmtInwords = this._pd.convertNumberToWords(businessVal.employees_appx_salary);
}
//businessVal.designation = DesgnArray; //businessVal.designation = DesgnArray;
businessVal.partners = PartnrArray; businessVal.partners = PartnrArray;
businessVal.documents = DocArray; businessVal.documents = DocArray;
@ -1669,10 +1668,6 @@ export class BusinessInfoComponent implements OnInit {
} }
} }
/** To Convert Amount into Words */
// inWords(e){
// this.InvestedAmountInWords = this._pd.convertNumberToWords(e);
// }
checkTotalEmployee(FormData) { checkTotalEmployee(FormData) {
this.businessForm.controls['employees_total'].setValue((+FormData.value.employees_permanent || 0) + (+FormData.value.employees_temporary || 0)); this.businessForm.controls['employees_total'].setValue((+FormData.value.employees_permanent || 0) + (+FormData.value.employees_temporary || 0));
@ -1841,13 +1836,6 @@ export class BusinessInfoComponent implements OnInit {
} }
inWords(e, flag) {
switch (flag) {
case 1:
this.appxSalaryAmtInwords = this._pd.convertNumberToWords(e.target.value);
break;
}
}
changePOSMachinesAvailablity(e, flag) { changePOSMachinesAvailablity(e, flag) {

View File

@ -37,9 +37,7 @@ export class CurrentLoanComponent implements OnInit {
placeholderName: any = []; placeholderName: any = [];
IDXval: any; IDXval: any;
OtherFlag: any = []; OtherFlag: any = [];
amtInwords: any = [];
labelArr: any = []; labelArr: any = [];
emiAmtInwords: any = [];
dataFromAssets: any = []; dataFromAssets: any = [];
existCompanyList: any = []; existCompanyList: any = [];
mergeCompanyApplicant: any = []; mergeCompanyApplicant: any = [];
@ -135,8 +133,6 @@ export class CurrentLoanComponent implements OnInit {
const control = <FormArray>this.currentLoanForm.controls['loan_details']; const control = <FormArray>this.currentLoanForm.controls['loan_details'];
if (result.length > 0) { if (result.length > 0) {
result.forEach((val, index) => { result.forEach((val, index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(val.loan_amount);
this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
this.selectedfrequency(val.frequency, index); this.selectedfrequency(val.frequency, index);
//this.selectedLoanTakenBy(val.loan_taken_by,index); //this.selectedLoanTakenBy(val.loan_taken_by,index);
@ -562,19 +558,7 @@ export class CurrentLoanComponent implements OnInit {
}) })
}); });
} }
/** 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;
}
}
setRequiredValidation(value, item, flag) { setRequiredValidation(value, item, flag) {
if (flag == 1) { if (flag == 1) {

View File

@ -102,9 +102,8 @@
<mat-form-field *ngIf="sup.get('residence_ownership').value == 3" style="width:43%;"> <mat-form-field *ngIf="sup.get('residence_ownership').value == 3" style="width:43%;">
<input matInput placeholder="Rent Amount" formControlName="rent" <input matInput placeholder="Rent Amount" formControlName="rent"
OnlyNumber type="text" (keyup)="inWords($event,1,i)"> OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('rent').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="sup.get('rent').value != ''">{{"&#8377;"}} {{sup.get('rent').value | numberToWords}} Only</mat-hint>
{{RentAmount[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
<!-- <div> <!-- <div>
@ -167,11 +166,15 @@
formControlName="earning_if_others_segment"> formControlName="earning_if_others_segment">
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<input matInput placeholder="Income Per Month" <input placeholder="Income Per Month"
formControlName="earning_gross_income_per_month"
OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="item.get('earning_gross_income_per_month').value != ''">{{"&#8377;"}} {{item.get('earning_gross_income_per_month').value | numberToWords}} Only</mat-hint>
<!-- <input matInput placeholder="Income Per Month"
formControlName="earning_gross_income_per_month" formControlName="earning_gross_income_per_month"
OnlyNumber type="text" (keyup)="inWords($event,2,i)"> OnlyNumber type="text" (keyup)="inWords($event,2,i)">
<mat-hint align="start" style="font-size:90%" *ngIf="item.get('earning_gross_income_per_month').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="item.get('earning_gross_income_per_month').value != ''">{{"&#8377;"}}
{{IncomePerMonth[i]}} Only</mat-hint> {{IncomePerMonth[i]}} Only</mat-hint> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%;"> <mat-form-field style="width:45%;">
<input matInput [placeholder]="item.get('earning_segment').value != 5 ? 'Name of the Employer/Business' : 'Pension Received From'" <input matInput [placeholder]="item.get('earning_segment').value != 5 ? 'Name of the Employer/Business' : 'Pension Received From'"

View File

@ -292,10 +292,10 @@ export class FamilyDetailsComponent implements OnInit {
} else { } else {
records.forEach((val, index) => { records.forEach((val, index) => {
if (val.rent != null) { // if (val.rent != null) {
this.RentAmount[index] = this._pd.convertNumberToWords(val.rent); // this.RentAmount[index] = this._pd.convertNumberToWords(val.rent);
} // }
this.FamilyMemberAsLabel[index] = this.selectPerson.filter(item => item.pd_co_applicant_id == val.selected_person)[0].applicant_name; this.FamilyMemberAsLabel[index] = this.selectPerson.filter(item => item.pd_co_applicant_id == val.selected_person)[0].applicant_name;
//for (let val of records) //for (let val of records)
this.getCity(val.residence_state, index); this.getCity(val.residence_state, index);
@ -328,9 +328,9 @@ export class FamilyDetailsComponent implements OnInit {
const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details; const control = <FormArray>this.familyForm.controls['family_details']['controls'][inx].controls.family_members_details;
val.forEach((vals, index) => { val.forEach((vals, index) => {
// for (let vals of val) { // for (let vals of val) {
if (vals.earning_gross_income_per_month != null) { // if (vals.earning_gross_income_per_month != null) {
this.IncomePerMonth[index] = this._pd.convertNumberToWords(vals.earning_gross_income_per_month); // this.IncomePerMonth[index] = this._pd.convertNumberToWords(vals.earning_gross_income_per_month);
} // }
let datas = this.fb.group({ let datas = this.fb.group({
family_member_name: [vals.family_member_name || null, Validators.compose([])], family_member_name: [vals.family_member_name || null, Validators.compose([])],
family_member_relationship: [vals.family_member_relationship || null, Validators.compose([])], family_member_relationship: [vals.family_member_relationship || null, Validators.compose([])],
@ -670,19 +670,4 @@ export class FamilyDetailsComponent implements OnInit {
// }); // });
// } // }
/** To Convert Amount into Words */
inWords(e, flag: number, i) {
switch (flag) {
case 1:
this.RentAmount[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 2:
this.IncomePerMonth[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
}
}
} }

View File

@ -56,10 +56,15 @@
<br> <br>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<input matInput autocomplete="off" placeholder="Annual Sale" <input matInput autocomplete="off" placeholder="Annual Sale"
formControlName="financial_annual_sale" (change)="calculationForFinanicalStatement()"
OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('financial_annual_sale').value != ''">{{"&#8377;"}} {{details.get('financial_annual_sale').value | numberToWords}} Only</mat-hint>
<!-- <input matInput autocomplete="off" placeholder="Annual Sale"
formControlName="financial_annual_sale" (change)="calculationForFinanicalStatement()" formControlName="financial_annual_sale" (change)="calculationForFinanicalStatement()"
OnlyNumber type="text" (keyup)="inWords($event,i,1)"> OnlyNumber type="text" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_annual_sale').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_annual_sale').value != ''">{{"&#8377;"}}
{{FY_annualSalesInwords[i]}} Only</mat-hint> {{FY_annualSalesInwords[i]}} Only</mat-hint> -->
</mat-form-field> </mat-form-field>
<span *ngIf="i != 0"> <span *ngIf="i != 0">
<mat-form-field style="width:60%"> <mat-form-field style="width:60%">
@ -109,10 +114,16 @@
<span *ngIf="details.get('finanical_profit_or_loss').value == 1 "> <span *ngIf="details.get('finanical_profit_or_loss').value == 1 ">
<mat-form-field style="width:28%"> <mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Profit Amount" <input matInput autocomplete="off" placeholder="Net Profit Amount"
formControlName="financial_net_profit" (change)="calculationForFinanicalStatement()"
OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('financial_net_profit').value != ''">{{"&#8377;"}} {{details.get('financial_net_profit').value | numberToWords}} Only</mat-hint>
<!-- <input matInput autocomplete="off" placeholder="Net Profit Amount"
formControlName="financial_net_profit" (change)="calculationForFinanicalStatement()" formControlName="financial_net_profit" (change)="calculationForFinanicalStatement()"
OnlyNumber type="text" (keyup)="inWords($event,i,2)"> OnlyNumber type="text" (keyup)="inWords($event,i,2)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_net_profit').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_net_profit').value != ''">{{"&#8377;"}}
{{FY_netProfitAmtInwords[i]}} Only</mat-hint> {{FY_netProfitAmtInwords[i]}} Only</mat-hint> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width:28%"> <mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Profit to Sales in %" <input matInput autocomplete="off" placeholder="Net Profit to Sales in %"
@ -122,11 +133,17 @@
</span> </span>
<span *ngIf="details.get('finanical_profit_or_loss').value == 2 "> <span *ngIf="details.get('finanical_profit_or_loss').value == 2 ">
<mat-form-field style="width:28%"> <mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Loss Amount"
<input matInput autocomplete="off" placeholder="Net Loss Amount"
formControlName="financial_net_loss" (change)="calculationForFinanicalStatement()"
OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('financial_net_loss').value != ''">{{"&#8377;"}} {{details.get('financial_net_loss').value | numberToWords}} Only</mat-hint>
<!-- <input matInput autocomplete="off" placeholder="Net Loss Amount"
formControlName="financial_net_loss" (change)="calculationForFinanicalStatement()" formControlName="financial_net_loss" (change)="calculationForFinanicalStatement()"
OnlyNumber type="text" (keyup)="inWords($event,i,3)"> OnlyNumber type="text" (keyup)="inWords($event,i,3)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_net_loss').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_net_loss').value != ''">{{"&#8377;"}}
{{FY_netLossAmtInwords[i]}} Only</mat-hint> {{FY_netLossAmtInwords[i]}} Only</mat-hint> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width:28%"> <mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Loss to Sales in %" <input matInput autocomplete="off" placeholder="Net Loss to Sales in %"
@ -239,24 +256,40 @@
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<div style="width:100%"> <div style="width:100%">
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Annual Sales From" <input matInput autocomplete="off" placeholder="Annual Sales From"
formControlName="estimate_sales_from" (change)="calculateSalesAverage(i, details);"
OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('estimate_sales_from').value != ''">{{"&#8377;"}} {{details.get('estimate_sales_from').value | numberToWords}} Only</mat-hint>
<!-- <input matInput autocomplete="off" placeholder="Annual Sales From"
formControlName="estimate_sales_from" (change)="calculateSalesAverage(i, details);" formControlName="estimate_sales_from" (change)="calculateSalesAverage(i, details);"
(keyup)="inWords($event,i,11)"> (keyup)="inWords($event,i,11)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_sales_from').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_sales_from').value != ''">{{"&#8377;"}}
{{AV_SalesFrmInwords[i]}} Only</mat-hint> {{AV_SalesFrmInwords[i]}} Only</mat-hint> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Annual Sales To" <input matInput autocomplete="off" placeholder="Annual Sales To"
formControlName="estimate_sales_to" (change)="confirmAlert(i, details);"
OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('estimate_sales_to').value != ''">{{"&#8377;"}} {{details.get('estimate_sales_to').value | numberToWords}} Only</mat-hint>
<!-- <input matInput autocomplete="off" placeholder="Annual Sales To"
formControlName="estimate_sales_to" (change)="confirmAlert(i, details);" formControlName="estimate_sales_to" (change)="confirmAlert(i, details);"
(keyup)="inWords($event,i,12)"> (keyup)="inWords($event,i,12)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_sales_to').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_sales_to').value != ''">{{"&#8377;"}}
{{AV_SalesToInwords[i]}} Only</mat-hint> {{AV_SalesToInwords[i]}} Only</mat-hint> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Considered Sales Average" <input matInput autocomplete="off" placeholder="Considered Sales Average"
formControlName="estimate_sales_average" readonly>
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('estimate_sales_average').value != ''">{{"&#8377;"}} {{details.get('estimate_sales_average').value | numberToWords}} Only</mat-hint>
<!-- <input matInput autocomplete="off" placeholder="Considered Sales Average"
formControlName="estimate_sales_average" readonly> formControlName="estimate_sales_average" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_sales_average').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_sales_average').value != ''">{{"&#8377;"}}
{{AV_SalesInwords[i]}} Only</mat-hint> {{AV_SalesInwords[i]}} Only</mat-hint> -->
</mat-form-field> </mat-form-field>
</div> </div>
<div style="width:100%"> <div style="width:100%">
@ -293,37 +326,55 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput placeholder="Net Profit Amount Considered" <input matInput placeholder="Net Profit Amount Considered"
formControlName="estimate_profit_margin" readonly>
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('estimate_profit_margin').value != ''">{{"&#8377;"}} {{details.get('estimate_profit_margin').value | numberToWords}} Only</mat-hint>
<!-- <input matInput placeholder="Net Profit Amount Considered"
formControlName="estimate_profit_margin" readonly> formControlName="estimate_profit_margin" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_profit_margin').value != ''"> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_profit_margin').value != ''">
{{"&#8377;"}} {{AV_marginProfitAmtInwords[i]}} Only {{"&#8377;"}} {{AV_marginProfitAmtInwords[i]}} Only
</mat-hint> </mat-hint> -->
</mat-form-field> </mat-form-field>
</div> </div>
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 1 && details.get('estimate_net_margin_availablity').value == 'no' "> <div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 1 && details.get('estimate_net_margin_availablity').value == 'no' ">
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Net Profit Amount From" <input matInput autocomplete="off" placeholder="Net Profit Amount From"
formControlName="estimate_net_profit_from" OnlyNumber type="text"
(change)="calculateProfitAmount(i, details);">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('estimate_net_profit_from').value != ''">{{"&#8377;"}} {{details.get('estimate_net_profit_from').value | numberToWords}} Only</mat-hint>
<!-- <input matInput autocomplete="off" placeholder="Net Profit Amount From"
formControlName="estimate_net_profit_from" OnlyNumber type="text" formControlName="estimate_net_profit_from" OnlyNumber type="text"
(change)="calculateProfitAmount(i, details);" (keyup)="inWords($event,i,7)"> (change)="calculateProfitAmount(i, details);" (keyup)="inWords($event,i,7)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit_from').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit_from').value != ''">{{"&#8377;"}}
{{AV_netProfitAmtFrmInwords[i]}} Only </mat-hint> {{AV_netProfitAmtFrmInwords[i]}} Only </mat-hint> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Net Profit Amount To" <input matInput autocomplete="off" placeholder="Net Profit Amount To"
formControlName="estimate_net_profit_to" OnlyNumber type="text"
(change)="calculateProfitAmount(i, details);">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('estimate_net_profit_to').value != ''">{{"&#8377;"}} {{details.get('estimate_net_profit_to').value | numberToWords}} Only</mat-hint>
<!-- <input matInput autocomplete="off" placeholder="Net Profit Amount To"
formControlName="estimate_net_profit_to" OnlyNumber type="text" formControlName="estimate_net_profit_to" OnlyNumber type="text"
(change)="calculateProfitAmount(i, details);" (keyup)="inWords($event,i,8)"> (change)="calculateProfitAmount(i, details);" (keyup)="inWords($event,i,8)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit_to').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit_to').value != ''">{{"&#8377;"}}
{{AV_netProfitAmtToInwords[i]}} Only </mat-hint> {{AV_netProfitAmtToInwords[i]}} Only </mat-hint> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Considered Net Profit % " <input matInput autocomplete="off" placeholder="Considered Net Profit % "
formControlName="estimate_net_profit_percent" readonly> formControlName="estimate_net_profit_percent" readonly>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Considered Profit Amount" <input matInput placeholder="Considered Profit Amount"
formControlName="estimate_net_profit" readonly>
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('estimate_net_profit').value != ''">{{"&#8377;"}} {{details.get('estimate_net_profit').value | numberToWords}} Only</mat-hint>
<!-- <input matInput autocomplete="off" placeholder="Considered Profit Amount"
formControlName="estimate_net_profit" OnlyNumber type="text" formControlName="estimate_net_profit" OnlyNumber type="text"
readonly> readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit').value != ''">{{"&#8377;"}}
{{AV_netProfitAmtInwords[i]}} Only </mat-hint> {{AV_netProfitAmtInwords[i]}} Only </mat-hint> -->
</mat-form-field> </mat-form-field>
</div> </div>
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2 && details.get('estimate_net_margin_availablity').value == 'yes' "> <div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2 && details.get('estimate_net_margin_availablity').value == 'yes' ">
@ -344,13 +395,22 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput placeholder="Net Loss Amount Considered" <input matInput placeholder="Net Loss Amount Considered"
formControlName="estimate_loss_margin" readonly>
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('estimate_loss_margin').value != ''">{{"&#8377;"}} {{details.get('estimate_loss_margin').value | numberToWords}} Only</mat-hint>
<!-- <input matInput placeholder="Net Loss Amount Considered"
formControlName="estimate_loss_margin" readonly> formControlName="estimate_loss_margin" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_loss_margin').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_loss_margin').value != ''">{{"&#8377;"}}
{{AV_marginLossAmtInwords[i]}} Only </mat-hint> {{AV_marginLossAmtInwords[i]}} Only </mat-hint> -->
</mat-form-field> </mat-form-field>
</div> </div>
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2 && details.get('estimate_net_margin_availablity').value == 'no' "> <div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2 && details.get('estimate_net_margin_availablity').value == 'no' ">
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Net Loss Amount From"
formControlName="estimate_net_loss_from" OnlyNumber type="text"
(change)="calculateLossAmount(i, details);">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('financial_annual_sale').value != ''">{{"&#8377;"}} {{details.get('financial_annual_sale').value | numberToWords}} Only</mat-hint>
<input matInput autocomplete="off" placeholder="Net Loss Amount From" <input matInput autocomplete="off" placeholder="Net Loss Amount From"
formControlName="estimate_net_loss_from" OnlyNumber type="text" formControlName="estimate_net_loss_from" OnlyNumber type="text"
(change)="calculateLossAmount(i, details);" (keyup)="inWords($event,i,9)"> (change)="calculateLossAmount(i, details);" (keyup)="inWords($event,i,9)">
@ -358,11 +418,16 @@
{{AV_netLossAmtFrmInwords[i]}} Only </mat-hint> {{AV_netLossAmtFrmInwords[i]}} Only </mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Net Loss Amount To" <input matInput autocomplete="off" placeholder="Annual Sale"
formControlName="financial_annual_sale" (change)="calculationForFinanicalStatement()"
OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('estimate_net_loss_to').value != ''">{{"&#8377;"}} {{details.get('estimate_net_loss_to').value | numberToWords}} Only</mat-hint>
<!-- <input matInput autocomplete="off" placeholder="Net Loss Amount To"
formControlName="estimate_net_loss_to" OnlyNumber type="text" formControlName="estimate_net_loss_to" OnlyNumber type="text"
(change)="calculateLossAmount(i, details);" (keyup)="inWords($event,i,10)"> (change)="calculateLossAmount(i, details);" (keyup)="inWords($event,i,10)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss_to').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss_to').value != ''">{{"&#8377;"}}
{{AV_netLossAmtToInwords[i]}} Only </mat-hint> {{AV_netLossAmtToInwords[i]}} Only </mat-hint> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Considered Net Loss %" <input matInput autocomplete="off" placeholder="Considered Net Loss %"
@ -370,9 +435,13 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width:25%"> <mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Considered Loss Amount" <input matInput autocomplete="off" placeholder="Considered Loss Amount"
formControlName="estimate_net_loss" OnlyNumber type="text">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('estimate_net_loss').value != ''">{{"&#8377;"}} {{details.get('estimate_net_loss').value | numberToWords}} Only</mat-hint>
<!-- <input matInput autocomplete="off" placeholder="Considered Loss Amount"
formControlName="estimate_net_loss" OnlyNumber type="text" readonly> formControlName="estimate_net_loss" OnlyNumber type="text" readonly>
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss').value != ''">{{"&#8377;"}}
{{AV_netLossAmtInwords[i]}} Only</mat-hint> {{AV_netLossAmtInwords[i]}} Only</mat-hint> -->
</mat-form-field> </mat-form-field>
</div> </div>
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2"> <div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2">

View File

@ -47,26 +47,26 @@ export class FinancialInfoComponent implements OnInit {
customerCommentsFlag :boolean; customerCommentsFlag :boolean;
//Array for Amount Inwords //Array for Amount Inwords
FY_annualSalesInwords : any = []; // FY_annualSalesInwords : any = [];
FY_netProfitAmtInwords : any = []; // FY_netProfitAmtInwords : any = [];
FY_netLossAmtInwords : any = []; // FY_netLossAmtInwords : any = [];
AV_SalesInwords : any = []; // AV_SalesInwords : any = [];
AV_annualSalesInwords : any = []; // AV_annualSalesInwords : any = [];
AV_marginProfitAmtInwords : any = []; // AV_marginProfitAmtInwords : any = [];
AV_netProfitAmtInwords : any = []; // AV_netProfitAmtInwords : any = [];
AV_marginLossAmtInwords : any = []; // AV_marginLossAmtInwords : any = [];
AV_netLossAmtInwords : any = []; // AV_netLossAmtInwords : any = [];
//isreadonly for edit(no of year Fields and Starting Years ) //isreadonly for edit(no of year Fields and Starting Years )
isReadOnly : boolean = false; isReadOnly : boolean = false;
EditAble: boolean = true; EditAble: boolean = true;
isDisplay : boolean ; isDisplay : boolean ;
AV_netProfitAmtFrmInwords: any = []; // AV_netProfitAmtFrmInwords: any = [];
AV_netProfitAmtToInwords: any = []; // AV_netProfitAmtToInwords: any = [];
AV_netLossAmtFrmInwords: any = []; // AV_netLossAmtFrmInwords: any = [];
AV_netLossAmtToInwords: any = []; // AV_netLossAmtToInwords: any = [];
AV_SalesFrmInwords: any = []; // AV_SalesFrmInwords: any = [];
AV_SalesToInwords: any = []; // AV_SalesToInwords: any = [];
av : any =[{id:6, name:'Letter of Credit'}, av : any =[{id:6, name:'Letter of Credit'},
{id:2, name:'Bank Guarantee'}, {id:2, name:'Bank Guarantee'},
{id:3, name:'Cash Credit Limit'}, {id:3, name:'Cash Credit Limit'},
@ -145,9 +145,9 @@ export class FinancialInfoComponent implements OnInit {
this.customerCommentsFlag = result.length == 1 ? false : true; this.customerCommentsFlag = result.length == 1 ? false : true;
result.forEach((val,index) => { result.forEach((val,index) => {
//financial_date.push(this.createDate()); //financial_date.push(this.createDate());
this.FY_annualSalesInwords[index] = this._pd.convertNumberToWords(val.financial_annual_sale); // this.FY_annualSalesInwords[index] = this._pd.convertNumberToWords(val.financial_annual_sale);
this.FY_netProfitAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_profit); // this.FY_netProfitAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_profit);
this.FY_netLossAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_loss); // this.FY_netLossAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_loss);
financial_date.push(this.createDate('')); financial_date.push(this.createDate(''));
}); });
retriveData.date_per_financial = result; retriveData.date_per_financial = result;
@ -166,17 +166,17 @@ export class FinancialInfoComponent implements OnInit {
if (result_val.length > 0) { if (result_val.length > 0) {
result_val.forEach((val,index) => { result_val.forEach((val,index) => {
this.AV_SalesInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_average)); // this.AV_SalesInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_average));
this.AV_SalesFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_from)); // this.AV_SalesFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_from));
this.AV_SalesToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_to)); // this.AV_SalesToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_to));
this.AV_marginProfitAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); // this.AV_marginProfitAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netProfitAmtFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); // this.AV_netProfitAmtFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netProfitAmtToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); // this.AV_netProfitAmtToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netProfitAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_net_profit)); // this.AV_netProfitAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_net_profit));
this.AV_marginLossAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_loss_margin)); // this.AV_marginLossAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_loss_margin));
this.AV_netLossAmtFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); // this.AV_netLossAmtFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netLossAmtToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin)); // this.AV_netLossAmtToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netLossAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_net_loss)); // this.AV_netLossAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_net_loss));
estimated_val.push(this.createValue('')); estimated_val.push(this.createValue(''));
}); });
retriveData.estimated_value = result_val; retriveData.estimated_value = result_val;
@ -1091,11 +1091,11 @@ export class FinancialInfoComponent implements OnInit {
if(lower > higer){ if(lower > higer){
details.controls.estimate_sales_average.setValue(higer!= Infinity ? higer.toFixed(2):0); details.controls.estimate_sales_average.setValue(higer!= Infinity ? higer.toFixed(2):0);
this.AV_SalesInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); // this.AV_SalesInwords[i] = this._pd.convertNumberToWords(Math.round(higer));
} }
else{ else{
details.controls.estimate_sales_average.setValue(lower!= Infinity ? lower.toFixed(2):0); details.controls.estimate_sales_average.setValue(lower!= Infinity ? lower.toFixed(2):0);
this.AV_SalesInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); // this.AV_SalesInwords[i] = this._pd.convertNumberToWords(Math.round(lower));
} }
} }
@ -1162,7 +1162,7 @@ export class FinancialInfoComponent implements OnInit {
if (r == true) { if (r == true) {
details.controls.estimate_profit_margin.setValue(Profit_Average!= Infinity ? Math.round(Profit_Average):0); details.controls.estimate_profit_margin.setValue(Profit_Average!= Infinity ? Math.round(Profit_Average):0);
details.controls.estimate_profit_margin_percent.setValue(consi_profit_percent.toFixed(2)); details.controls.estimate_profit_margin_percent.setValue(consi_profit_percent.toFixed(2));
this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average)); // this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average));
}else{ }else{
details.controls.estimate_profit_range_to.setValue(''); details.controls.estimate_profit_range_to.setValue('');
details.controls.estimate_profit_margin.setValue(''); details.controls.estimate_profit_margin.setValue('');
@ -1173,7 +1173,7 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_profit_margin.setValue(Profit_Average!= Infinity ? Math.round(Profit_Average):0); details.controls.estimate_profit_margin.setValue(Profit_Average!= Infinity ? Math.round(Profit_Average):0);
details.controls.estimate_profit_margin_percent.setValue(consi_profit_percent.toFixed(2)); details.controls.estimate_profit_margin_percent.setValue(consi_profit_percent.toFixed(2));
this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average)); // this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average));
// details.controls.estimate_profit_margin.setValue(Math.round(Profit_Average)); // details.controls.estimate_profit_margin.setValue(Math.round(Profit_Average));
// details.controls.estimate_profit_margin_percent.setValue(profit_percent.toFixed(2)); // details.controls.estimate_profit_margin_percent.setValue(profit_percent.toFixed(2));
@ -1246,13 +1246,13 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0); details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0);
let Profit_percent = (higer/+sales_average)*100; let Profit_percent = (higer/+sales_average)*100;
details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0);
this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer));
} }
else{ else{
details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0); details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0);
let Profit_percent = (lower/+sales_average)*100; let Profit_percent = (lower/+sales_average)*100;
details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0);
this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower));
} }
} }
else if(estimate_net_profit_from > 5000000 || estimate_net_profit_from <= 10000000){ else if(estimate_net_profit_from > 5000000 || estimate_net_profit_from <= 10000000){
@ -1276,13 +1276,13 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0); details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0);
let Profit_percent = (higer/+sales_average)*100; let Profit_percent = (higer/+sales_average)*100;
details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0);
this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer));
} }
else{ else{
details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0); details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0);
let Profit_percent = (lower/+sales_average)*100; let Profit_percent = (lower/+sales_average)*100;
details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0);
this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower));
} }
} }
@ -1306,13 +1306,13 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0); details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0);
let Profit_percent = (higer/sales_average)*100; let Profit_percent = (higer/sales_average)*100;
details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0);
this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer));
} }
else{ else{
details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0); details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0);
let Profit_percent = (lower/sales_average)*100; let Profit_percent = (lower/sales_average)*100;
details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0);
this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower));
} }
} }
else{ else{
@ -1321,13 +1321,13 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0); details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0);
let Profit_percent = (higer/sales_average)*100; let Profit_percent = (higer/sales_average)*100;
details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0);
this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer));
} }
else{ else{
details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0); details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0);
let Profit_percent = (lower/sales_average)*100; let Profit_percent = (lower/sales_average)*100;
details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0);
this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower));
} }
} }
@ -1395,7 +1395,7 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_loss_margin.setValue(loss_Average!= Infinity ? Math.round(loss_Average):0); details.controls.estimate_loss_margin.setValue(loss_Average!= Infinity ? Math.round(loss_Average):0);
details.controls.estimate_loss_margin_percent.setValue(consi_loss_percent.toFixed(2)); details.controls.estimate_loss_margin_percent.setValue(consi_loss_percent.toFixed(2));
this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average)); // this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average));
}else{ }else{
details.controls.estimate_loss_range_to.setValue(''); details.controls.estimate_loss_range_to.setValue('');
details.controls.estimate_loss_margin.setValue(''); details.controls.estimate_loss_margin.setValue('');
@ -1406,7 +1406,7 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_loss_margin.setValue(loss_Average!= Infinity ? Math.round(loss_Average):0); details.controls.estimate_loss_margin.setValue(loss_Average!= Infinity ? Math.round(loss_Average):0);
details.controls.estimate_loss_margin_percent.setValue(+consi_loss_percent.toFixed(2)); details.controls.estimate_loss_margin_percent.setValue(+consi_loss_percent.toFixed(2));
this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average)); // this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average));
} }
} }
@ -1487,13 +1487,13 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0); details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0);
let loss_percent = (higer/+sales_average)*100; let loss_percent = (higer/+sales_average)*100;
details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0);
this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer));
} }
else{ else{
details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0); details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0);
let loss_percent = (lower/+sales_average)*100; let loss_percent = (lower/+sales_average)*100;
details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0);
this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower));
} }
} }
@ -1517,13 +1517,13 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0); details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0);
let loss_percent = (+higer/+sales_average)*100; let loss_percent = (+higer/+sales_average)*100;
details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0);
this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer));
} }
else{ else{
details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0); details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0);
let loss_percent = (+lower/+sales_average)*100; let loss_percent = (+lower/+sales_average)*100;
details.controls.estimate_net_profit_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); details.controls.estimate_net_profit_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0);
this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower));
} }
} }
else if(estimate_net_loss_from > 10000000){ else if(estimate_net_loss_from > 10000000){
@ -1546,13 +1546,13 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0); details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0);
let loss_percent = (higer/+sales_average)*100; let loss_percent = (higer/+sales_average)*100;
details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0);
this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer));
} }
else{ else{
details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0); details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0);
let loss_percent = (+lower/+sales_average)*100; let loss_percent = (+lower/+sales_average)*100;
details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0);
this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower));
} }
} }
@ -1562,13 +1562,13 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0); details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0);
let loss_percent = (+higer/+sales_average)*100; let loss_percent = (+higer/+sales_average)*100;
details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0);
this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer));
} }
else{ else{
details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0); details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0);
let loss_percent = (+lower/+sales_average)*100; let loss_percent = (+lower/+sales_average)*100;
details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0);
this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower));
} }
} }
@ -1702,51 +1702,51 @@ export class FinancialInfoComponent implements OnInit {
} }
/** To Convert Amount into Words */ /** To Convert Amount into Words */
inWords(e,i,flag:number){ // inWords(e,i,flag:number){
switch(flag){ // switch(flag){
case 1 : // case 1 :
this.FY_annualSalesInwords[i] = this._pd.convertNumberToWords(e.target.value); // this.FY_annualSalesInwords[i] = this._pd.convertNumberToWords(e.target.value);
// this.placeholderName[i] = 'Weekly Instalment Amount'; break; // // this.placeholderName[i] = 'Weekly Instalment Amount'; break;
break; // break;
case 2 : // case 2 :
this.FY_netProfitAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); // this.FY_netProfitAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
//alert('Fin net Profit'+this.FY_netProfitAmtInwords[i]); // //alert('Fin net Profit'+this.FY_netProfitAmtInwords[i]);
break; // break;
case 3 : // case 3 :
this.FY_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); // this.FY_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
// alert('Fin net Loss'+this.FY_netLossAmtInwords[i]); // // alert('Fin net Loss'+this.FY_netLossAmtInwords[i]);
break; // break;
case 4 : // case 4 :
this.AV_annualSalesInwords[i] = this._pd.convertNumberToWords(e.target.value); // this.AV_annualSalesInwords[i] = this._pd.convertNumberToWords(e.target.value);
break; // break;
case 5 : // case 5 :
this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break; // break;
case 6 : // case 6 :
this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value); // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break; // break;
case 7 : // case 7 :
this.AV_netProfitAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value); // this.AV_netProfitAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value);
break; // break;
case 8 : // case 8 :
this.AV_netProfitAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value); // this.AV_netProfitAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value);
break; // break;
case 9 : // case 9 :
this.AV_netLossAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value); // this.AV_netLossAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value);
break; // break;
case 10 : // case 10 :
this.AV_netLossAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value); // this.AV_netLossAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value);
break; // break;
case 11 : // case 11 :
this.AV_SalesFrmInwords[i] = this._pd.convertNumberToWords(e.target.value); // this.AV_SalesFrmInwords[i] = this._pd.convertNumberToWords(e.target.value);
break; // break;
case 12 : // case 12 :
this.AV_SalesToInwords[i] = this._pd.convertNumberToWords(e.target.value); // this.AV_SalesToInwords[i] = this._pd.convertNumberToWords(e.target.value);
break; // break;
default: // default:
break; // break;
} // }
} // }
} }

View File

@ -24,10 +24,12 @@
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-form-field style="width: 64%"> <mat-form-field style="width: 64%">
<input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount" <input matInput placeholder="Loan Amount Applied for ? " formControlName="loan_amount"
OnlyNumber type="text" (keyup)="inWords($event,1)" (change)="loanCalc()" OnlyNumber type="text" (change)="loanCalc()"
autocomplete="off"> autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}}
{{loanAmtInWords}} Only</mat-hint> <mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} {{ loanDetailsForm.controls['loan_amount'].value | numberToWords }} Only</mat-hint>
<!-- <mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}}
{{loanAmtInWords}} Only</mat-hint> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 28%"> <mat-form-field style="width: 28%">
<mat-label>Loan Tenure applied for?</mat-label> <mat-label>Loan Tenure applied for?</mat-label>
@ -68,9 +70,9 @@
<mat-form-field style="width: 64%"> <mat-form-field style="width: 64%">
<input matInput placeholder="What is the amount for Balance Transfer ? " <input matInput placeholder="What is the amount for Balance Transfer ? "
OnlyNumber type="text" formControlName="balance_transfer_amount" OnlyNumber type="text" formControlName="balance_transfer_amount"
(keyup)="inWords($event,2)" (change)="loanCalc()" autocomplete="off"> (change)="loanCalc()" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['loan_amount'].value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['balance_transfer_amount'].value != ''">{{"&#8377;"}} {{ loanDetailsForm.controls['balance_transfer_amount'].value | numberToWords }} Only</mat-hint>
{{balTxrfAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 64%"> <mat-form-field style="width: 64%">
@ -89,10 +91,9 @@
<mat-form-field style="width: 64%"> <mat-form-field style="width: 64%">
<input matInput placeholder="Top Up Amount" OnlyNumber type="text" <input matInput placeholder="Top Up Amount" OnlyNumber type="text"
formControlName="topup_amount" (keyup)="inWords($event,5)" formControlName="topup_amount"
autocomplete="off"> autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['topup_amount'].value != ''">{{"&#8377;"}} {{ loanDetailsForm.controls['topup_amount'].value | numberToWords }} Only</mat-hint>
{{topUpAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
@ -114,10 +115,10 @@
<mat-form-field style="width: 64%"> <mat-form-field style="width: 64%">
<input matInput placeholder="Amount of Own Contribution" <input matInput placeholder="Amount of Own Contribution"
formControlName="own_contribution" OnlyNumber type="text" (keyup)="inWords($event,4)" formControlName="own_contribution" OnlyNumber type="text"
autocomplete="off"> autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['own_contribution'].value != ''">{{"&#8377;"}} {{ loanDetailsForm.controls['own_contribution'].value | numberToWords }} Only</mat-hint>
{{ownContributionInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 28%"> <mat-form-field style="width: 28%">
@ -142,9 +143,8 @@
<mat-form-field style="width: 64%"> <mat-form-field style="width: 64%">
<input matInput placeholder="EMI Amount Comfortable Paying" formControlName="emi_level" <input matInput placeholder="EMI Amount Comfortable Paying" formControlName="emi_level"
OnlyNumber type="text" (keyup)="inWords($event,6)" autocomplete="off"> OnlyNumber type="text" autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['emi_level'].value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['emi_level'].value != ''">{{"&#8377;"}} {{ loanDetailsForm.controls['emi_level'].value | numberToWords }} Only</mat-hint>
{{emiAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
@ -212,10 +212,9 @@
<mat-form-field style="width:46%"> <mat-form-field style="width:46%">
<input matInput placeholder="Estimate Market Value as Per Customer" <input matInput placeholder="Estimate Market Value as Per Customer"
formControlName="emv_per_customer" OnlyNumber type="text" (keyup)="inWords($event,7)" formControlName="emv_per_customer" OnlyNumber type="text"
autocomplete="off"> autocomplete="off">
<mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['emv_per_customer'].value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="loanDetailsForm.controls['emv_per_customer'].value != ''">{{"&#8377;"}} {{ loanDetailsForm.controls['emv_per_customer'].value | numberToWords }} Only</mat-hint>
{{emvAmtInWords}} Only</mat-hint>
</mat-form-field> </mat-form-field>
</mat-card-content> </mat-card-content>

View File

@ -76,13 +76,7 @@ export class LoanDetailsComponent implements OnInit {
companies: any = []; companies: any = [];
/* Declaration of Variables For Amount IN words */ /* Declaration of Variables For Amount IN words */
loanAmtInWords: any; z
balTxrfAmtInWords: any;
valAsPerAgmtInWords: any;
ownContributionInWords: any;
topUpAmtInWords: any;
emiAmtInWords: any;
emvAmtInWords: any;
/** Constructor Of the Class */ /** Constructor Of the Class */
@ -102,7 +96,7 @@ export class LoanDetailsComponent implements OnInit {
this.productID = this.pd_all_details.pdmaster_details.fk_product_id; this.productID = this.pd_all_details.pdmaster_details.fk_product_id;
this.subProductName = this.pd_all_details.pdmaster_details.subproduct_name; this.subProductName = this.pd_all_details.pdmaster_details.subproduct_name;
this.exist_loan_amt = this.pd_all_details.pdmaster_details.loan_amount != '' ? this.pd_all_details.pdmaster_details.loan_amount : ''; this.exist_loan_amt = this.pd_all_details.pdmaster_details.loan_amount != '' ? this.pd_all_details.pdmaster_details.loan_amount : '';
this.loanAmtInWords = this._pd.convertNumberToWords(this.exist_loan_amt); // this.loanAmtInWords = this._pd.convertNumberToWords(this.exist_loan_amt);
this.form_id = 10; this.form_id = 10;
this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.notifier = notifier; this.notifier = notifier;
@ -192,7 +186,7 @@ export class LoanDetailsComponent implements OnInit {
this.loanDetailsForm.controls['loan_amount'].setValue(value.records.loan_amount); this.loanDetailsForm.controls['loan_amount'].setValue(value.records.loan_amount);
if (value.records.loan_amount) { this.loanAmtInWords = this._pd.convertNumberToWords(value.records.loan_amount); } // if (value.records.loan_amount) { this.loanAmtInWords = this._pd.convertNumberToWords(value.records.loan_amount); }
this.loanDetailsForm.controls['loan_tenure'].setValue(value.records.loan_tenure); this.loanDetailsForm.controls['loan_tenure'].setValue(value.records.loan_tenure);
this.loanDetailsForm.controls['sub_product'].setValue(value.records.sub_product || null); this.loanDetailsForm.controls['sub_product'].setValue(value.records.sub_product || null);
@ -204,11 +198,11 @@ export class LoanDetailsComponent implements OnInit {
if (value.records.balance_transfer_amount) { if (value.records.balance_transfer_amount) {
this.loanDetailsForm.controls['balance_transfer_amount'].setValue(value.records.balance_transfer_amount); this.loanDetailsForm.controls['balance_transfer_amount'].setValue(value.records.balance_transfer_amount);
this.balTxrfAmtInWords = this._pd.convertNumberToWords(value.records.balance_transfer_amount); // this.balTxrfAmtInWords = this._pd.convertNumberToWords(value.records.balance_transfer_amount);
} }
if (value.records.topup_amount) { if (value.records.topup_amount) {
this.loanDetailsForm.controls['topup_amount'].setValue(value.records.topup_amount); this.loanDetailsForm.controls['topup_amount'].setValue(value.records.topup_amount);
this.topUpAmtInWords = this._pd.convertNumberToWords(value.records.topup_amount); // this.topUpAmtInWords = this._pd.convertNumberToWords(value.records.topup_amount);
if (value.records.topup_amount > 0) { if (value.records.topup_amount > 0) {
this.loanDetailsForm.controls['end_use_topup'].setValue(value.records.end_use_topup); this.loanDetailsForm.controls['end_use_topup'].setValue(value.records.end_use_topup);
if (value.records.end_use_topup == 1) { if (value.records.end_use_topup == 1) {
@ -243,7 +237,7 @@ export class LoanDetailsComponent implements OnInit {
}); });
this.loanDetailsForm.controls['own_contribution'].setValue(value.records.own_contribution); this.loanDetailsForm.controls['own_contribution'].setValue(value.records.own_contribution);
if (value.records.own_contribution) { this.ownContributionInWords = this._pd.convertNumberToWords(value.records.own_contribution); } // if (value.records.own_contribution) { this.ownContributionInWords = this._pd.convertNumberToWords(value.records.own_contribution); }
this.loanDetailsForm.controls['source'].setValue(dbsourcelist); this.loanDetailsForm.controls['source'].setValue(dbsourcelist);
this.sourceChange(dbsourcelist); this.sourceChange(dbsourcelist);
@ -257,7 +251,7 @@ export class LoanDetailsComponent implements OnInit {
if (value.records.emi_level) { if (value.records.emi_level) {
this.loanDetailsForm.controls['emi_level'].setValue(value.records.emi_level); this.loanDetailsForm.controls['emi_level'].setValue(value.records.emi_level);
this.emiAmtInWords = this._pd.convertNumberToWords(value.records.emi_level); // this.emiAmtInWords = this._pd.convertNumberToWords(value.records.emi_level);
} }
this.loanDetailsForm.controls['property_type'].setValue(value.records.property_type); this.loanDetailsForm.controls['property_type'].setValue(value.records.property_type);
@ -275,7 +269,7 @@ export class LoanDetailsComponent implements OnInit {
if (value.records.emv_per_customer != '') { if (value.records.emv_per_customer != '') {
this.loanDetailsForm.controls['emv_per_customer'].setValue(value.records.emv_per_customer); this.loanDetailsForm.controls['emv_per_customer'].setValue(value.records.emv_per_customer);
this.emvAmtInWords = this._pd.convertNumberToWords(value.records.emv_per_customer); // this.emvAmtInWords = this._pd.convertNumberToWords(value.records.emv_per_customer);
} }
} }
@ -541,25 +535,25 @@ export class LoanDetailsComponent implements OnInit {
inWords(e, flag: number) { inWords(e, flag: number) {
switch (flag) { switch (flag) {
case 1: case 1:
this.loanAmtInWords = this._pd.convertNumberToWords(e.target.value); // this.loanAmtInWords = this._pd.convertNumberToWords(e.target.value);
break; break;
case 2: case 2:
this.balTxrfAmtInWords = this._pd.convertNumberToWords(e.target.value); // this.balTxrfAmtInWords = this._pd.convertNumberToWords(e.target.value);
break; break;
case 3: case 3:
this.valAsPerAgmtInWords = this._pd.convertNumberToWords(e.target.value); // this.valAsPerAgmtInWords = this._pd.convertNumberToWords(e.target.value);
break; break;
case 4: case 4:
this.ownContributionInWords = this._pd.convertNumberToWords(e.target.value); // this.ownContributionInWords = this._pd.convertNumberToWords(e.target.value);
break; break;
case 5: case 5:
this.topUpAmtInWords = this._pd.convertNumberToWords(e.target.value); // this.topUpAmtInWords = this._pd.convertNumberToWords(e.target.value);
break; break;
case 6: case 6:
this.emiAmtInWords = this._pd.convertNumberToWords(e.target.value); // this.emiAmtInWords = this._pd.convertNumberToWords(e.target.value);
break; break;
case 7: case 7:
this.emvAmtInWords = this._pd.convertNumberToWords(e.target.value); // this.emvAmtInWords = this._pd.convertNumberToWords(e.target.value);
break; break;
default: default:
break; break;
@ -593,14 +587,14 @@ export class LoanDetailsComponent implements OnInit {
if (loanAmount >= BtAmount) { if (loanAmount >= BtAmount) {
topupAmt = loanAmount - BtAmount; topupAmt = loanAmount - BtAmount;
this.loanDetailsForm.controls['topup_amount'].setValue(topupAmt); this.loanDetailsForm.controls['topup_amount'].setValue(topupAmt);
this.topUpAmtInWords = this._pd.convertNumberToWords(topupAmt); // this.topUpAmtInWords = this._pd.convertNumberToWords(topupAmt);
} }
else { else {
this.notifier.notify('warning', 'Balances Transfer Amount is greater than Loan Amount Please check.!'); this.notifier.notify('warning', 'Balances Transfer Amount is greater than Loan Amount Please check.!');
this.loanDetailsForm.controls['balance_transfer_amount'].setValue(''); this.loanDetailsForm.controls['balance_transfer_amount'].setValue('');
this.balTxrfAmtInWords = ''; // this.balTxrfAmtInWords = '';
this.loanDetailsForm.controls['topup_amount'].setValue(''); this.loanDetailsForm.controls['topup_amount'].setValue('');
this.topUpAmtInWords = ''; // this.topUpAmtInWords = '';
} }
} }
} }

View File

@ -168,9 +168,8 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 28%"> <mat-form-field style="width: 28%">
<input matInput autocomplete="off" [placeholder]="reference.controls.relationship_with.value ==4 ? 'Rent Amount' : 'Volume of Business'" <input matInput autocomplete="off" [placeholder]="reference.controls.relationship_with.value ==4 ? 'Rent Amount' : 'Volume of Business'"
formControlName="business_volume_amount" type="text" OnlyNumber type="text" (keyup)="inWords($event.target.value,r)"> formControlName="business_volume_amount" type="text" OnlyNumber type="text">
<mat-hint align="start" style="font-size:70%" *ngIf="reference.controls.business_volume_amount.value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="reference.controls.business_volume_amount.value != ''">{{"&#8377;"}} {{ reference.controls.business_volume_amount.value | numberToWords}} Only</mat-hint>
{{amtInwords[r]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 22%"> <mat-form-field style="width: 22%">
<mat-select placeholder="Unit" formControlName="business_volume_unit"> <mat-select placeholder="Unit" formControlName="business_volume_unit">

View File

@ -38,7 +38,7 @@ export class NeighbourHoodComponent implements OnInit {
existCompanyList: any =[]; existCompanyList: any =[];
mergeCompanyApplicant: any=[]; mergeCompanyApplicant: any=[];
isOrganisationOwner: any=[]; isOrganisationOwner: any=[];
amtInwords : any = []; // amtInwords : any = [];
// isOtherApplicant: any = []; // isOtherApplicant: any = [];
constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef<NeighbourHoodComponent>) { constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef<NeighbourHoodComponent>) {
@ -148,7 +148,7 @@ export class NeighbourHoodComponent implements OnInit {
if(exist_ref_details.length>0){ /**&& data.records.check_type==1 */ if(exist_ref_details.length>0){ /**&& data.records.check_type==1 */
exist_ref_details.forEach((element,index) => { exist_ref_details.forEach((element,index) => {
if(element.business_volume_amount != null){ if(element.business_volume_amount != null){
this.inWords(element.business_volume_amount,index); // this.inWords(element.business_volume_amount,index);
} }
// this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount); // this.amtInwords[index] = this._pd.convertNumberToWords(element.business_volume_amount);
referencecheckControl.push(this.createReerenceCheck(element)); referencecheckControl.push(this.createReerenceCheck(element));
@ -477,9 +477,9 @@ checkOthers(values){
// } // }
/** Amount InWords */ /** Amount InWords */
inWords(e,i){ // inWords(e,i){
this.amtInwords[i] = this._pd.convertNumberToWords(e); // this.amtInwords[i] = this._pd.convertNumberToWords(e);
} // }
compareObjects(o1: any, o2: any) { compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id) if(o1.id == o2.id && o1.group_id == o2.group_id)

View File

@ -97,8 +97,7 @@
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">
<input matInput autocomplete="off" placeholder="Amount" formControlName="amount" <input matInput autocomplete="off" placeholder="Amount" formControlName="amount"
OnlyNumber type="text" (keyup)="inWords($event,i)"> OnlyNumber type="text" (keyup)="inWords($event,i)">
<mat-hint align="start" style="font-size:90%" *ngIf="details.get('amount').value != ''">{{"&#8377;"}} <mat-hint align="start" style="font-size:90%" *ngIf="details.get('amount').value != ''">{{"&#8377;"}} {{ details.get('amount').value | numberToWords}} Only</mat-hint>
{{amtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:45%"> <mat-form-field style="width:45%">

View File

@ -50,7 +50,7 @@ export class OtherIncomeComponent implements OnInit {
private notifier: NotifierService; private notifier: NotifierService;
frequencyData: any = []; frequencyData: any = [];
sourceData: any = []; sourceData: any = [];
amtInwords: any = [];
applicants: any = []; applicants: any = [];
incomeEarnedBy: any = []; incomeEarnedBy: any = [];
existCompanyList: any = []; existCompanyList: any = [];
@ -150,7 +150,7 @@ export class OtherIncomeComponent implements OnInit {
}); });
if (result.length > 0) { if (result.length > 0) {
result.forEach((val, index) => { result.forEach((val, index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(val.amount);
// this.getOtherIncomeEarnedBy(val.income_earned_by,index); // this.getOtherIncomeEarnedBy(val.income_earned_by,index);
control.push(this.createDetail()); control.push(this.createDetail());
this.getOtherIncomeEarnedBy(val.income_earned_by, index); this.getOtherIncomeEarnedBy(val.income_earned_by, index);
@ -275,10 +275,6 @@ export class OtherIncomeComponent implements OnInit {
}); });
} }
/** Amount InWords */
inWords(e, i) {
this.amtInwords[i] = this._pd.convertNumberToWords(e.target.value);
}
Toview() { Toview() {
// alert('Rental Info '); // alert('Rental Info ');

View File

@ -755,8 +755,6 @@ export class StockComponent implements OnInit {
checkComments(value, flag, index) { checkComments(value, flag, index) {
if (flag == 1) { if (flag == 1) {
this.ManufacturingCounterArray[index] = value == "yes" ? 1 : 0; this.ManufacturingCounterArray[index] = value == "yes" ? 1 : 0;
this.not_stock_of_rm[index] = value == "stock not required to be maintained" ? 1 : 0; this.not_stock_of_rm[index] = value == "stock not required to be maintained" ? 1 : 0;

View File

@ -4,68 +4,130 @@ import { Pipe, PipeTransform } from '@angular/core';
name: 'numberToWords' name: 'numberToWords'
}) })
export class NumberToWordsPipe implements PipeTransform { export class NumberToWordsPipe implements PipeTransform {
transform(amount: any): any{
var sglDigit = ["Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"],
dblDigit = ["Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"],
tensPlace = ["", "Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"],
transform(amount: any): any { handle_tens = function(dgt, prevDgt) {
let words: any = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen', 'Twenty']; return 0 == dgt ? "" : " " + (1 == dgt ? dblDigit[prevDgt] : tensPlace[dgt])
words[30] = 'Thirty'; },
words[40] = 'Forty'; handle_utlc = function(dgt, nxtDgt, denom) {
words[50] = 'Fifty'; return (0 != dgt && 1 != nxtDgt ? " " + sglDigit[dgt] : "") + (0 != nxtDgt || dgt > 0 ? " " + denom : "")
words[60] = 'Sixty'; };
words[70] = 'Seventy';
words[80] = 'Eighty'; var str = "",
words[90] = 'Ninety'; digitIdx = 0,
amount = amount.toString(); digit = 0,
let atemp = amount.split("."); nxtDigit = 0,
let number = atemp[0].split(",").join(""); words = [];
let n_length = number.length; if (amount += "", isNaN(parseInt(amount))) str = "";
let words_string = ""; else if (parseInt(amount) > 0 && amount.length <= 10) {
let value: any; for (digitIdx = amount.length - 1; digitIdx >= 0; digitIdx--)
if (n_length <= 9) { switch (digit = amount[digitIdx] - 0, nxtDigit = digitIdx > 0 ? amount[digitIdx - 1] - 0 : 0, amount.length - digitIdx - 1) {
var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0); case 0:
var received_n_array = new Array(); words.push(handle_utlc(digit, nxtDigit, ""));
for (var i = 0; i < n_length; i++) { break;
received_n_array[i] = number.substr(i, 1); case 1:
} words.push(handle_tens(digit, amount[digitIdx + 1]));
for (var i = 9 - n_length, j = 0; i < 9; i++ , j++) { break;
n_array[i] = received_n_array[j]; case 2:
} words.push(0 != digit ? " " + sglDigit[digit] + " Hundred" + (0 != amount[digitIdx + 1] && 0 != amount[digitIdx + 2] ? " and" : "") : "");
for (var i = 0, j = 1; i < 9; i++ , j++) { break;
if (i == 0 || i == 2 || i == 4 || i == 7) { case 3:
if (n_array[i] == 1) { words.push(handle_utlc(digit, nxtDigit, "Thousand"));
n_array[j] = 10 + (+n_array[j]); break;
n_array[i] = 0; case 4:
} words.push(handle_tens(digit, amount[digitIdx + 1]));
} break;
} case 5:
value = ""; words.push(handle_utlc(digit, nxtDigit, "Lakh"));
for (var i = 0; i < 9; i++) { break;
if (i == 0 || i == 2 || i == 4 || i == 7) { case 6:
value = n_array[i] * 10; words.push(handle_tens(digit, amount[digitIdx + 1]));
} else { break;
value = n_array[i]; case 7:
} words.push(handle_utlc(digit, nxtDigit, "Crore"));
if (value != 0) { break;
words_string += words[value] + " "; case 8:
} words.push(handle_tens(digit, amount[digitIdx + 1]));
if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) { break;
words_string += "Crores, "; case 9:
} words.push(0 != digit ? " " + sglDigit[digit] + " Hundred" + (0 != amount[digitIdx + 1] || 0 != amount[digitIdx + 2] ? " and" : " Crore") : "")
if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) { // break;
words_string += "Lakhs, "; // case 10:
} // words.push(0 != digit ? " " + sglDigit[digit] + " Lakh" + (0 != price[digitIdx + 1] || 0 != price[digitIdx + 2] ? " and" : " Hundred" + (0 != price[digitIdx + 1] || 0 != price[digitIdx + 2] || 0 != price[digitIdx + 3] ? " and" : " Crore"))
if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) { // : "")
words_string += "Thousand, "; // break;
} }
if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) { str = words.reverse().join("")
words_string += "Hundred and "; } else str = "";
} else if (i == 6 && value != 0) { return str
words_string += "Hundred ";
} }
}
words_string = words_string.split(" ").join(" "); //References
words_string=(words_string.length > 2 && words_string.charAt(words_string.length-2)==',') ? words_string.slice(0, -2) : words_string; // transform(amount: any): any {
} // let words: any = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen', 'Twenty'];
return words_string; // words[30] = 'Thirty';
} // words[40] = 'Forty';
// words[50] = 'Fifty';
// words[60] = 'Sixty';
// words[70] = 'Seventy';
// words[80] = 'Eighty';
// words[90] = 'Ninety';
// amount = amount.toString();
// let atemp = amount.split(".");
// let number = atemp[0].split(",").join("");
// let n_length = number.length;
// let words_string = "";
// let value: any;
// if (n_length <= 9) {
// var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0);
// var received_n_array = new Array();
// for (var i = 0; i < n_length; i++) {
// received_n_array[i] = number.substr(i, 1);
// }
// for (var i = 9 - n_length, j = 0; i < 9; i++ , j++) {
// n_array[i] = received_n_array[j];
// }
// for (var i = 0, j = 1; i < 9; i++ , j++) {
// if (i == 0 || i == 2 || i == 4 || i == 7) {
// if (n_array[i] == 1) {
// n_array[j] = 10 + (+n_array[j]);
// n_array[i] = 0;
// }
// }
// }
// value = "";
// for (var i = 0; i < 9; i++) {
// if (i == 0 || i == 2 || i == 4 || i == 7) {
// value = n_array[i] * 10;
// } else {
// value = n_array[i];
// }
// if (value != 0) {
// words_string += words[value] + " ";
// }
// if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) {
// words_string += "Crores, ";
// }
// if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) {
// words_string += "Lakhs, ";
// }
// if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) {
// words_string += "Thousand, ";
// }
// if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) {
// words_string += "Hundred and ";
// } else if (i == 6 && value != 0) {
// words_string += "Hundred ";
// }
// }
// words_string = words_string.split(" ").join(" ");
// words_string=(words_string.length > 2 && words_string.charAt(words_string.length-2)==',') ? words_string.slice(0, -2) : words_string;
// }
// return words_string;
// }
} }

View File

@ -413,68 +413,68 @@ export class PdTrigerService {
// return str; // return str;
// } // }
convertNumberToWords(amount) { // convertNumberToWords(amount) {
//let words : any = new Array(); // //let words : any = new Array();
let words: any = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen', 'Twenty']; // let words: any = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen', 'Twenty'];
words[30] = 'Thirty'; // words[30] = 'Thirty';
words[40] = 'Forty'; // words[40] = 'Forty';
words[50] = 'Fifty'; // words[50] = 'Fifty';
words[60] = 'Sixty'; // words[60] = 'Sixty';
words[70] = 'Seventy'; // words[70] = 'Seventy';
words[80] = 'Eighty'; // words[80] = 'Eighty';
words[90] = 'Ninety'; // words[90] = 'Ninety';
amount = amount.toString(); // amount = amount.toString();
let atemp = amount.split("."); // let atemp = amount.split(".");
let number = atemp[0].split(",").join(""); // let number = atemp[0].split(",").join("");
let n_length = number.length; // let n_length = number.length;
let words_string = ""; // let words_string = "";
let value: any; // let value: any;
if (n_length <= 9) { // if (n_length <= 9) {
var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0); // var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0);
var received_n_array = new Array(); // var received_n_array = new Array();
for (var i = 0; i < n_length; i++) { // for (var i = 0; i < n_length; i++) {
received_n_array[i] = number.substr(i, 1); // received_n_array[i] = number.substr(i, 1);
} // }
for (var i = 9 - n_length, j = 0; i < 9; i++ , j++) { // for (var i = 9 - n_length, j = 0; i < 9; i++ , j++) {
n_array[i] = received_n_array[j]; // n_array[i] = received_n_array[j];
} // }
for (var i = 0, j = 1; i < 9; i++ , j++) { // for (var i = 0, j = 1; i < 9; i++ , j++) {
if (i == 0 || i == 2 || i == 4 || i == 7) { // if (i == 0 || i == 2 || i == 4 || i == 7) {
if (n_array[i] == 1) { // if (n_array[i] == 1) {
n_array[j] = 10 + (+n_array[j]); // n_array[j] = 10 + (+n_array[j]);
n_array[i] = 0; // n_array[i] = 0;
} // }
} // }
} // }
value = ""; // value = "";
for (var i = 0; i < 9; i++) { // for (var i = 0; i < 9; i++) {
if (i == 0 || i == 2 || i == 4 || i == 7) { // if (i == 0 || i == 2 || i == 4 || i == 7) {
value = n_array[i] * 10; // value = n_array[i] * 10;
} else { // } else {
value = n_array[i]; // value = n_array[i];
} // }
if (value != 0) { // if (value != 0) {
words_string += words[value] + " "; // words_string += words[value] + " ";
} // }
if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) { // if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) {
words_string += "Crores "; // words_string += "Crores ";
} // }
if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) { // if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) {
words_string += "Lakhs "; // words_string += "Lakhs ";
} // }
if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) { // if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) {
words_string += "Thousand "; // words_string += "Thousand ";
} // }
if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) { // if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) {
words_string += "Hundred and "; // words_string += "Hundred and ";
} else if (i == 6 && value != 0) { // } else if (i == 6 && value != 0) {
words_string += "Hundred "; // words_string += "Hundred ";
} // }
} // }
words_string = words_string.split(" ").join(" "); // words_string = words_string.split(" ").join(" ");
} // }
return words_string; // return words_string;
} // }
// save additional requirements // save additional requirements
saveAdditionalRequirements(saveData: any): Observable<any> { saveAdditionalRequirements(saveData: any): Observable<any> {