-
Notifications
You must be signed in to change notification settings - Fork 1
/
debt_snowball.html.j2
171 lines (150 loc) · 5.47 KB
/
debt_snowball.html.j2
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
<!DOCTYPE html">
<html lang="en-us">
<head>
<meta http-equiv="Content-Type" content="utf-8">
<title>Debt Snowball Paydown Calculator</title>
<link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&family=Oswald:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<style>
* {
transition: .5s ease all;
}
/* default font for accessibility and in case a framework is added */
:root {
--blue: #295fa6;
--blue-light: #2a95bf;
--white: #fff;
font-size: 100%;
}
body {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Lato', sans-serif;
font-weight: 300;
}
header {
margin: 0;
background-color: var(--blue);
color: var(--white);
border-bottom: 8px solid var(--blue-light);
}
main {
max-width: 800px;
margin: 2em auto;
}
h1 {
margin: 0;
padding: 0.5em 0;
font-family: 'Oswald', sans-serif;
font-size: calc(1.5em + 3vw);
font-weight: 700;
text-align: center;
}
input {
border-radius: 8px;
padding: .8em;
}
input[type="submit"] {
background-color: var(--blue);
color: var(--white);
}
.error {
color: #f00;
}
.text-center {
text-align: center;
}
</style>
</head>
<body>
<header>
<h1>Pay Down Your Debt Faster!</h1>
</header>
<main>
<p>Snowball debt paydown, sometimes called Waterfall Debt Paydown involves taking the payment of a just-paid-off debt, and adding that amount to pay down another debt, then taking that full amount, once the debt is paid off, and applying it to another debt.</p>
<p>This calculator is intended to show the effect of this plan on a given set of debts.</p>
<p>Fill in the information below. A few things to keep in mind:</p>
<ul>
<li>The calculation will abort if the amount owed on any of the debts stays the same or debts keeps growing. In other words, if the current payment is not reducing the debt, it will not calculate the snowball effect.</li>
<li>The order of debts listed does not matter. The calculation will sort the debts in order of payoff time, given the current payments. It will then calculate the payoffs started with the debts that can be paid off first with current payments.</li>
<li>It will be assumed each debt is being paid monthly.</li>
<li>It will assume you are making a payment in the current month.</li>
<li>If the payoff amount of a loan is less than the payment, its payment won't be added to the next debt until the following month</li>
<li><strong>This tool is to provide an example payoff schedule only. For financial advice, please contact a Financial Advisor or CPA.</strong></li>
</ul>
{% if message != '' %}
<p class="error">Problem with data: {{ message }}</p>
{% endif %}
<table>
<tr>
<td width="75%">
<form action="/" method="post">
<input type="hidden" name="row_count" value="10">
<table>
<tr>
<th>Number</th>
<th>Debt Name</th>
<th>Current Balance</th>
<th>Payment</th>
<th>Interest Rate</th>
</tr>
{% for num in range(1, 11) %}
<tr>
<td>{{ num }}</td>
<td><input type="text" name="debt_name_{{ num }}" value="{{ fields['debt_name_' + num | string] }}">
</td>
<td><input type="text" name="balance_{{ num }}" value="{{ fields['balance_' + num | string] }}"></td>
<td><input type="text" name="payment_{{ num }}" value="{{ fields['payment_' + num | string] }}"></td>
<td><input type="text" name="apr_{{ num }}" value="{{ fields['apr_' + num | string] }}"></td>
</tr>
{% endfor %}
<td></td>
<td><input type="submit"></td>
<td></td>
<td></td>
<td></td>
</table>
</form>
</td>
<td width="25%">
<script data-ad-client="{{ data_ad_client }}" async
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
</td>
</tr>
</table>
{% if results %}
{% for debt in results %}
<h2>{{ debt['debt_name']}}</h2>
<table>
<tr>
<th>Month</th>
<th>Start Balance</th>
<th>Balance After Interest</th>
<th>Payment</th>
<th>After Payment</th>
<th>Interest Paid</th>
<th>Principal Paid</th>
</tr>
{% for row in debt['payoff_chart'] %}
<tr>
<td>{{ row['month'].year }}-{{ row['month'].month }}</td>
<td>{{ row['start_balance'] }}</td>
<td>{{ row['new_balance'] }}</td>
<td>{{ row['payment'] }}</td>
<td>{{ row['paid_balance'] }}</td>
<td>{{ row['interest_payment'] }}</td>
<td>{{ row['principal_payment'] }}</td>
</tr>
{% endfor %}
</table>
{% endfor %}
{% endif %}
</main>
<footer class="text-center">
<p>A service of <a href="https://azariah">Azariah Enterprises</a><br/>
Design by Amy Carney - <a href="mailto:[email protected]">Mad Walrus Web Design, LLC</a><br/>
Suggestions? Comments? Ideas? <a href="mailto:[email protected]">E-mail us!</a><br/>
© 2020 Azariah Enterprises - Version {{ version }}</p>
</footer>
</body>
</html>