Admin Analytics, Reports & Vendors
Business health visualization, financial statements, and supplier tracking.
1. SVG Daily Sales Chart
The analytics view features custom, lightweight **SVG Area Charts** tracking daily revenue and orders. It calculates coordinates dynamically and maps a smooth conic-gradient donut chart for payment method distribution (UPI vs Card vs Net Banking vs COD).
2. Financial P&L Statement Engine
The **Financials Tab** renders a detailed profit-and-loss sheet calculated using standard marketplace margins:
- Gross Sales: Subtotal + shipping fees collected.
- Deductions: Coupon discounts, cancellations, and refunded returns values.
- Net Sales: Gross Sales minus Deductions.
- COGS (Cost of Goods Sold): Automatically calculated at 60% of purchase price on completed orders.
- Gateway fees: Calculated at 2% of online Net Sales (excludes Cash on Delivery).
- Net Profit: Net Sales - COGS - gateway fees. Margins are displayed as percentages.
3. Bulk Orders Export (Excel/CSV) & Data Logs
The admin orders dashboard features a one-click Export to CSV button to generate structured data backups:
- Export Filters: Operators can export either the entire database ledger or just the currently filtered list of orders (e.g. by status, date range, or seller).
- Comprehensive Ledger mapping: Output includes customer names, emails, phones, shipping addresses, payment status, transaction codes, items purchased (quantities, variants), and totals.
4. Vendor Management & Split Revenue
The vendor panel tracks accounts with the user `role: "vendor"`. It monitors the total count of products listed by each seller, calculates their revenue shares, and lists their joined dates.