fix: report cancellation bugs + missing OrderItem model columns
Backend: - OrderItem model: add cancelled_at, cancelled_by, cancel_reason columns (migration existed but model was missing them — caused 500 on cancellations_log) - shifts.py _enrich_shift: count cancellations by quantity sum (not row count), add cancellation_value (sum of unit_price * quantity) - reports.py current business day: add cancelled_items count (per-item quantity sum, across all orders in the day, not just fully-cancelled orders) Manager dashboard: - PrintFontsTab: fix SSE auth token key (access_token → manager_token, was causing 403) - Today: show cancelled_items count as sub-label on Ακυρώσεις stat card - OrderHistory: items/cancellations columns now use quantity sum, not row count - WorkDaySummary drill-down: same quantity-sum fix - ShiftsOverview: add Αξία Ακυρ. column next to Ακυρώσεις Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -804,7 +804,7 @@ function FindPrintersModal({ onClose, onSelect }) {
|
||||
setError(null)
|
||||
setScanning(true)
|
||||
|
||||
const token = localStorage.getItem('access_token') || ''
|
||||
const token = localStorage.getItem('manager_token') || ''
|
||||
const params = new URLSearchParams({ subnet, port })
|
||||
// Use fetch with ReadableStream to consume SSE (EventSource doesn't support auth headers)
|
||||
fetch(`/api/system/printers/scan?${params}`, {
|
||||
|
||||
Reference in New Issue
Block a user