Details
Description
When service line items are added, they include the service renew date range from the start date to the renew date,
e.g. a 1 month term could be:
(Jan 1, 2014 - Feb 1, 2014)
i.e.
(date_added - date_renews)
When the service renews, however, the start date is determined as the last renew date, or the date added,
i.e.
([date_last_renewed if not null otherwise date_added] - date_renews)
The problem with this is that the first time a service renews, there is no last renew date, and so it uses the date the service was added.
e.g.
Manual Service Invoice (correct):
(Jan 1, 2014 - Feb 1, 2014)
Renewed Service Invoice (incorrect - starts in February):
(Jan 1, 2014 - Mar 1, 2014)
A similar situation occurs with prorated services:
e.g. Manual:
(Jan 27, 2014 - Feb 1, 2014)
Renewed:
(Jan 27, 2014 - March 1, 2014)
Additionally, and possibly a separate task, the last renew date for a service does not always get updated, which can cause these line item dates to be off by larger margins.
Consider a 1 month service that was created in January 2014, but has never renewed. When the cron runs to catch up, the last renew date is only updated once, which results in:
Created January 1, 2014, renews February 1, 2014
Renews February 1, 2014 - March 1, 2014
Renews February 1, 2014 - April 1, 2014
Renews February 1, 2014 - May 1, 2014
...- CORE-1484
This issue may be isolated to the cron renewing services by updating renew dates after the invoice was already created.
So if the service was added for January 15 -> February 15, it would be renewed for February 15 -> March 15, but the invoice line item on renewal would say January 15 -> February 15 instead of February 15 -> March 15.