The sheet count was not calculated properly (it should be billable_units/notifications_sent).

And it turns out the sheet count is not required for the report. This PR takes out the columns to resolve the group by error.
This commit is contained in:
Rebecca Law
2019-09-03 13:16:08 +01:00
parent d83a9fee05
commit e64ae321cf
3 changed files with 9 additions and 8 deletions

View File

@@ -149,7 +149,6 @@ def fetch_letter_line_items_for_all_services(start_date, end_date):
Organisation.id.label("organisation_id"),
Service.name.label("service_name"),
Service.id.label("service_id"),
FactBilling.billable_units.label("sheet_count"),
FactBilling.rate.label("letter_rate"),
FactBilling.postage.label("postage"),
func.sum(FactBilling.notifications_sent).label("letters_sent"),
@@ -168,7 +167,6 @@ def fetch_letter_line_items_for_all_services(start_date, end_date):
Organisation.id,
Service.id,
Service.name,
FactBilling.billable_units,
FactBilling.rate,
FactBilling.postage
).order_by(