Commit Graph

8 Commits

Author SHA1 Message Date
Rebecca Law
3e0221adec Change get_financial_year to return ending date as 1 microsecond earlier.
That way we can write the queries as between start and end dates, making it easier to read.
This makes more sense.
2017-05-02 10:00:47 +01:00
Rebecca Law
88d92d6070 Fix the logic gettting the rates for a financial year.
The is_between_end_date_exclusive is a bit funny.
Perhaps the better way to handle it is to make the function is_between but change the financial year function return an enddate that is one millisecond less. That way we can always use the between logic and it will be easier to use.
2017-04-28 16:55:41 +01:00
Rebecca Law
1a64509186 Change the resultset from the yearly and monthly billing data queries.
Fix some formatting of the return objects.
2017-04-28 10:10:49 +01:00
Rebecca Law
fdbadf967e Fix the email billing data when there is no results. 2017-04-28 10:10:48 +01:00
Rebecca Law
a186fc95be Added new endpoints to return the yearly-usage and monthly-usage for a given financial year and service id.
Since the response has changed I have created new endpoints so that the deployments for Admin are more managable.

Removed print statements from some tests.
2017-04-28 10:10:48 +01:00
Rebecca Law
e1e55edd9c Add new fields to the usage queries: rate_multiplier, international, phone_prefix. 2017-04-28 10:10:48 +01:00
Rebecca Law
4c37c8bdbb New query to get billing data per month. 2017-04-28 10:10:48 +01:00
Rebecca Law
6dc336ad6c Created new queries to return the rate with the sum of billable units for the year totals.
Once we have the new columns in notifications table, the query will need to include the rate multiplier and if the number is international.
The monthly billing query will be built next.
2017-04-28 10:10:48 +01:00