Update ft_billing DAO functions to use postage

* Updated the 'fetch_billing_data_for_day' DAO function to take postage into
account
* Updated the 'update_fact_billing' DAO function to insert postage for
new rows. When updating rows which are identical apart from the postage, the
original row will be kept. (This behaviour will change once postage is
added to the primary key - at this point, upserting will add a new row.)
* Also changed some fixtures / test set up functions to take postage
into account
This commit is contained in:
Katie Smith
2018-09-26 11:28:59 +01:00
parent 0b5da2b8ad
commit 6727f0e0f5
6 changed files with 95 additions and 14 deletions

View File

@@ -512,7 +512,8 @@ def create_ft_billing(bst_date,
international=False,
rate=0,
billable_unit=1,
notifications_sent=1
notifications_sent=1,
postage='none',
):
if not service:
service = create_service()
@@ -528,7 +529,8 @@ def create_ft_billing(bst_date,
international=international,
rate=rate,
billable_units=billable_unit,
notifications_sent=notifications_sent)
notifications_sent=notifications_sent,
postage=postage)
db.session.add(data)
db.session.commit()
return data