Skip to content

Commit

Permalink
Merge pull request #746 from softwaresaved/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
phillybroadbent authored Nov 16, 2023
2 parents fcce8e5 + 21210c3 commit fb08f3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
6 changes: 0 additions & 6 deletions lowfat/models/claimant.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,3 @@ def claimantship_spent(self):
)

return sum([expense.amount_authorized_for_payment for expense in this_claimant_expenses])

def claimantship_total(self):
"""The total of available, committed, spent and passed funds.
To be used for the width of the money bar graph to prevent it spilling onto 2 lines."""

return self.claimantship_committed() + self.claimantship_spent() + abs(self.claimantship_available()) + self.claimantship_passed()
26 changes: 7 additions & 19 deletions lowfat/templates/lowfat/finances.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,28 @@ <h2>Finances</h2>
<figure>
<div class="money-bar-graph">
{% if claimant.claimantship_spent > 0 %}
<span style="width:{% widthratio claimant.claimantship_spent claimant.claimantship_total 100 %}%"
<span style="width:{% widthratio claimant.claimantship_spent 3000 100 %}%"
class="money-used"
title="Spent">
£{{ claimant.claimantship_spent|floatformat:2 }}
</span>
{% endif %}
{% if claimant.claimantship_committed > 0 %}
<span style="width:{% widthratio claimant.claimantship_committed claimant.claimantship_total 100 %}%"
<span style="width:{% widthratio claimant.claimantship_committed 3000 100 %}%"
class="money-reserved"
title="Commited">
title="Committed">
£{{ claimant.claimantship_committed|floatformat:2 }}
</span>
{% endif %}
{% if claimant.claimantship_available > 0 %}
<span style="width:{% widthratio claimant.claimantship_available claimant.claimantship_total 100 %}%"
{% if claimant.claimantship_available %}
<span style="width:{% widthratio claimant.claimantship_available 3000 100 %}%"
class="money-available"
title="Available">
£{{ claimant.claimantship_available|floatformat:2 }}
</span>
{% endif %}
{% if claimant.claimantship_available < 0 %}
<span style="width:{% widthratio claimant.claimantship_available claimant.claimantship_total 100 %}%"
class="money-passed"
title="Available">
£{{ claimant.claimantship_available|floatformat:2 }}
</span>
{% endif %}
{% if claimant.claimantship_passed %}
<span style="width:{% widthratio claimant.claimantship_passed claimant.claimantship_total 100 %}%"
<span style="width:{% widthratio claimant.claimantship_passed 3000 100 %}%"
class="money-passed"
title="Passed">
£{{ claimant.claimantship_passed|floatformat:2 }}
Expand Down Expand Up @@ -59,10 +52,5 @@ <h2>Finances</h2>
<th>Spent <span title="Sum of all approved expenses claim" class="fa-solid fa-question" aria-hidden="true"></span></th>
<td>£{{ claimant.claimantship_spent|floatformat:2 }}</td>
<tr>
<tr>
<th>Total <span title="Sum of all categories" class="fa-solid fa-question" aria-hidden="true"></span></th>
<td>£{{ claimant.claimantship_total|floatformat:2 }}</td>
<tr>

</tbody>
</table>
</table>

0 comments on commit fb08f3c

Please sign in to comment.