@@ -293,37 +326,55 @@
+ {{"₹"}} {{details.get('estimate_profit_margin').value | numberToWords}} Only
+
+
@@ -344,13 +395,22 @@
+ {{"₹"}} {{details.get('estimate_loss_margin').value | numberToWords}} Only
+
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts
index 7bf734f8a..3b04c3da8 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts
@@ -47,26 +47,26 @@ export class FinancialInfoComponent implements OnInit {
customerCommentsFlag :boolean;
//Array for Amount Inwords
- FY_annualSalesInwords : any = [];
- FY_netProfitAmtInwords : any = [];
- FY_netLossAmtInwords : any = [];
- AV_SalesInwords : any = [];
- AV_annualSalesInwords : any = [];
- AV_marginProfitAmtInwords : any = [];
- AV_netProfitAmtInwords : any = [];
- AV_marginLossAmtInwords : any = [];
- AV_netLossAmtInwords : any = [];
+ // FY_annualSalesInwords : any = [];
+ // FY_netProfitAmtInwords : any = [];
+ // FY_netLossAmtInwords : any = [];
+ // AV_SalesInwords : any = [];
+ // AV_annualSalesInwords : any = [];
+ // AV_marginProfitAmtInwords : any = [];
+ // AV_netProfitAmtInwords : any = [];
+ // AV_marginLossAmtInwords : any = [];
+ // AV_netLossAmtInwords : any = [];
//isreadonly for edit(no of year Fields and Starting Years )
isReadOnly : boolean = false;
EditAble: boolean = true;
isDisplay : boolean ;
- AV_netProfitAmtFrmInwords: any = [];
- AV_netProfitAmtToInwords: any = [];
- AV_netLossAmtFrmInwords: any = [];
- AV_netLossAmtToInwords: any = [];
- AV_SalesFrmInwords: any = [];
- AV_SalesToInwords: any = [];
+ // AV_netProfitAmtFrmInwords: any = [];
+ // AV_netProfitAmtToInwords: any = [];
+ // AV_netLossAmtFrmInwords: any = [];
+ // AV_netLossAmtToInwords: any = [];
+ // AV_SalesFrmInwords: any = [];
+ // AV_SalesToInwords: any = [];
av : any =[{id:6, name:'Letter of Credit'},
{id:2, name:'Bank Guarantee'},
{id:3, name:'Cash Credit Limit'},
@@ -145,9 +145,9 @@ export class FinancialInfoComponent implements OnInit {
this.customerCommentsFlag = result.length == 1 ? false : true;
result.forEach((val,index) => {
//financial_date.push(this.createDate());
- this.FY_annualSalesInwords[index] = this._pd.convertNumberToWords(val.financial_annual_sale);
- this.FY_netProfitAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_profit);
- this.FY_netLossAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_loss);
+ // this.FY_annualSalesInwords[index] = this._pd.convertNumberToWords(val.financial_annual_sale);
+ // this.FY_netProfitAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_profit);
+ // this.FY_netLossAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_loss);
financial_date.push(this.createDate(''));
});
retriveData.date_per_financial = result;
@@ -166,17 +166,17 @@ export class FinancialInfoComponent implements OnInit {
if (result_val.length > 0) {
result_val.forEach((val,index) => {
- 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_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_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_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_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_netLossAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_net_loss));
+ // 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_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_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_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_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_netLossAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_net_loss));
estimated_val.push(this.createValue(''));
});
retriveData.estimated_value = result_val;
@@ -1091,11 +1091,11 @@ export class FinancialInfoComponent implements OnInit {
if(lower > higer){
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{
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) {
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));
- this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average));
+ // this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average));
}else{
details.controls.estimate_profit_range_to.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_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_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);
let Profit_percent = (higer/+sales_average)*100;
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{
details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0);
let Profit_percent = (lower/+sales_average)*100;
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){
@@ -1276,13 +1276,13 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0);
let Profit_percent = (higer/+sales_average)*100;
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{
details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0);
let Profit_percent = (lower/+sales_average)*100;
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);
let Profit_percent = (higer/sales_average)*100;
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{
details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0);
let Profit_percent = (lower/sales_average)*100;
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{
@@ -1321,13 +1321,13 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0);
let Profit_percent = (higer/sales_average)*100;
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{
details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0);
let Profit_percent = (lower/sales_average)*100;
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_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{
details.controls.estimate_loss_range_to.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_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);
let loss_percent = (higer/+sales_average)*100;
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{
details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0);
let loss_percent = (lower/+sales_average)*100;
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);
let loss_percent = (+higer/+sales_average)*100;
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{
details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0);
let loss_percent = (+lower/+sales_average)*100;
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){
@@ -1546,13 +1546,13 @@ export class FinancialInfoComponent implements OnInit {
details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0);
let loss_percent = (higer/+sales_average)*100;
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{
details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0);
let loss_percent = (+lower/+sales_average)*100;
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);
let loss_percent = (+higer/+sales_average)*100;
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{
details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0);
let loss_percent = (+lower/+sales_average)*100;
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 */
- inWords(e,i,flag:number){
+// inWords(e,i,flag:number){
- switch(flag){
- case 1 :
- this.FY_annualSalesInwords[i] = this._pd.convertNumberToWords(e.target.value);
- // this.placeholderName[i] = 'Weekly Instalment Amount'; break;
- break;
- case 2 :
- this.FY_netProfitAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
- //alert('Fin net Profit'+this.FY_netProfitAmtInwords[i]);
- break;
- case 3 :
- this.FY_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
- // alert('Fin net Loss'+this.FY_netLossAmtInwords[i]);
- break;
- case 4 :
- this.AV_annualSalesInwords[i] = this._pd.convertNumberToWords(e.target.value);
- break;
- case 5 :
- this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
- break;
- case 6 :
- this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
- break;
- case 7 :
- this.AV_netProfitAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value);
- break;
- case 8 :
- this.AV_netProfitAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value);
- break;
- case 9 :
- this.AV_netLossAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value);
- break;
- case 10 :
- this.AV_netLossAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value);
- break;
- case 11 :
- this.AV_SalesFrmInwords[i] = this._pd.convertNumberToWords(e.target.value);
- break;
- case 12 :
- this.AV_SalesToInwords[i] = this._pd.convertNumberToWords(e.target.value);
- break;
- default:
- break;
- }
-}
+// switch(flag){
+// case 1 :
+// this.FY_annualSalesInwords[i] = this._pd.convertNumberToWords(e.target.value);
+// // this.placeholderName[i] = 'Weekly Instalment Amount'; break;
+// break;
+// case 2 :
+// this.FY_netProfitAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
+// //alert('Fin net Profit'+this.FY_netProfitAmtInwords[i]);
+// break;
+// case 3 :
+// this.FY_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
+// // alert('Fin net Loss'+this.FY_netLossAmtInwords[i]);
+// break;
+// case 4 :
+// this.AV_annualSalesInwords[i] = this._pd.convertNumberToWords(e.target.value);
+// break;
+// case 5 :
+// this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
+// break;
+// case 6 :
+// this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
+// break;
+// case 7 :
+// this.AV_netProfitAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value);
+// break;
+// case 8 :
+// this.AV_netProfitAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value);
+// break;
+// case 9 :
+// this.AV_netLossAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value);
+// break;
+// case 10 :
+// this.AV_netLossAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value);
+// break;
+// case 11 :
+// this.AV_SalesFrmInwords[i] = this._pd.convertNumberToWords(e.target.value);
+// break;
+// case 12 :
+// this.AV_SalesToInwords[i] = this._pd.convertNumberToWords(e.target.value);
+// break;
+// default:
+// break;
+// }
+// }
}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html
index 8f6ac1460..999773b6c 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.html
@@ -24,10 +24,12 @@
- {{"₹"}}
- {{loanAmtInWords}} Only
+
+ {{"₹"}} {{ loanDetailsForm.controls['loan_amount'].value | numberToWords }} Only
+
Loan Tenure applied for?
@@ -68,9 +70,9 @@
- {{"₹"}}
- {{balTxrfAmtInWords}} Only
+ (change)="loanCalc()" autocomplete="off">
+ {{"₹"}} {{ loanDetailsForm.controls['balance_transfer_amount'].value | numberToWords }} Only
+
@@ -89,10 +91,9 @@
- {{"₹"}}
- {{topUpAmtInWords}} Only
+ {{"₹"}} {{ loanDetailsForm.controls['topup_amount'].value | numberToWords }} Only
@@ -114,10 +115,10 @@
- {{"₹"}}
- {{ownContributionInWords}} Only
+ {{"₹"}} {{ loanDetailsForm.controls['own_contribution'].value | numberToWords }} Only
+
@@ -142,9 +143,8 @@
- {{"₹"}}
- {{emiAmtInWords}} Only
+ OnlyNumber type="text" autocomplete="off">
+ {{"₹"}} {{ loanDetailsForm.controls['emi_level'].value | numberToWords }} Only
@@ -212,10 +212,9 @@
- {{"₹"}}
- {{emvAmtInWords}} Only
+ {{"₹"}} {{ loanDetailsForm.controls['emv_per_customer'].value | numberToWords }} Only
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts
index 4e3639c78..d02a1833e 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts
@@ -75,16 +75,6 @@ export class LoanDetailsComponent implements OnInit {
existCompanyList: any = [];
companies: any = [];
- /* Declaration of Variables For Amount IN words */
- loanAmtInWords: any;
- balTxrfAmtInWords: any;
- valAsPerAgmtInWords: any;
- ownContributionInWords: any;
- topUpAmtInWords: any;
- emiAmtInWords: any;
- emvAmtInWords: any;
-
-
/** Constructor Of the Class */
constructor(notifier: NotifierService,
private fb: FormBuilder,
@@ -102,7 +92,7 @@ export class LoanDetailsComponent implements OnInit {
this.productID = this.pd_all_details.pdmaster_details.fk_product_id;
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.loanAmtInWords = this._pd.convertNumberToWords(this.exist_loan_amt);
+ // this.loanAmtInWords = this._pd.convertNumberToWords(this.exist_loan_amt);
this.form_id = 10;
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.notifier = notifier;
@@ -192,7 +182,7 @@ export class LoanDetailsComponent implements OnInit {
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['sub_product'].setValue(value.records.sub_product || null);
@@ -204,11 +194,11 @@ export class LoanDetailsComponent implements OnInit {
if (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) {
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) {
this.loanDetailsForm.controls['end_use_topup'].setValue(value.records.end_use_topup);
if (value.records.end_use_topup == 1) {
@@ -243,7 +233,7 @@ export class LoanDetailsComponent implements OnInit {
});
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.sourceChange(dbsourcelist);
@@ -257,7 +247,7 @@ export class LoanDetailsComponent implements OnInit {
if (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);
@@ -275,7 +265,7 @@ export class LoanDetailsComponent implements OnInit {
if (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 +531,25 @@ export class LoanDetailsComponent implements OnInit {
inWords(e, flag: number) {
switch (flag) {
case 1:
- this.loanAmtInWords = this._pd.convertNumberToWords(e.target.value);
+ // this.loanAmtInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 2:
- this.balTxrfAmtInWords = this._pd.convertNumberToWords(e.target.value);
+ // this.balTxrfAmtInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 3:
- this.valAsPerAgmtInWords = this._pd.convertNumberToWords(e.target.value);
+ // this.valAsPerAgmtInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 4:
- this.ownContributionInWords = this._pd.convertNumberToWords(e.target.value);
+ // this.ownContributionInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 5:
- this.topUpAmtInWords = this._pd.convertNumberToWords(e.target.value);
+ // this.topUpAmtInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 6:
- this.emiAmtInWords = this._pd.convertNumberToWords(e.target.value);
+ // this.emiAmtInWords = this._pd.convertNumberToWords(e.target.value);
break;
case 7:
- this.emvAmtInWords = this._pd.convertNumberToWords(e.target.value);
+ // this.emvAmtInWords = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
@@ -593,14 +583,14 @@ export class LoanDetailsComponent implements OnInit {
if (loanAmount >= BtAmount) {
topupAmt = loanAmount - BtAmount;
this.loanDetailsForm.controls['topup_amount'].setValue(topupAmt);
- this.topUpAmtInWords = this._pd.convertNumberToWords(topupAmt);
+ // this.topUpAmtInWords = this._pd.convertNumberToWords(topupAmt);
}
else {
this.notifier.notify('warning', 'Balances Transfer Amount is greater than Loan Amount Please check.!');
this.loanDetailsForm.controls['balance_transfer_amount'].setValue('');
- this.balTxrfAmtInWords = '';
+ // this.balTxrfAmtInWords = '';
this.loanDetailsForm.controls['topup_amount'].setValue('');
- this.topUpAmtInWords = '';
+ // this.topUpAmtInWords = '';
}
}
}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html
index 0823ed11a..d1fdfef8c 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.html
@@ -168,9 +168,8 @@
- {{"₹"}}
- {{amtInwords[r]}} Only
+ formControlName="business_volume_amount" type="text" OnlyNumber type="text">
+ {{"₹"}} {{ reference.controls.business_volume_amount.value | numberToWords}} Only
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts
index e95cf5cf5..da8a55c1c 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/neighbour-hood/neighbour-hood.component.ts
@@ -38,7 +38,7 @@ export class NeighbourHoodComponent implements OnInit {
existCompanyList: any =[];
mergeCompanyApplicant: any=[];
isOrganisationOwner: any=[];
- amtInwords : any = [];
+ // amtInwords : any = [];
// isOtherApplicant: any = [];
constructor(notifier: NotifierService, private _pd: PdTrigerService ,private _fb: FormBuilder, @Inject(MAT_DIALOG_DATA) public data: any,private dialogRef: MatDialogRef) {
@@ -148,7 +148,7 @@ export class NeighbourHoodComponent implements OnInit {
if(exist_ref_details.length>0){ /**&& data.records.check_type==1 */
exist_ref_details.forEach((element,index) => {
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);
referencecheckControl.push(this.createReerenceCheck(element));
@@ -477,9 +477,9 @@ checkOthers(values){
// }
/** Amount InWords */
- inWords(e,i){
- this.amtInwords[i] = this._pd.convertNumberToWords(e);
-}
+// inWords(e,i){
+// this.amtInwords[i] = this._pd.convertNumberToWords(e);
+// }
compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id)
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html
index cf77dff53..234e71d7f 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.html
@@ -97,8 +97,7 @@
- {{"₹"}}
- {{amtInwords[i]}} Only
+ {{"₹"}} {{ details.get('amount').value | numberToWords}} Only
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts
index f191ff155..379312724 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/other-income/other-income.component.ts
@@ -50,7 +50,7 @@ export class OtherIncomeComponent implements OnInit {
private notifier: NotifierService;
frequencyData: any = [];
sourceData: any = [];
- amtInwords: any = [];
+
applicants: any = [];
incomeEarnedBy: any = [];
existCompanyList: any = [];
@@ -150,7 +150,7 @@ export class OtherIncomeComponent implements OnInit {
});
if (result.length > 0) {
result.forEach((val, index) => {
- this.amtInwords[index] = this._pd.convertNumberToWords(val.amount);
+
// this.getOtherIncomeEarnedBy(val.income_earned_by,index);
control.push(this.createDetail());
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() {
// alert('Rental Info ');
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
index 050a9fe1f..7c77961a1 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
@@ -755,8 +755,6 @@ export class StockComponent implements OnInit {
checkComments(value, flag, index) {
-
-
if (flag == 1) {
this.ManufacturingCounterArray[index] = value == "yes" ? 1 : 0;
this.not_stock_of_rm[index] = value == "stock not required to be maintained" ? 1 : 0;
diff --git a/ng6-seed/src/app/personal-discussion/pd-pipes/number-to-words.pipe.ts b/ng6-seed/src/app/personal-discussion/pd-pipes/number-to-words.pipe.ts
index 2b7796b98..3c0a7a7de 100644
--- a/ng6-seed/src/app/personal-discussion/pd-pipes/number-to-words.pipe.ts
+++ b/ng6-seed/src/app/personal-discussion/pd-pipes/number-to-words.pipe.ts
@@ -4,68 +4,130 @@ import { Pipe, PipeTransform } from '@angular/core';
name: 'numberToWords'
})
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"],
+
+ handle_tens = function(dgt, prevDgt) {
+ return 0 == dgt ? "" : " " + (1 == dgt ? dblDigit[prevDgt] : tensPlace[dgt])
+ },
+ handle_utlc = function(dgt, nxtDgt, denom) {
+ return (0 != dgt && 1 != nxtDgt ? " " + sglDigit[dgt] : "") + (0 != nxtDgt || dgt > 0 ? " " + denom : "")
+ };
- 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'];
- 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;
- }
+ var str = "",
+ digitIdx = 0,
+ digit = 0,
+ nxtDigit = 0,
+ words = [];
+ if (amount += "", isNaN(parseInt(amount))) str = "";
+ else if (parseInt(amount) > 0 && amount.length <= 10) {
+ for (digitIdx = amount.length - 1; digitIdx >= 0; digitIdx--)
+ switch (digit = amount[digitIdx] - 0, nxtDigit = digitIdx > 0 ? amount[digitIdx - 1] - 0 : 0, amount.length - digitIdx - 1) {
+ case 0:
+ words.push(handle_utlc(digit, nxtDigit, ""));
+ break;
+ case 1:
+ words.push(handle_tens(digit, amount[digitIdx + 1]));
+ break;
+ case 2:
+ words.push(0 != digit ? " " + sglDigit[digit] + " Hundred" + (0 != amount[digitIdx + 1] && 0 != amount[digitIdx + 2] ? " and" : "") : "");
+ break;
+ case 3:
+ words.push(handle_utlc(digit, nxtDigit, "Thousand"));
+ break;
+ case 4:
+ words.push(handle_tens(digit, amount[digitIdx + 1]));
+ break;
+ case 5:
+ words.push(handle_utlc(digit, nxtDigit, "Lakh"));
+ break;
+ case 6:
+ words.push(handle_tens(digit, amount[digitIdx + 1]));
+ break;
+ case 7:
+ words.push(handle_utlc(digit, nxtDigit, "Crore"));
+ break;
+ case 8:
+ words.push(handle_tens(digit, amount[digitIdx + 1]));
+ break;
+ case 9:
+ words.push(0 != digit ? " " + sglDigit[digit] + " Hundred" + (0 != amount[digitIdx + 1] || 0 != amount[digitIdx + 2] ? " and" : " Crore") : "")
+ // break;
+ // 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"))
+ // : "")
+ // break;
+ }
+ str = words.reverse().join("")
+ } else str = "";
+ return str
+
+ }
+
+//References
+// 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'];
+// 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;
+// }
}
diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts
index 48d4062fc..4220f0963 100755
--- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts
+++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts
@@ -412,69 +412,69 @@ export class PdTrigerService {
// str += (n[5] != 0) ? ((str != '') ? 'and ' : '') + (a[Number(n[5])] || b[n[5][0]] + ' ' + a[n[5][1]]) + 'only ' : '';
// return str;
// }
-
- convertNumberToWords(amount) {
- //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'];
- 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(" ");
- }
- return words_string;
- }
+
+ // convertNumberToWords(amount) {
+ // //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'];
+ // 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(" ");
+ // }
+ // return words_string;
+ // }
// save additional requirements
saveAdditionalRequirements(saveData: any): Observable {