feat: the venue and products reports on v2 (platform-v2 step 6.12b)
- Reports -> Venue (src/pages/reports/store): business days (revenue/profit trend, each day's times, orders, revenue, fees, refunds, cost, profit; a day opens with its orders and shifts, a shift opens the overview's shift dialog; the owner corrects a closing time, deletes an empty day or a shift), orders (filters by status, person, table; per-order products / fees / refunds), busy times (by hour, by weekday of the business date), trends (days, weeks, months, the 7-day average), tables (time at the table, per visit, revenue) - Reports -> Products (src/pages/reports/products): products (units, revenue, refunded, cost, profit, margin, waste, share; top 10 by revenue, units or profit) and categories (share bars, profit share) - kit: PrintDialog (receipt printer, summary / full, or print the page), TrendChart and BarList on tokens (no chart animation), printBody() - access: deleting a business day or a shift (which erases its orders) is owner-only (core.settings.manage; was any dashboard user) - v1 StorePage, ProductsReportPage and their seven views removed - tests: reports.test.mjs (+1), e2e manager.mjs (every tab, a day, products revenue = the backend's, Greek) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from core.access.deps import require
|
||||
from core.timeutil import business_date_of, parse_api_datetime, utcnow
|
||||
from fastapi import APIRouter, Depends, status
|
||||
from sqlalchemy import func
|
||||
@@ -209,7 +210,7 @@ def patch_business_day(
|
||||
def delete_business_day(
|
||||
day_id: int,
|
||||
db: Session = Depends(get_db),
|
||||
user: User = Depends(require_manager),
|
||||
user: User = Depends(require("core.settings.manage")),
|
||||
):
|
||||
"""Permanently delete a business day. Only allowed when it has no shifts."""
|
||||
day = db.query(BusinessDay).filter(BusinessDay.id == day_id).first()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from core.access.deps import require
|
||||
from core.access.check import holds
|
||||
from core.timeutil import utcnow
|
||||
from fastapi import APIRouter, Depends, status
|
||||
@@ -391,7 +392,7 @@ def get_shift(
|
||||
def delete_shift(
|
||||
shift_id: int,
|
||||
db: Session = Depends(get_db),
|
||||
user: User = Depends(require_manager),
|
||||
user: User = Depends(require("core.settings.manage")),
|
||||
):
|
||||
"""Permanently delete a shift, its breaks, and all orders opened during that shift."""
|
||||
from models.order import Order, OrderItem, OrderAuditLog, OrderWaiter
|
||||
|
||||
Reference in New Issue
Block a user