notify-api-332 rename organisation

This commit is contained in:
Kenneth Kehl
2023-07-10 11:06:29 -07:00
parent 8be3864d7a
commit 4940d5e93b
42 changed files with 1301 additions and 1274 deletions

View File

@@ -77,8 +77,8 @@ def get_data_for_billing_report():
for s in sms_costs:
if float(s.sms_cost) > 0:
entry = {
"organisation_id": str(s.organisation_id) if s.organisation_id else "",
"organisation_name": s.organisation_name or "",
"organization_id": str(s.organization_id) if s.organization_id else "",
"organization_name": s.organization_name or "",
"service_id": str(s.service_id),
"service_name": s.service_name,
"sms_cost": float(s.sms_cost),
@@ -99,8 +99,8 @@ def get_data_for_billing_report():
# sorting first by name == '' means that blank orgs will be sorted last.
result = sorted(combined.values(), key=lambda x: (
x['organisation_name'] == '',
x['organisation_name'],
x['organization_name'] == '',
x['organization_name'],
x['service_name']
))
return jsonify(result)
@@ -158,8 +158,8 @@ def volumes_by_service_report():
report.append({
"service_name": row.service_name,
"service_id": str(row.service_id),
"organisation_name": row.organisation_name if row.organisation_name else '',
"organisation_id": str(row.organisation_id) if row.organisation_id else '',
"organization_name": row.organization_name if row.organization_name else '',
"organization_id": str(row.organization_id) if row.organization_id else '',
"free_allowance": int(row.free_allowance),
"sms_notifications": int(row.sms_notifications),
"sms_chargeable_units": int(row.sms_chargeable_units),