Order & Period Profit Formulas:
- Gross Revenue: Sum of WooCommerce order totals in the date range (excluding
WC_Order_Refund records).
- Cost of Goods Sold (COGS):
Σ (frozen _bizmart_item_cost or resolved purchase_price × quantity).
- Gross Profit (Core):
Gross Revenue − COGS.
- Gross Margin (%):
(Gross Profit ÷ Gross Revenue) × 100.
- Profit After Operating Expenses (Premium):
Gross Profit − Σ (logged bizmart_expenses in date range). (Note: unlogged expenses or corporate income taxes are not deducted unless entered as expenses.)
Inventory Stock Valuation Rules (includes/metrics.php):
- Products with stock management ON use their actual WooCommerce stock quantity.
- Products with stock management OFF but status
instock count as qty = 1 so active un-managed items are not omitted.
- Variable products deduplicate parent vs. variation stock management automatically.
- Negative stock (backorders) is included to reflect real fulfillment liability.
- Results are cached for 10 minutes in transient
bizmart_inventory_totals_v9 and invalidated automatically on stock/cost updates.