Feature #663
openEmployee meals: match the prototype, fix card ownership, add payroll export
0%
Description
Matched pages/employee-meals.html, with three real corrections along the way:
- Removed "Issue card" from the employee detail dialog. A meal card is HR's to issue -- joining creates it automatically -- this module only blocks one that was lost or replaces one already issued. An employee with no card yet now reads "No card issued -- that comes from HR, not from here" instead of offering a button that implied Canteen could create one. Also fixed the card lookup itself, which only matched Active status -- a Blocked employee's card lookup returned nothing and silently fell into the same "Issue card" branch instead of showing the blocked state.
- Removed the "Subsidy rules in force" panel's own "Edit" button -- redundant with the page's header "Subsidy rules" button doing the exact same navigation to Settings, and rules are HR's to set, not something to jump into editing from this card.
- Rebuilt the employee detail dialog to match the prototype's layout: Meals/Gross/Subsidy/Payable tiles, a capped-month notice, and a real "Today" transactions table -- added an EmployeeId filter to SaleRegisterQuery/SaleRegisterService (one employee's own sales, never a colleague's) to back it, rather than fabricating the rows.
Added the header's "Payroll deduction file" button and its modal, matching the prototype's own layout and columns. Kept one deliberate difference: the prototype's button sends a live payroll deduction (ADR-0003 says v1 never does that -- every sale already settles in cash/UPI at the counter, subsidy applied live) and claims "no cash changes hands... for payroll grades", which isn't true here. Built as a subsidy report for HR's own cost-centre records instead: both "Preview CSV" and "Send to Payroll" read the same statement CSV the per-employee dialog's "Monthly statement" link already uses (so every real figure, no new fake data), and the service already audits every export as AuditActions.Exported -- that audit trail is the "record" this needed, with no new backend entity.
1 new SaleRegisterServiceTests case for the EmployeeId filter. 1054/1056 backend (only the two pre-existing date-fragile Coupon_liability tests failing), 582/582 frontend.
Commit: a1419e4.