Rewrite reports
Reports shouldn't be a raw SQL request anymore. They should have a new definition, probably with higher level, base upon the basic reports (sales). The new definition will define a new report API with more flexibility for custom reports.
Expected outputs are generally:
- sale amounts
- tax amounts
- product sales (raw sales or margin)
- category sales
- payment checks
- customer's history
Input main data can hold:
- dates and cash sessions
- cash registers
- categories
- products
- taxes
Other useful data can be:
- users
- customers
- discount profiles
- tariff areas
- payment modes
Output filters can be hard-coded for the basic ones (currency/date format), custom filters could be left for now (expected/actual cash matching color).