Support variable rates for annual usage stats

Note: I've removed the pricing assertion in the "0_free_allowance"
test as it's covered elsewhere - the value of the test is really to
check that we don't show the remainder if there never was any.
This commit is contained in:
Ben Thorner
2022-04-26 17:37:34 +01:00
parent 715a3c137f
commit e6c04ef556
4 changed files with 56 additions and 21 deletions

View File

@@ -33,13 +33,15 @@
{% if sms_free_allowance > 0 %}
{{ big_number(sms_allowance_remaining, 'free allowance remaining', smaller=True) }}
{% endif %}
{% if sms_charged %}
{{ big_number(
sms_charged,
'at {:.2f} pence per message'.format(sms_rate * 100),
smaller=True
) }}
{% endif %}
{% for row in sms_breakdown %}
{% if row.charged_units > 0 %}
{{ big_number(
row.charged_units,
'at {:.2f} pence per message'.format(row.rate * 100),
smaller=True
) }}
{% endif %}
{% endfor %}
</div>
</div>
<div class='govuk-grid-column-one-third'>