Rename usage report to billing report

Because only services with bills to pay are included, and
we started including billing details.

Also rename endpoints and file names to match this.
This commit is contained in:
Pea Tyczynska
2021-03-15 18:04:01 +00:00
parent 95f46ced8a
commit 38cfee6390
6 changed files with 17 additions and 17 deletions

View File

@@ -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")

View File

@@ -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',

View File

@@ -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),

View File

@@ -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 %}
<h1 class="heading-large">
Usage for all services
Billing Report
</h1>
{% call form_wrapper() %}

View File

@@ -17,6 +17,6 @@
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('main.notifications_sent_by_service') }}">Monthly notification statuses for live services</a>
</p>
<p class="govuk-body">
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('main.usage_for_all_services') }}">Usage for all services</a>
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('main.get_billing_report') }}">Billing Report</a>
</p>
{% endblock %}