-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbillingwithamtwords.html
189 lines (163 loc) · 4.23 KB
/
billingwithamtwords.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<html>
<link href="billingwithamtwords.css" type="text/css" rel="stylesheet" />
<div class="p">
<head><center><h1>MALAYSIAN TOWNSHIP NORTH PHASE<br>
OWNERS WELFARE ASSOCIATION<br></h1>
<h2>(Regd.No.519/2017)</h2>
<h3>#506 SBRT (F),LIG Rain Tree Park,KPHB Colony,Kukatpally,Hyderabad-85</h3>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<br><h1><strong>RECEIPT</strong></h1>
</center>
<h3>
<p align="left">No: <input type="number" id="myNumber" min="1">
<p></p>
<script>
function myFunction1() {
document.getElementById("myNumber").stepUp(1);
}
</script>
</p>
<p id="demo1"></p>
<script>
var d = new Date();
d.date= d.toDateString();
</script>
<script type="text/javascript">
document.write("Date: " + d.date + "<br>");
</script>
</p>
</h3>
<h3>
<form action="includes/contact.php" method="post">
<p align="left">Received with thanks from Sri/Smt
<input name="last_name" id="Last_Name" type="text" /> </p>
<p align="left"> <label for="Block">Block no:</label>
<input name="block" id="Email" type="block" />
<label for="Flat">Flat No:</label>
<input name="flat" id="flat" type="flat" />
Malaysian Township North Phase
</p>
<body>
<p align="left"><p align="left"> <b> Amount in Words(Rs):</b>
<p id="demo"></p>
<script>
function numToString(x)
{
var r=0;
var txter=x;
var sizer=txter.length;
var numStr="";
if(isNaN(txter))
{
document.getElementById("demo").innerHTML = " invalid number";
exit();
}
var n=parseInt(x);
var places=0;
var str="";
var entry=0;
while(n>=1)
{
r=parseInt(n%10);
if(places<3 && entry==0)
{
numStr=txter.substring(txter.length-0,txter.length-3) // Checks for 1 to 999.
str=onlyDigit(numStr); //Calls function for last 3 digits of the value.
entry=1;
}
if(places==3)
{
numStr=txter.substring(txter.length-5,txter.length-3)
if(numStr!="")
{
str=onlyDigit(numStr)+ " Thousand "+str;
}
}
if(places==5)
{
numStr=txter.substring(txter.length-7,txter.length-5) //Substring for 5 place to 7 place of the string
if(numStr!="")
{
str=onlyDigit(numStr)+ " Lakhs "+str; //Appends the word lakhs to it
}
}
if(places==6)
{
numStr=txter.substring(txter.length-9,txter.length-7) //Substring for 7 place to 8 place of the string
if(numStr!="")
{
str=onlyDigit(numStr)+ " Crores "+str; //Appends the word Crores
}
}
n=parseInt(n/10);
places++;
}
document.getElementById("demo").innerHTML =str;
}
function onlyDigit(n)
{
//Arrays to store the string equivalent of the number to convert in words
var units=['','One','Two','Three','Four','Five','Six','Seven','Eight','Nine'];
var randomer=['','Eleven','Twelve','Thirteen','Fourteen','Fifteen','Sixteen','Seventeen','Eighteen','Nineteen'];
var tens=['','Ten','Twenty','Thirty','Forty','Fifty','Sixty','Seventy','Eighty','Ninety'];
var r=0;
var num=parseInt(n);
var str="";
var pl="";
var tenser="";
while(num>=1)
{
r=parseInt(num%10);
tenser=r+tenser;
if(tenser<=19 && tenser>10) //Logic for 10 to 19 numbers
{
str=randomer[tenser-10];
}
else
{
if(pl==0) //If units place then call units array.
{
str=units[r];
}
else if(pl==1) //If tens place then call tens array.
{
str=tens[r]+" "+str;
}
}
if(pl==2) //If hundreds place then call units array.
{
str=units[r]+" Hundred "+str;
}
num=parseInt(num/10);
pl++;
}
return str;
}
function myFunction() {
window.print();
}
</script>
<p align="left"><p align="left"><b>
Towards maintainence charges for the month/months of ________________________________<br>
By Cash/Cheque ______________________________________________________________________<br>
</b>
<form name="fm" id="fm">
</p>
<b><p align="left">
Amount in figures
</b>
<input type="text" name="txtinput" id="txtinput" maxlength="9" />
<br><br><br></h2>
<h2>
<pre class="tab"><p align="left"><p align="left">Recieved By President Gen Secretary Treasurer </p></p></pre></p></p></p></p></h2></div>
<div class="s">
</div>
</form><p align="center">
<button type="button" onclick= numToString(txtinput.value);myFunction1();myFunction();> print
</button>
</form>
</h3>
</body>
</html>