Feature #181
openCanteen: reports
0%
Description
GET reports by key, with from, to, outlet and a csv or json format, csv as UTF-8 with a byte order mark. Built in priority order, stopping when time runs out. Daily sales register. Wastage by recipe and reason. Subsidy by department. Coupon liability. Stock movement and expiry. Portal reports page, one card per category, a date range, run the first 200 rows or download the csv. Acceptance check, the daily sales register opens correctly in Excel with rupee amounts.
NP Updated by Navya P. about 1 month ago
- Status changed from New to Resolved
- Resolved By set to Navya P.
Shipped 30 Sep 2026. All five reports from the plan priority order are built: daily sales register, wastage by recipe and reason, subsidy by department, coupon liability, and stock movement and expiry. Route is GET reports by key with from, to, an optional outlet, and a format of csv or json, csv with a UTF-8 byte order mark so Excel on Windows reads rupee amounts correctly. Sales register adds one GST column per rate actually present in the range rather than assuming fixed slabs. Wastage and stock movement are kitchen section reports, so they ride a second controller with a literal route per key, since a single controller attribute cannot express two different section licences on one route prefix. Subsidy by department widens the employee directory with a department id, agreed with Navya first since the port previously said the module had no business knowing an employee department. Coupon liability and stock movement both fall back to an in memory local date conversion since neither entity carries a stored business date column the way sales and wastage do. Every report keeps the identity issued equals redeemed plus expired plus outstanding where that applies, the same self checking shape the day close journal already uses. Portal reports page has one card per shipped report with a date range, an outlet filter, a run preview capped at two hundred rows, and a csv download. Full suite green throughout: API unit and integration tests, portal tests, and typecheck all pass.