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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html defanghtml_xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TMUX/EXA/EXABNPL Generator</title>
<style type="text/css"> 
.wrapper {

	width:800px;
	margin:50px auto;
	background:#000000;
	color:#B0D12A;
	border:10px solid #B0D12A;
	font-family:tahoma;
	font-size:12pt;
	padding:20px;

}
</style>
<script type="text/javascript">

function in_array( what, where ){

	var a=false;
	for(var i=0;i<where.length;i++){
		if(what == where[i]){
			a=true;
			break;
		}
	}
	return a;

}



function processForm() {

	var type = document.fm.type.value;
	var terms = document.fm.terms.value;
	var cprice = document.fm.cprice.value;
	var iprice = document.fm.iprice.value;
	
	var accept = new Array();
	
	accept[0] = "104";
	accept[1] = "156";
	accept[2] = "208";
	accept[3] = "260";
	accept[4] = "312";
	
	formcontrol = document.getElementById('calcform');
	formcontrol.style.display="none";
	
	Math.roundNumber = function(a,b){
  		if(!isNaN(parseInt(a))){
      		c = Math.pow(10,b);
     		return (Math.round(a*c)/c);
    	}
    	return false;
	}


	
	// if var type = EXA 
	if(type == "EXA") {
		if(in_array(terms, accept)) {
	
			var repay_multi = terms-1;
			
			var e = iprice/terms;
			var interest = iprice-cprice;
			interest = Math.roundNumber(interest,2);
			
			var f = Math.roundNumber(e,2);

			var g = f*repay_multi;
			//xx.xx*repay_multi = xx.xxxxxxxxxxxxxxxx
			g = Math.roundNumber(g,2);
			var d = iprice-g;
			d = Math.roundNumber(d,2);
			var output = "Terms: "+ terms +" <br /> Cash Price: £"+cprice+" <br /> Interest: £"+interest+" <br /> Interest Price: £"+iprice+" <br />"+repay_multi+" payments of £"+f+" followed by one payment of £"+d+".";
			
			var exa = document.getElementById('output');
			exa.style.display="block";
			exa.innerHTML=output;
	
		}
	}
	
	// if var type = TMUX 
	if(type == "TMUX") {
		if(in_array(terms, accept)) {
	
			var repay_multi = terms-1;
			
			var e = iprice/terms;
			var interest = iprice-cprice;
			interest = Math.roundNumber(interest,2);
			
			var f = Math.roundNumber(e,2);

			var g = f*repay_multi;
			//xx.xx*repay_multi = xx.xxxxxxxxxxxxxxxx
			g = Math.roundNumber(g,2);
			var d = iprice-g;
			d = Math.roundNumber(d,2);
			var output = "Terms: "+ terms +" <br /> Cash Price: £"+cprice+" <br /> Interest: £"+interest+" <br /> Interest Price: £"+iprice+" <br />"+repay_multi+" payments of £"+f+" followed by one payment of £"+d+".";
			
			var TMUX = document.getElementById('output');
			TMUX.style.display="block";
			TMUX.innerHTML=output;
	
		}
	}
	
	// if var type = EXABNPL1
	if(type == "EXABNPL1") {
		if(in_array(terms, accept)) {
			
			var repay_multi = terms-1;
			
			var e = iprice/terms;
			
			var interest = iprice-cprice;
			interest = Math.roundNumber(interest,2);
			
			var f = Math.roundNumber(e,2);
			var g = f*repay_multi;
			g = Math.roundNumber(g,2);
			var d = iprice-g;
			d = Math.roundNumber(d,2);
			
			repay_multi = terms/4;
			repay = repay_multi-1;
			
			f = f*4;
			d = d*4;
			
			var output = "<p>Terms: "+ terms +" <br /> Cash Price: £"+cprice+" <br /> Interest: £"+interest+" <br /> Interest Price: £"+iprice+" <br />"+repay+" payments of £"+f+" followed by one payment of £"+d+".</p>";
			
			var exabnpl = document.getElementById('output');
			exabnpl.style.display="block";
			exabnpl.innerHTML +=output;
		
		}
	}

}


</script>
</head>

<body>
<div class="wrapper">
<div>
  <h1>TMUX/EXA/EXABNPL1 Calculator.   </h1>
  <p> Use this form when sending arg letters TMUX/EXA(B/C)/EXA(B/C)BNPL1 to aid you to quickly work out what you need to add into the letter.</p>
  <p> Note you will need to still add in the ordered items into the form this is only for quickly calculating the repayments.</p>
</div>
<div id="calcform" style="display:block;"><form name="fm" action="javascript:void(0);">
	<p>&nbsp;</p>
	<table>
    	<tr><td>Letter Type</td><td><select name="type"><option value="NONE" selected="selected">--- PLEASE SELECT ---</option><option value="TMUX">TMUX</option><option value="EXA">EXA</option><option value="EXABNPL1">EXABNPL1</option></select></td></tr>
    	<tr><td>Weekly Terms 104/156 etc...</td><td><select name="terms" ><option value="NONE" selected="selected">--- PLEASE SELECT ---</option><option value="104">104</option><option value="156">156</option><option value="208">208</option><option value="260">260</option><option value="312">312</option></select></td></tr>
        <tr><td>Cash Price</td><td><input type="text" name="cprice" /></td></tr>
        <tr><td>Interest Price</td><td><input type="text" name="iprice" /></td></tr>
        <tr><td colspan="2" align="center"><input type="submit" value="Generate" onclick="processForm()" /></td>
        </tr>
    </table>
        
</form></div>
<div id="output" style="display:none"><h1>Results</h1></div>
</div>
</body>
</html>