S34
Cost Variance Reporting
Product cost variance analysis with trend detection, severity categorization, and purchasing recommendations.
Route/cost-variance-reporting
Entry pathAnalytics nav > Cost Variance Reporting
Detailed source
21-UC-CostVarianceReporting.md
UC-COSTVAR: Cost Variance Reporting Page Use Cases
Page: CostVarianceReporting.razor
Route: /cost-variance-reporting
Menu Position: 20 (Analytics & Tracking > Cost Variance Reporting)
Overview
Product cost variance analysis with trend detection, severity categorization, and purchasing recommendations.
Section: Page Header & Actions
| ID |
Section |
Action |
Expected Outcome |
Controls Affected |
| UC-COSTVAR-001 |
Header |
Load page |
Title "Cost Variance Reporting - [BusinessName]", card header with chart-line icon |
PageTitle, card-header bg-warning |
| UC-COSTVAR-002 |
Header |
No business selected |
Alert "Please select a business to view cost variance reporting" |
alert alert-info |
| UC-COSTVAR-003 |
Actions |
Click "Refresh Report" |
Reloads all variance data |
Refresh Report btn |
Section: Date Filter
| ID |
Section |
Action |
Expected Outcome |
Controls Affected |
| UC-COSTVAR-004 |
Filter |
Default From Date |
6 months ago |
From Date input |
| UC-COSTVAR-005 |
Filter |
Default To Date |
Today |
To Date input |
| UC-COSTVAR-006 |
Filter |
Change date and Apply |
Click Apply Filter reloads data for new range |
Apply Filter btn |
Section: Loading State
| ID |
Section |
Action |
Expected Outcome |
Controls Affected |
| UC-COSTVAR-007 |
Loading |
During load |
Spinner with "Analyzing cost variances..." |
spinner-border |
Section: Summary Cards (4 cards)
| ID |
Section |
Action |
Expected Outcome |
Controls Affected |
| UC-COSTVAR-008 |
Summary |
Total Products |
Blue card (bg-primary), count with boxes icon |
First card |
| UC-COSTVAR-009 |
Summary |
Cost Increases |
Red card (bg-danger), count with up arrow icon |
Second card |
| UC-COSTVAR-010 |
Summary |
Cost Decreases |
Green card (bg-success), count with down arrow icon |
Third card |
| UC-COSTVAR-011 |
Summary |
Avg Variance |
Info card (bg-info), percentage with percent icon |
Fourth card |
Section: Product Cost Variance Table
| ID |
Section |
Action |
Expected Outcome |
Controls Affected |
| UC-COSTVAR-012 |
Table |
View headers |
10 columns: Product Name, SKU, First Cost, Last Cost, Avg Cost, Variance, Variance %, Category, Trend, Batches |
thead table-dark |
| UC-COSTVAR-013 |
Table |
Variance positive |
Red text (cost increase) |
text-danger |
| UC-COSTVAR-014 |
Table |
Variance negative |
Green text (cost decrease) |
text-success |
| UC-COSTVAR-015 |
Table |
Variance % badge |
Color based on severity: ≥20% danger, ≥15% warning, ≥10% info, ≥5% secondary, <5% success |
Badge colors |
| UC-COSTVAR-016 |
Table |
Category badge |
Critical (danger), High (warning), Medium (info), Low (secondary) |
Badge colors |
| UC-COSTVAR-017 |
Table |
Trend display |
Increasing ↗ (red), Decreasing ↘ (green), Stable → (muted) |
Trend icons |
| UC-COSTVAR-018 |
Table |
Max rows |
Shows max 15 product variances |
Limit |
| UC-COSTVAR-019 |
Table |
Empty state |
Icon with "No cost variance data available" message |
Empty state |
Section: Purchasing Recommendations Table
| ID |
Section |
Action |
Expected Outcome |
Controls Affected |
| UC-COSTVAR-020 |
Recs |
View headers |
5 columns: Product, Type, Priority, Est. Savings, Recommendation |
thead table-dark |
| UC-COSTVAR-021 |
Recs |
Type badge |
Urgent Review (danger), Cost Negotiation (warning), Monitor Closely (info), Investigate Quality (secondary) |
Badge colors |
| UC-COSTVAR-022 |
Recs |
Priority badge |
5 (danger), 4 (warning), 3 (info), 2 (secondary), 1 (success) |
Badge colors |
| UC-COSTVAR-023 |
Recs |
Est. Savings |
Currency format C2 |
Amount cell |
| UC-COSTVAR-024 |
Recs |
Max rows |
Shows max 10 recommendations |
Limit |
| UC-COSTVAR-025 |
Recs |
No recommendations |
Icon with "No specific recommendations" message |
Empty state |
Section: Data Validation Requirements
| ID |
Validation |
Requirement |
| UC-COSTVAR-026 |
Variance Calc |
Variance = LastCost - FirstCost |
| UC-COSTVAR-027 |
Variance % |
VariancePercent = ((LastCost - FirstCost) / FirstCost) × 100 |
| UC-COSTVAR-028 |
Currency Format |
All amounts use C2 format (2 decimal places) |
| UC-COSTVAR-029 |
Date Range |
Default 6 months analysis period |
Total Use Cases: 29