diff --git a/app/main/views/organisations.py b/app/main/views/organisations.py index 05b4fec6d..43959dabd 100644 --- a/app/main/views/organisations.py +++ b/app/main/views/organisations.py @@ -125,10 +125,14 @@ def add_organisation_from_nhs_local_service(service_id): @main.route("/organisations/", methods=['GET']) @user_has_permissions() def organisation_dashboard(org_id): - services = current_organisation.services_and_usage() + services = current_organisation.services_and_usage()['services'] return render_template( 'views/organisations/organisation/index.html', - services=services + services=services, + **{ + f'total_{key}': sum(service[key] for service in services) + for key in ('emails_sent', 'sms_cost', 'letter_cost') + } ) diff --git a/app/templates/views/organisations/organisation/index.html b/app/templates/views/organisations/organisation/index.html index 45ca65a66..31c70be72 100644 --- a/app/templates/views/organisations/organisation/index.html +++ b/app/templates/views/organisations/organisation/index.html @@ -11,8 +11,34 @@ Usage +
+
+ {{ big_number( + total_emails_sent, + label='emails sent', + smaller=True + ) }} +
+
+ {{ big_number( + total_sms_cost, + 'spent on text messages', + currency="£", + smaller=True + ) }} +
+
+ {{ big_number( + total_letter_cost, + 'spent on letters', + currency="£", + smaller=True + ) }} +
+
+