feat: ShiftDetailModal rework, Today cancellation events, shift details icon button
- Backend: add cancellation_events (row count) to _enrich_shift and shift summary - Backend: add cancellation_events field to current business day endpoint - Today tab: hero number now shows cancellation_events (distinct cancel actions), sub-label shows 'X παραγγελίες / Y είδη' - ShiftsOverview: Λεπτομέρειες button is now icon-only (Eye, light blue) matching the delete button style - ShiftDetailModal: modal widened to 1080px; ΠΑΡΑΔΟΘΗΚΑΝ KPI replaced with Ακυρώσεις showing 'X events / Y items'; all filter labels renamed (Πλήρης Παραγγελία, Μόνο Πληρώθηκε, Μόνο Παρήγγειλε, Ανοιχτό ακόμη); new Ακυρώθηκε filter added; cancelled items shown in red, Πληρώθηκε line hidden for cancelled; legend updated; classify() handles cancelled status before other checks Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1263,12 +1263,17 @@ def current_business_day(
|
||||
# Count cancelled items (individual items cancelled, across all orders in this day)
|
||||
all_order_ids = [o.id for o in orders]
|
||||
cancelled_items_qty = 0
|
||||
cancellation_events = 0
|
||||
if all_order_ids:
|
||||
from sqlalchemy import func as sqlfunc
|
||||
cancelled_items_qty = db.query(sqlfunc.sum(OrderItem.quantity)).filter(
|
||||
OrderItem.order_id.in_(all_order_ids),
|
||||
OrderItem.status == "cancelled",
|
||||
).scalar() or 0
|
||||
cancellation_events = db.query(sqlfunc.count(OrderItem.id)).filter(
|
||||
OrderItem.order_id.in_(all_order_ids),
|
||||
OrderItem.status == "cancelled",
|
||||
).scalar() or 0
|
||||
|
||||
return {
|
||||
"business_day": {
|
||||
@@ -1283,6 +1288,7 @@ def current_business_day(
|
||||
"active_waiters": len(active_shifts),
|
||||
"cancellations": len(cancelled_orders),
|
||||
"cancelled_items": int(cancelled_items_qty),
|
||||
"cancellation_events": int(cancellation_events),
|
||||
"top_product": top_product,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user