Currently, the end time of the period was always the creation time of
the invoice (due to the initialisation), as it is generally by definition
later than any of the task periods.
I've chosen to connect the callback to before_validation because
at a later point we want to check for overlap between time entries
and this should be done using the corrected versions.
The method uses the configuration to determine the resolution and is
inspired by the following StackOverflow answer:
https://stackoverflow.com/a/4182700.
They are inserted in the titles of the time entry links so they are
shown when hovering over them.
Also fixed "None" not being displayed when there was no time entry
comment.
This fixes misrepresentation errors. This occus for example when a task
has a length that would be represented using a floating point number that
has more than 2 decimals.
For example: a task of length 59 minutes (i.e. 0.9833333333333333... hour)
is shown on the invoice as having a length of 0.98 hours while in
calculations still the unrounded task length is used. When a hourly rate
of €100 pe rhour is defined, the invoice will show:
0.98h x €100/h = €98.33.
which is confusing and although correct given maximal accurancy, it will
obviously not be accepted by book keeping programs.
As billed fixed-cost tasks cannot have an active task, the task itself
still is the one that is billed. Show the task under itself to expose
the fact that it is billed and in which invoice.
Billed fixed-cost tasks will have no active task once they are billed,
because invoicing a fixed-cost will not split off a task but manipulate the
active one into being billed.
Generation of a time specification appendix can be enabled for each invoice
indepently on whether it is or is not enabled for the customer. However,
whether it is enabled by default when an invoice is created, that does
follow the setting for the customer.
If time specifications are enabled for a customer this is considered to be
a global setting for invoices related to this customer.
Note that it will note change any of the existing voices, it will only
affect newly created ones!