diff --git a/app/main/views/platform_admin.py b/app/main/views/platform_admin.py index 430c11f49..8c487857c 100644 --- a/app/main/views/platform_admin.py +++ b/app/main/views/platform_admin.py @@ -274,7 +274,7 @@ def notifications_sent_by_service(): @main.route("/platform-admin/reports/usage-for-all-services", methods=['GET', 'POST']) @user_is_platform_admin -def usage_for_all_services(): +def get_billing_report(): form = RequiredDateFilterForm() if form.validate_on_submit(): @@ -286,7 +286,7 @@ def usage_for_all_services(): "contact_names", "contact_email_addresses", "billing_reference" ] - result = billing_api_client.get_usage_for_all_services(start_date, end_date) + result = billing_api_client.get_data_for_billing_report(start_date, end_date) rows = [ [ r["organisation_id"], r["organisation_name"], r["service_id"], r["service_name"], @@ -299,13 +299,13 @@ def usage_for_all_services(): if rows: return Spreadsheet.from_rows([headers] + rows).as_csv_data, 200, { 'Content-Type': 'text/csv; charset=utf-8', - 'Content-Disposition': 'attachment; filename="Usage for all services from {} to {}.csv"'.format( + 'Content-Disposition': 'attachment; filename="Billing Report from {} to {}.csv"'.format( start_date, end_date ) } else: flash('No results for dates') - return render_template('views/platform-admin/usage_for_all_services.html', form=form) + return render_template('views/platform-admin/get-billing-report.html', form=form) @main.route("/platform-admin/complaints") diff --git a/app/navigation.py b/app/navigation.py index 9c3abef18..a6145c95a 100644 --- a/app/navigation.py +++ b/app/navigation.py @@ -89,7 +89,7 @@ class HeaderNavigation(Navigation): 'live_services', 'live_services_csv', 'notifications_sent_by_service', - 'usage_for_all_services', + 'get_billing_report', 'organisations', 'platform_admin', 'platform_admin_list_complaints', diff --git a/app/notify_client/billing_api_client.py b/app/notify_client/billing_api_client.py index 849716b55..ed083692e 100644 --- a/app/notify_client/billing_api_client.py +++ b/app/notify_client/billing_api_client.py @@ -34,8 +34,8 @@ class BillingAPIClient(NotifyAdminAPIClient): data=data ) - def get_usage_for_all_services(self, start_date, end_date): - return self.get(url='/platform-stats/usage-for-all-services', + def get_data_for_billing_report(self, start_date, end_date): + return self.get(url='/platform-stats/data-for-billing-report', params={ 'start_date': str(start_date), 'end_date': str(end_date), diff --git a/app/templates/views/platform-admin/usage_for_all_services.html b/app/templates/views/platform-admin/get-billing-report.html similarity index 91% rename from app/templates/views/platform-admin/usage_for_all_services.html rename to app/templates/views/platform-admin/get-billing-report.html index a99465dfe..068122389 100644 --- a/app/templates/views/platform-admin/usage_for_all_services.html +++ b/app/templates/views/platform-admin/get-billing-report.html @@ -2,13 +2,13 @@ {% from "components/form.html" import form_wrapper %} {% block per_page_title %} - Usage for all services + Billing Report {% endblock %} {% block platform_admin_content %}