Guys, I need to display a list of sales between 2 dates. Using a repeater. Now I want an optional sub-total of sales per month within those 2 dates.
Example
Start : Jan 1, 2021
End : April 30, 2021
What to display? Every sale with a subtotal per month (so Jan/Feb/MArch/April) and a grand total all the way at the bottom.
The question:
How would I approach this. I see 2 possibilities:
a)before throwing .data to repeater, loop thru the array, calc subtotals/total and insert a row into the array per subtotal
b)put a second, collapsed box inside repeater (underneath the box which displays sales per date). Calculate (sub)total per row and always fill this box with (sub)totals. If end_of_month, expand it.
Curious what the best approach (or any other) would be.