Update name of method to clarify the meaning.

Update group by to use label.
Update test.
This commit is contained in:
Rebecca Law
2018-04-25 17:00:19 +01:00
parent cff731c52d
commit 51af6b27a0
2 changed files with 10 additions and 7 deletions

View File

@@ -20,7 +20,7 @@ from app.models import (
from app.utils import convert_utc_to_bst, convert_bst_to_utc
def fetch_annual_billing_for_year(service_id, year):
def fetch_montly_billing_for_year(service_id, year):
year_start_date, year_end_date = get_financial_year(year)
utcnow = datetime.utcnow()
today = convert_utc_to_bst(utcnow).date()
@@ -45,7 +45,7 @@ def fetch_annual_billing_for_year(service_id, year):
FactBilling.bst_date >= year_start_date,
FactBilling.bst_date <= year_end_date
).group_by(
extract('month', FactBilling.bst_date),
'Month',
FactBilling.service_id,
FactBilling.rate,
FactBilling.rate_multiplier,