From b14743d6c6a4e5b97903d78ee20b03f89238d2f2 Mon Sep 17 00:00:00 2001 From: phillybroadbent Date: Thu, 16 Nov 2023 10:41:21 +0000 Subject: [PATCH] Reverted funding summary bar plot to previous method of calculation --- lowfat/models/claimant.py | 10 ++------ lowfat/templates/lowfat/finances.html | 34 +++++++++------------------ 2 files changed, 13 insertions(+), 31 deletions(-) diff --git a/lowfat/models/claimant.py b/lowfat/models/claimant.py index 30524cee..f46a075e 100644 --- a/lowfat/models/claimant.py +++ b/lowfat/models/claimant.py @@ -455,7 +455,7 @@ def claimantship_committed(self): status__in=['A', 'M', 'F'] )]) - return sum([fund.budget_approved for fund in this_claimant_funds]) - (spent_from_committed_final + spent_from_committed_other) + return sum([fund.budget_approved for fund in this_claimant_funds]) - (spent_from_committed_final + spent_from_committed_other) def claimantship_spent(self): """Return the amount already spent from the claimantship grant.""" @@ -465,10 +465,4 @@ def claimantship_spent(self): grant_heading="F" ) - 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() + return sum([expense.amount_authorized_for_payment for expense in this_claimant_expenses]) \ No newline at end of file diff --git a/lowfat/templates/lowfat/finances.html b/lowfat/templates/lowfat/finances.html index 95a0ba8d..e7b0abab 100644 --- a/lowfat/templates/lowfat/finances.html +++ b/lowfat/templates/lowfat/finances.html @@ -3,35 +3,28 @@

Finances

{% if claimant.claimantship_spent > 0 %} - £{{ claimant.claimantship_spent|floatformat:2 }} {% endif %} {% if claimant.claimantship_committed > 0 %} - + title="Committed"> £{{ claimant.claimantship_committed|floatformat:2 }} {% endif %} - {% if claimant.claimantship_available > 0 %} - £{{ claimant.claimantship_available|floatformat:2 }} {% endif %} - {% if claimant.claimantship_available < 0 %} - - £{{ claimant.claimantship_available|floatformat:2 }} - - {% endif %} {% if claimant.claimantship_passed %} - £{{ claimant.claimantship_passed|floatformat:2 }} @@ -43,26 +36,21 @@

Finances

- - + - + - + - - - - - -
Grant + Grant £{{ claimant.claimantship_grant|floatformat:2 }}
Available (until {{ claimant.inauguration_grant_expiration }}) Available (until {{ claimant.inauguration_grant_expiration }}) £{{ claimant.claimantship_available|floatformat:2 }}
Committed Committed £{{ claimant.claimantship_committed|floatformat:2 }}
Spent Spent £{{ claimant.claimantship_spent|floatformat:2 }}
Total £{{ claimant.claimantship_total|floatformat:2 }}
+ \ No newline at end of file