diff --git a/app/templates/views/organisations/organisation/index.html b/app/templates/views/organisations/organisation/index.html index c26046906..45ca65a66 100644 --- a/app/templates/views/organisations/organisation/index.html +++ b/app/templates/views/organisations/organisation/index.html @@ -1,3 +1,4 @@ +{% from "components/big-number.html" import big_number %} {% extends "org_template.html" %} {% block org_page_title %} @@ -16,9 +17,37 @@ {{ service.service_name }}
-
{{ service.emails_sent|format_thousands }} emails sent
-
{{ "£{:,.2f}".format(service.sms_cost) }} spent on text messages
-
{{ "£{:,.2f}".format(service.letter_cost) }} spent on letters
+
+ {{ big_number( + service.emails_sent, + label='emails sent', + smallest=True + ) }} +
+
+ {% if service.sms_cost %} + {{ big_number( + service.sms_cost, + 'spent on text messages', + currency="£", + smallest=True + ) }} + {% else %} + {{ big_number( + service.free_sms_limit - service.sms_remainder, + 'free text messages sent', + smallest=True + ) }} + {% endif %} +
+
+ {{ big_number( + service.letter_cost, + 'spent on letters', + currency="£", + smallest=True + ) }} +
{% endfor %} diff --git a/tests/app/main/views/organisations/test_organisation.py b/tests/app/main/views/organisations/test_organisation.py index e2a48d01a..9557ceb94 100644 --- a/tests/app/main/views/organisations/test_organisation.py +++ b/tests/app/main/views/organisations/test_organisation.py @@ -403,7 +403,7 @@ def test_organisation_services_shows_live_services_and_usage( 'free_sms_limit': 250000, 'letter_cost': 30.50, 'sms_billable_units': 122, 'sms_cost': 1.93, 'sms_remainder': None}, {'service_id': SERVICE_TWO_ID, 'service_name': '5', 'chargeable_billable_sms': 0, 'emails_sent': 20000, - 'free_sms_limit': 250000, 'letter_cost': 0, 'sms_billable_units': 2500, 'sms_cost': 0.0, + 'free_sms_limit': 250000, 'letter_cost': 0, 'sms_billable_units': 2500, 'sms_cost': 42.0, 'sms_remainder': None} ]} ) @@ -424,7 +424,7 @@ def test_organisation_services_shows_live_services_and_usage( assert normalize_spaces(usage_rows[2].text) == "£30.50 spent on letters" assert services[1].find('a')['href'] == url_for('main.usage', service_id=SERVICE_TWO_ID) assert normalize_spaces(usage_rows[3].text) == "20,000 emails sent" - assert normalize_spaces(usage_rows[4].text) == "£0.00 spent on text messages" + assert normalize_spaces(usage_rows[4].text) == "£42.00 spent on text messages" assert normalize_spaces(usage_rows[5].text) == "£0.00 spent on letters"