-
Notifications
You must be signed in to change notification settings - Fork 0
/
totals.js
147 lines (137 loc) · 4.57 KB
/
totals.js
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
function runtotaloc()
{
var cents = {
"entry_1" : 1,
"entry_3" : 5,
"entry_5" : 10,
"entry_7" : 25,
"entry_9" : 100,
"entry_11" : 200,
"entry_13" : 500,
"entry_15" : 1000,
"entry_17" : 2000,
"entry_19" : 5000,
"entry_21" : 10000
};
var total = 0;
for ( var entNum = 1; entNum <= 21; entNum += 2 )
{
var ecount = "entry_" + entNum;
var eamount = "entry_" + (entNum+1);
var count = Number(document.getElementById(ecount).value);
var amount = count * cents[ecount];
document.getElementById(eamount).value = (amount/100).toFixed(2);
total += amount;
}
var oc_otherq = Number(document.getElementById('entry_23').value);
var oc_othert = Number(document.getElementById('entry_24').value);
amount = oc_otherq * oc_othert;
document.getElementById("entry_25").value = amount.toFixed(2);
total += ( 100 * amount );
document.getElementById("entry_26").value = (total / 100).toFixed(2);
}
function runtotalcfd()
{
var cents = {
"entry_28" : 1,
"entry_30" : 5,
"entry_32" : 10,
"entry_34" : 25,
"entry_36" : 100,
"entry_38" : 200,
"entry_40" : 500,
"entry_42" : 1000,
"entry_44" : 2000,
"entry_46" : 5000,
"entry_48" : 10000
};
var total = 0;
for ( var entNum = 28; entNum <= 48; entNum += 2 )
{
var ecount = "entry_" + entNum;
var eamount = "entry_" + (entNum+1);
var count = Number(document.getElementById(ecount).value);
var amount = count * cents[ecount];
document.getElementById(eamount).value = (amount/100).toFixed(2);
total += amount;
}
var oc_otherq = Number(document.getElementById('entry_50').value);
var oc_othert = Number(document.getElementById('entry_51').value);
amount = oc_otherq * oc_othert;
document.getElementById("entry_52").value = amount.toFixed(2);
total += ( 100 * amount );
document.getElementById("entry_53").value = (total / 100).toFixed(2);
}
function runtotalcc()
{
var cents = {
"entry_55" : 1,
"entry_57" : 5,
"entry_59" : 10,
"entry_61" : 25,
"entry_63" : 100,
"entry_65" : 200,
"entry_67" : 500,
"entry_69" : 1000,
"entry_71" : 2000,
"entry_73" : 5000,
"entry_75" : 10000
};
var total = 0;
for ( var entNum = 55; entNum <= 75; entNum += 2 )
{
var ecount = "entry_" + entNum;
var eamount = "entry_" + (entNum+1);
var count = Number(document.getElementById(ecount).value);
var amount = count * cents[ecount];
document.getElementById(eamount).value = (amount/100).toFixed(2);
total += amount;
}
var oc_otherq = Number(document.getElementById('entry_77').value);
var oc_othert = Number(document.getElementById('entry_78').value);
amount = oc_otherq * oc_othert;
document.getElementById("entry_79").value = amount.toFixed(2);
total += ( 100 * amount );
document.getElementById("entry_80").value = (total / 100).toFixed(2);
document.getElementById("entry_108").value = document.getElementById("entry_80").value;
}
function runtotalade()
{
var cents = {
"entry_82" : 1,
"entry_84" : 5,
"entry_86" : 10,
"entry_88" : 25,
"entry_90" : 100,
"entry_92" : 200,
"entry_94" : 500,
"entry_96" : 1000,
"entry_98" : 2000,
"entry_100" : 5000,
"entry_102" : 10000
};
var total = 0;
for ( var entNum = 82; entNum <= 102; entNum += 2 )
{
var ecount = "entry_" + entNum;
var eamount = "entry_" + (entNum+1);
var count = Number(document.getElementById(ecount).value);
var amount = count * cents[ecount];
document.getElementById(eamount).value = (amount/100).toFixed(2);
total += amount;
}
var oc_otherq = Number(document.getElementById('entry_104').value);
var oc_othert = Number(document.getElementById('entry_105').value);
amount = oc_otherq * oc_othert;
document.getElementById("entry_106").value = amount.toFixed(2);
total += ( 100 * amount );
document.getElementById("entry_107").value = (total / 100).toFixed(2);
document.getElementById("entry_109").value = document.getElementById("entry_107").value;
}
function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}