Skip to content

Commit

Permalink
issue #39 - add unreconciled trans sums to credit accounts too
Browse files Browse the repository at this point in the history
  • Loading branch information
jantman committed Apr 30, 2017
1 parent eb4d8d3 commit face552
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
4 changes: 4 additions & 0 deletions biweeklybudget/flaskapp/templates/accounts.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
<th>Balance</th>
<th>Credit Limit</th>
<th>Available</th>
<th>Unreconciled</th>
<th>Difference</th>
</tr>
</thead>
<tbody>
Expand All @@ -74,6 +76,8 @@
</td>
<td>{{ acct.credit_limit|dollars }}</td>
<td>{{ (acct.credit_limit + acct.balance.ledger)|reddollars }}</td>
<td>{{ acct.unreconciled_sum|dollars }}</td>
<td>{{ (cast_float(acct.credit_limit + acct.balance.ledger) - acct.unreconciled_sum)|reddollars }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down
2 changes: 2 additions & 0 deletions biweeklybudget/flaskapp/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
<th>Account</th>
<th>Balance</th>
<th>Available</th>
<th>Avail - Unrec</th>
</tr>
</thead>
<tbody>
Expand All @@ -144,6 +145,7 @@
{% endif %}
</td>
<td>{{ (acct.credit_limit + acct.balance.ledger)|reddollars }}</td>
<td>{{ (cast_float(acct.credit_limit + acct.balance.ledger) - acct.unreconciled_sum)|reddollars }}</td>
</tr>
{% endfor %}
</tbody>
Expand Down
13 changes: 10 additions & 3 deletions biweeklybudget/tests/acceptance/flaskapp/views/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,18 @@ def test_credit_table(self, selenium):
"//div[@id='panel-credit-cards']//table"
)
assert self.thead2list(table) == [
'Account', 'Balance', 'Credit Limit', 'Available'
'Account', 'Balance', 'Credit Limit', 'Available', 'Unreconciled',
'Difference'
]
assert self.tbody2textlist(table) == [
['CreditOne', '-$952.06 (13 hours ago)', '$2,000.00', '$1,047.94'],
['CreditTwo', '-$5,498.65 (a day ago)', '$5,500.00', '$1.35']
[
'CreditOne', '-$952.06 (13 hours ago)', '$2,000.00',
'$1,047.94', '$222.22', '$825.72'
],
[
'CreditTwo', '-$5,498.65 (a day ago)', '$5,500.00', '$1.35',
'$0.00', '$1.35'
]
]
links = []
tbody = table.find_element_by_tag_name('tbody')
Expand Down
8 changes: 5 additions & 3 deletions biweeklybudget/tests/acceptance/flaskapp/views/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ def test_credit_table(self, selenium):
table = selenium.find_element_by_xpath(
"//div[@id='panel-credit-cards']//table"
)
assert self.thead2list(table) == ['Account', 'Balance', 'Available']
assert self.thead2list(table) == [
'Account', 'Balance', 'Available', 'Avail - Unrec'
]
assert self.tbody2textlist(table) == [
['CreditOne', '-$952.06 (13 hours ago)', '$1,047.94'],
['CreditTwo', '-$5,498.65 (a day ago)', '$1.35']
['CreditOne', '-$952.06 (13 hours ago)', '$1,047.94', '$825.72'],
['CreditTwo', '-$5,498.65 (a day ago)', '$1.35', '$1.35']
]
links = []
tbody = table.find_element_by_tag_name('tbody')
Expand Down

0 comments on commit face552

Please sign in to comment.