sde1000 / quicktill

Figure out where all the money and stock went to
GNU General Public License v3.0
43 stars 8 forks source link

Report on stock sold over time #274

Open sde1000 opened 7 months ago

sde1000 commented 7 months ago

The "stock sold by type" report shows a single quantity sold for the period of the report.

It would be useful to be able to produce a report showing how the amount sold varies over time. This would have stock types as rows, and after the row header would have date ranges as columns. Daily, weekly, monthly and yearly would all be useful date ranges.

Internally this report is going to be quite different to the "stock sold by type" report — it may as well be separate code.

(Implementation note: use a CTE to produce the date ranges for columns so we're not stuck doing min(date) and max(date) within each group.)