Take sms_rate from monthly usage data

At the moment, we put the sms rate on the usage page for each
months billing data by taking the single sms rate for the year.

The assumption that there will be a single sms rate for the year is
no longer going to be true. Therefore, instead we take the sms
rate from the monthly data itself which tells us the rate for
a months worth of sent SMS.
This commit is contained in:
David McDonald
2022-04-25 11:48:50 +01:00
parent d18c787a02
commit 2706ec4c73
3 changed files with 109 additions and 16 deletions

View File

@@ -97,7 +97,7 @@
{% endcall %}
{% call field(align='left') %}
{{ big_number(
(sms_rate * month.sms_paid_count) + month.letter_total,
(month.sms_rate * month.sms_paid_count) + month.letter_total,
currency="£",
smallest=True
) }}
@@ -107,7 +107,7 @@
{% endif %}
{% if month.sms_paid_count %}
<li class="tabular-numbers">{{ month.sms_paid_count|message_count('sms') }} at
{{- ' {:.2f}p'.format(sms_rate * 100) }}</li>
{{- ' {:.2f}p'.format(month.sms_rate * 100) }}</li>
{% endif %}
{% for letter in month.letters%}
{% if letter.billing_units %}