Add total_letters to the billing report

This adds an extra column to the report that can be downloaded from
`platform-admin/reports/usage-for-all-services`.
This commit is contained in:
Katie Smith
2021-06-11 11:08:33 +01:00
parent e7713de4a5
commit c1bfc280b7
2 changed files with 5 additions and 3 deletions

View File

@@ -282,7 +282,7 @@ def get_billing_report():
end_date = form.end_date.data
headers = [
"organisation_id", "organisation_name", "service_id", "service_name",
"sms_cost", "sms_fragments", "letter_cost", "letter_breakdown", "purchase_order_number",
"sms_cost", "sms_fragments", "total_letters", "letter_cost", "letter_breakdown", "purchase_order_number",
"contact_names", "contact_email_addresses", "billing_reference"
]
try:
@@ -297,7 +297,7 @@ def get_billing_report():
rows = [
[
r["organisation_id"], r["organisation_name"], r["service_id"], r["service_name"],
r["sms_cost"], r["sms_fragments"], r["letter_cost"], r["letter_breakdown"].strip(),
r["sms_cost"], r["sms_fragments"], r["total_letters"], r["letter_cost"], r["letter_breakdown"].strip(),
r.get("purchase_order_number"), r.get("contact_names"), r.get("contact_email_addresses"),
r.get("billing_reference")
]