Merge pull request #4225 from alphagov/free-allowance-api-181934027

Change annual usage to work with multiple SMS rates
This commit is contained in:
Ben Thorner
2022-04-29 13:22:54 +01:00
committed by GitHub
5 changed files with 179 additions and 110 deletions

View File

@@ -8,9 +8,9 @@
</div>
<div class='govuk-grid-column-one-third'>
<div class="keyline-block">
{% if sms_chargeable %}
{% if sms_cost %}
{{ big_number(
sms_chargeable * sms_rate,
sms_cost,
'spent on text messages',
currency="£",
smaller=True

View File

@@ -33,13 +33,15 @@
{% if sms_free_allowance > 0 %}
{{ big_number(sms_allowance_remaining, 'free allowance remaining', smaller=True) }}
{% endif %}
{% if sms_chargeable %}
{{ big_number(
sms_chargeable,
'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'>
@@ -59,7 +61,7 @@
<div class='govuk-grid-column-one-third'>
<div class="keyline-block">
{{ big_number(
(sms_chargeable * sms_rate),
sms_cost,
'spent',
currency="£",
smaller=True