more gray for dashboard

This commit is contained in:
stvnrlly
2022-12-01 10:18:12 -05:00
parent 3e28baa733
commit f49e2a9e6e
4 changed files with 16 additions and 35 deletions

View File

@@ -326,10 +326,6 @@ def get_annual_usage_breakdown(usage, free_sms_fragment_limit):
emails = get_usage_breakdown_by_type(usage, 'email')
emails_sent = sum(row['notifications_sent'] for row in emails)
letters = get_usage_breakdown_by_type(usage, 'letter')
letters_sent = sum(row['notifications_sent'] for row in letters)
letters_cost = sum(row['cost'] for row in letters)
return {
'emails_sent': emails_sent,
'sms_free_allowance': sms_free_allowance,
@@ -337,8 +333,6 @@ def get_annual_usage_breakdown(usage, free_sms_fragment_limit):
'sms_allowance_remaining': max(0, (sms_free_allowance - sms_chargeable_units)),
'sms_cost': sms_cost,
'sms_breakdown': sms,
'letter_sent': letters_sent,
'letter_cost': letters_cost
}
@@ -374,8 +368,8 @@ def get_months_for_financial_year(year, time_format='%B'):
return [
month.strftime(time_format)
for month in (
get_months_for_year(4, 13, year) +
get_months_for_year(1, 4, year + 1)
get_months_for_year(10, 13, year) +
get_months_for_year(1, 10, year + 1)
)
if month < datetime.now()
]
@@ -391,7 +385,6 @@ def get_usage_breakdown_by_type(usage, notification_type):
def get_monthly_usage_breakdown(year, monthly_usage):
sms = get_usage_breakdown_by_type(monthly_usage, 'sms')
letters = get_usage_breakdown_by_type(monthly_usage, 'letter')
for month in get_months_for_financial_year(year):
monthly_sms = [row for row in sms if row['month'] == month]
@@ -399,14 +392,8 @@ def get_monthly_usage_breakdown(year, monthly_usage):
sms_cost = sum(row['cost'] for row in monthly_sms)
sms_breakdown = [row for row in monthly_sms if row['charged_units']]
monthly_letters = [row for row in letters if row['month'] == month]
letter_cost = sum(row['cost'] for row in monthly_letters)
letter_breakdown = get_monthly_usage_breakdown_for_letters(monthly_letters)
yield {
'month': month,
'letter_cost': letter_cost,
'letter_breakdown': list(letter_breakdown),
'sms_free_allowance_used': sms_free_allowance_used,
'sms_breakdown': sms_breakdown,
'sms_cost': sms_cost,
@@ -461,7 +448,7 @@ def get_tuples_of_financial_years(
):
return (
(
'financial year',
'fiscal year',
year,
partial_url(year=year),
'{} to {}'.format(year, year + 1),

View File

@@ -16,8 +16,8 @@
</div>
</div>
<div class='govuk-grid-column-one-half'>
<div class="keyline-block">
{{ big_number("No email", 'during SMS pilot', smaller=True) }}
<div class="keyline-block" style="color: gray;">
{{ big_number("0", 'email disabled during SMS pilot', smaller=True) }}
</div>
</div>
</div>

View File

@@ -48,11 +48,6 @@
</div>
<!-- <div class='govuk-grid-row'>
<div class='govuk-grid-column-one-half'>
<div class="keyline-block">
&nbsp;
</div>
</div>
<div class='govuk-grid-column-one-half'>
<div class="keyline-block">
{{ big_number(
@@ -60,9 +55,14 @@
'spent',
currency="$",
smaller=True
) }}
) }}
</div>
</div>
<div class='govuk-grid-column-one-half'>
<div class="keyline-block">
&nbsp;
</div>
</div>
</div>
</div> -->
{% if months %}
@@ -83,7 +83,7 @@
{% endcall %}
{% call field(align='left') %}
{{ big_number(
item.sms_cost + item.letter_cost,
item.sms_cost,
currency="$",
smallest=True
) }}
@@ -95,13 +95,7 @@
<li class="tabular-numbers">{{ sms.charged_units|message_count('sms') }} at
{{- ' {:.2f}p'.format(sms.rate * 100) }}</li>
{% endfor %}
<!-- {% for letter in item.letter_breakdown %}
{% if letter.sent %}
<li class="tabular-numbers">{{ "{:,} {}".format(letter.sent, letter.postage_description) }} {{ letter.sent|message_count_label('letter', suffix='') }} at
{{ letter.rate | format_number_in_pounds_as_currency }}</li>
{% endif %}
{% endfor %} -->
{% if not (item.sms_free_allowance_used or item.sms_cost or item.letter_breakdown) %}
{% if not (item.sms_free_allowance_used or item.sms_cost) %}
<li aria-hidden="true"></li>
{% endif %}
</ul>
@@ -114,7 +108,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-third">
<p class="align-with-heading-copy">
Financial year ends 31&nbsp;March
Federal fiscal year ends September&nbsp;30
</p>
</div>
<div class="govuk-grid-column-two-thirds">

View File

@@ -9,7 +9,7 @@ def get_current_financial_year():
now = datetime.now(current_app.config['PY_TIMEZONE'])
current_month = int(now.strftime('%-m'))
current_year = int(now.strftime('%Y'))
return current_year if current_month > 3 else current_year - 1
return current_year if current_month > 9 else current_year - 1
def is_less_than_days_ago(date_from_db, number_of_days):