Fix product analytics showing 0 — query InvoiceItem for revenue/units sold
Products with track_inventory=false never create InventoryMovements on sale,
so the old movement-based queries always returned 0. Revenue and units sold
now come from InvoiceItem (the authoritative source for what was actually
invoiced). Stock-in (إجمالي الوارد) still uses InventoryMovement since that
genuinely is a stock-receipt concept. Added إجمالي الإيرادات KPI card.
Co-Authored-By:
Claude Opus 4.8 <noreply@anthropic.com>
Showing
Please register or sign in to comment