Merge pull request #4221 from alphagov/usage-tidyup

Show monthly usage rate correctly if the sms rate has changed during the financial year
This commit is contained in:
Ben Thorner
2022-04-27 15:37:45 +01:00
committed by GitHub
4 changed files with 129 additions and 39 deletions

View File

@@ -97,17 +97,17 @@
{% endcall %}
{% call field(align='left') %}
{{ big_number(
(sms_rate * month.paid) + month.letter_total,
(month.sms_rate * month.sms_paid_count) + month.letter_total,
currency="£",
smallest=True
) }}
<ul>
{% if month.free %}
<li class="tabular-numbers">{{ month.free|format_thousands }} free {{ month.free|message_count_label('sms', suffix='') }}</li>
{% if month.sms_free_count %}
<li class="tabular-numbers">{{ month.sms_free_count|format_thousands }} free {{ month.sms_free_count|message_count_label('sms', suffix='') }}</li>
{% endif %}
{% if month.paid %}
<li class="tabular-numbers">{{ month.paid|message_count('sms') }} at
{{- ' {:.2f}p'.format(sms_rate * 100) }}</li>
{% if month.sms_paid_count %}
<li class="tabular-numbers">{{ month.sms_paid_count|message_count('sms') }} at
{{- ' {:.2f}p'.format(month.sms_rate * 100) }}</li>
{% endif %}
{% for letter in month.letters%}
{% if letter.billing_units %}
@@ -115,7 +115,7 @@
{{ letter.rate | format_number_in_pounds_as_currency }}</li>
{% endif %}
{% endfor %}
{% if not (month.free or month.paid or month.letters) %}
{% if not (month.sms_free_count or month.sms_paid_count or month.letters) %}
<li aria-hidden="true"></li>
{% endif %}
</ul>