Rename ambiguous "sms_chargeable" Jinja variable

Now that we have the term "charge*able*_units" we should clarify
this variable is the number we will actually charge for.
This commit is contained in:
Ben Thorner
2022-04-26 15:44:15 +01:00
parent e0aa51c306
commit 715a3c137f
2 changed files with 3 additions and 3 deletions

View File

@@ -346,7 +346,7 @@ def get_annual_usage_breakdown(usage, free_sms_fragment_limit):
'sms_free_allowance': sms_free_allowance,
'sms_sent': sms_chargeable_units,
'sms_allowance_remaining': max(0, (sms_free_allowance - sms_chargeable_units)),
'sms_chargeable': max(0, sms_chargeable_units - sms_free_allowance),
'sms_charged': max(0, sms_chargeable_units - sms_free_allowance),
'sms_cost': sms_cost,
'sms_rate': sms_rate,
'letter_sent': letters_sent,

View File

@@ -33,9 +33,9 @@
{% if sms_free_allowance > 0 %}
{{ big_number(sms_allowance_remaining, 'free allowance remaining', smaller=True) }}
{% endif %}
{% if sms_chargeable %}
{% if sms_charged %}
{{ big_number(
sms_chargeable,
sms_charged,
'at {:.2f} pence per message'.format(sms_rate * 100),
smaller=True
) }}