Commit Graph

8 Commits

Author SHA1 Message Date
venusbb
6f7793d761 - Add update dao_update_annual_billing_for_current_and_future_years
- moved get_current_financial_year_start_year from service.utils to dao.date_utils
- Moved logic for data persistence from rest to dao when updating records in db
2017-11-02 12:38:43 +00:00
venusbb
b2fa7cdd83 create new table annual_billing 2017-10-18 15:35:51 +01:00
Imdad Ahad
2371c2c9a7 Add helper to get months for a financial year:
* No tests have been added as this was taken from the admin
  where it is already tested thoroughly.
* TODO: Move to utils
2017-08-18 12:45:05 +01:00
Imdad Ahad
782f3ea693 Rename method to get start and end date of a month for clarity 2017-08-11 16:56:47 +01:00
Rebecca Law
b62ee8380c Use BST to calculate monthly billing 2017-07-25 17:38:53 +01:00
Rebecca Law
9400988d72 Monthly billing - part 1
This is still a work in progress but it would be good to get some eyes on it.
This commit includes creating and updating a row in the monthly billing table and a method to fetch the results.
There is a command to populate the monthly billing for a service and month so we can try it out.
The total cost at the moment are wrong, they do not take into account the free allowance - see notes below about adding that to the table.
Left to do:
create a nightly task to run to update the monthly totals.
create an endpoint to return the yearly billing, the current day will need to be calculated on the fly and added to the totals.
Add the free allowance into the total costs.
2017-07-18 18:21:35 +01:00
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
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