mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
revert scalars
This commit is contained in:
@@ -604,7 +604,7 @@ def fetch_sms_billing_for_organization(organization_id, financial_year):
|
|||||||
sms_cost = func.sum(ft_billing_subquery.c.cost)
|
sms_cost = func.sum(ft_billing_subquery.c.cost)
|
||||||
|
|
||||||
query = (
|
query = (
|
||||||
db.session.query(
|
select(
|
||||||
Service.name.label("service_name"),
|
Service.name.label("service_name"),
|
||||||
Service.id.label("service_id"),
|
Service.id.label("service_id"),
|
||||||
AnnualBilling.free_sms_fragment_limit,
|
AnnualBilling.free_sms_fragment_limit,
|
||||||
@@ -630,7 +630,7 @@ def fetch_sms_billing_for_organization(organization_id, financial_year):
|
|||||||
.order_by(Service.name)
|
.order_by(Service.name)
|
||||||
)
|
)
|
||||||
|
|
||||||
return query.all()
|
return db.session.execute(query).all()
|
||||||
|
|
||||||
|
|
||||||
def query_organization_sms_usage_for_year(organization_id, year):
|
def query_organization_sms_usage_for_year(organization_id, year):
|
||||||
@@ -671,7 +671,7 @@ def query_organization_sms_usage_for_year(organization_id, year):
|
|||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
db.session.query(
|
select(
|
||||||
Service.id.label("service_id"),
|
Service.id.label("service_id"),
|
||||||
FactBilling.local_date,
|
FactBilling.local_date,
|
||||||
this_rows_chargeable_units.label("chargeable_units"),
|
this_rows_chargeable_units.label("chargeable_units"),
|
||||||
@@ -746,7 +746,7 @@ def fetch_usage_year_for_organization(organization_id, year):
|
|||||||
|
|
||||||
def fetch_billing_details_for_all_services():
|
def fetch_billing_details_for_all_services():
|
||||||
billing_details = (
|
billing_details = (
|
||||||
db.session.query(
|
select(
|
||||||
Service.id.label("service_id"),
|
Service.id.label("service_id"),
|
||||||
func.coalesce(
|
func.coalesce(
|
||||||
Service.purchase_order_number, Organization.purchase_order_number
|
Service.purchase_order_number, Organization.purchase_order_number
|
||||||
@@ -762,11 +762,12 @@ def fetch_billing_details_for_all_services():
|
|||||||
Service.billing_reference, Organization.billing_reference
|
Service.billing_reference, Organization.billing_reference
|
||||||
).label("billing_reference"),
|
).label("billing_reference"),
|
||||||
)
|
)
|
||||||
|
.select_from(Service)
|
||||||
.outerjoin(Service.organization)
|
.outerjoin(Service.organization)
|
||||||
.all()
|
.all()
|
||||||
)
|
)
|
||||||
|
|
||||||
return billing_details
|
return db.session.execute(billing_details).all()
|
||||||
|
|
||||||
|
|
||||||
def fetch_daily_volumes_for_platform(start_date, end_date):
|
def fetch_daily_volumes_for_platform(start_date, end_date):
|
||||||
|
|||||||
Reference in New Issue
Block a user