Replace manual SMS monthly calculations with API

This starts using the sms_{cost, charged, free_allowance_used}
fields in the new API to replace the "get_free_paid_breakdown"
function we had before, which could not support multiple rates.

In order to use "get_free_paid_breakdown" the calling method had
to store a "cumulative" variable to calculate the free allowance
used so far, which is now done by the API.

To calculate the data for conftest.py, I had to start from the
bottom ("April") and manually calculate the free allowance used
to emulate the API - this is what "cumulative" used to do.
This commit is contained in:
Ben Thorner
2022-04-29 17:44:27 +01:00
parent f6dc30665f
commit d798a0d60f
4 changed files with 105 additions and 86 deletions

View File

@@ -99,7 +99,7 @@
{% endcall %}
{% call field(align='left') %}
{{ big_number(
(item.sms_rate * item.sms_charged) + item.letter_cost,
item.sms_cost + item.letter_cost,
currency="£",
smallest=True
) }}