caktus/django-timepiece — pull request #585 by dpoirier (2013-01-09 19:25:14+00:00)
Title: Track contract hour extensions

We need a better way to track the request/approval process for contract hour extensions. To achieve this, I suggest replacing ``ProjectContract.num_hours`` with a one-to-many relationship to track hours more granularly.

* Add ``ContractHour`` model with:
* ``hours`` field
* ``contract`` FK
* ``date requested`` ``date approved``
* ``status`` field with ``pending`` (default) and ``approved`` options
* optional ``notes`` field
* Add an alert that sends an email to: "accounting@caktusgroup.com" when "date requested" is submitted
* Modify ``ProjectContract`` with:
* remove ``num_hours`` and update code to use ``SUM`` where needed
* ``type`` field with ``fixed``, ``pre-paid hourly`` and ``post-paid hourly`` options
* "add Admin inline for ContractHour model"
* Modify Contract List page: https://portal.caktusgroup.com/timepiece/contract/list/ with:
* Move Percent Complete field to Hours Worked column and place data in parens next to Hours Worked
* Add new requested hours to Contract Hours column in parens maybe in a different color and prepend with a plus sign as in (+ 100)
* Modify Contract Detail page: https://portal.caktusgroup.com/timepiece/contract/XYZ/ with contract history:
* Contract history including hours, dates and any corresponding notes
* Contract hour extension history showing hours requested, date requested, date approved and any corresponding notes
* Post-paid contract history showing hours requested, date requested, date approved and any corresponding notes

The goal is to help track:
* Pre-paid hourly contracts: How many hours have been pre-paid, how many hours are pending payment
* Alert accounting that a contract hour extension request has been made so they can issuea an invoice
* Post-paid hourly contracts: How many hours have been approved