Product margin analysis
Measure revenue, cost, and margin performance by product using posted customer and vendor invoice data.
The product_margin module adds a product-level analysis layer that compares sales turnover, purchasing costs, and the gap between actual values and standard pricing assumptions. It is useful for accountants, sales managers, and product owners.
Because the report is built from invoice data, it reflects financially recorded reality rather than just list prices or planning assumptions.
Core indicators
| Fields | Trường dữ liệu | Description |
|---|---|---|
| Turnover | Doanh thu | Total sales invoice value after discount. |
| Total Cost | Tổng chi phí | Total purchasing cost taken from vendor invoices after supplier discounts. |
| Total Margin | Lợi nhuận thực tế | Actual margin calculated from real turnover minus real cost. |
| Expected Margin | Lợi nhuận kỳ vọng | Theoretical margin based on expected sales and standard cost. |
| Sales Gap | Chênh lệch doanh thu | Difference between expected sales value and actual turnover. |
| Purchase Gap | Chênh lệch chi phí | Difference between standard cost and actual purchasing cost. |
Opening the margin report
Steps
1. Go to Sales → Reporting → Product Margins or Inventory → Reporting → Product Margins.
2. Choose the From and To dates for the analysis period.
3. Select Invoice State according to the invoice completion level you want included.
4. Click Open to load the product list with margin metrics.
Meaning of Invoice State options
| State | Includes | Best use case |
|---|---|---|
| Paid | Fully paid invoices only | Cash-realized or fully settled profit analysis |
| Open and Paid | Posted invoices including unpaid and paid | Operational commercial analysis of live invoice activity |
| Draft, Open and Paid | Both draft and posted invoices | Pipeline review before close or broader forecasting |
How to read sales indicators
Sales-side metrics
| Metric | Interpretation | Notes |
|---|---|---|
| # Invoiced in Sale | Total product quantity on sales invoices | Credit notes can reduce the net quantity |
| Avg. Sale Unit Price | Average selling unit price | Turnover divided by invoiced sale quantity |
| Turnover | Actual realized sales value | Discounted and converted to company currency |
| Expected Sale | Revenue if sold at list price | Useful as a benchmark against real selling behavior |
| Sales Gap | Difference between expected sale and actual turnover | Helps spot discounting or above-list sales |
How to read purchase indicators
Purchase-side metrics
| Metric | Interpretation | Notes |
|---|---|---|
| # Invoiced in Purchase | Total quantity recorded on vendor-side invoices | Usually includes bills and refunds per report logic |
| Avg. Purchase Unit Price | Average purchase unit price | Shows the real average sourcing price |
| Total Cost | Actual purchasing cost | Reflects supplier discounts |
| Normal Cost | Standard cost benchmark | Computed from standard product cost |
| Purchase Gap | Difference between standard and actual cost | Helps detect favorable or unfavorable sourcing outcomes |
Important margin formulas
Margin formulas
| Metric | Formula | Management meaning |
|---|---|---|
| Total Margin | Turnover - Total Cost | Actual commercial margin from recorded transactions |
| Total Margin Rate | Total Margin / Turnover × 100 | Actual profit rate |
| Expected Margin | Expected Sale - Normal Cost | Reference margin under standard pricing assumptions |
| Expected Margin Rate | Expected Margin / Expected Sale × 100 | Reference rate for comparing with actual performance |
Filtering and business analysis
Key points
• Use List View to isolate profitable or loss-making products and compare multiple metrics side by side.
• Use Graph View to understand trends by category, product, or salesperson.
• Grouping by Category helps reveal which product families generate the strongest margin and which dilute it.
• Filtering on Total Margin < 0 is a quick way to identify loss-making products in a chosen period.
• Large Sales Gap values may indicate heavy discounting or outdated list pricing.
Common real-world use cases
Typical analysis scenarios
| Scenario | How to read the report | Suggested action |
|---|---|---|
| Find loss-making products in a quarter | Filter Total Margin < 0 for the target period | Review sales price, supplier cost, or decide whether to retire the product |
| Detect excessive discounting | Compare Expected Sale against Turnover and monitor Sales Gap | Review discount policy or update list pricing |
| Identify top-profit products | Sort by Total Margin descending | Prioritize marketing, stock availability, and sourcing for strong performers |
| Compare margin by category | Group by Category | Invest more in stronger categories and fix weaker ones |
Data and performance notes
Key points
• The report is driven by account.move invoice data, so uninvoiced orders are not directly represented.
• All numbers are converted into the company currency, so exchange rates should be maintained properly.
• Several metrics are computed fields and depend on date context, which is why results change with report filters.
• For large datasets, narrowing the analysis window improves query speed and usability.