When a template expands on an invoice or estimate, each line item is assigned the time that they were created, accurate to the second.
This can mean that items in a template fall on different times.
When a template has its Print Aggregate flag ticked, the items should all be printed as single aggregated line item in estimates and invoices. This fails in the Invoice Items*.jrxml and Estimate Items*.jrxml templates if the items are done at different times; they will be aggregated on the second that they fall on due to the groupExpression:
To avoid this, introduce a group node on participation.productTemplate which is used to:
indicate the sequence of template expansion
support grouping all of the items with the same group number
For historical estimates and invoices that don't have a group on each template item, the existing (broken) grouping technique would be used.
Note that for invoices where items are sorted on date, this will still fail if a template expansion falls over two dates; two line items will be displayed, representing the aggregate of items done on the first and second day.