Mapping fields & KPIs
KPI strip
| KPI | Definition |
|---|---|
| Products Mapped | Count of product_suppliers rows for the selected supplier; sublabel shows distinct brand count |
| Active SKUs | Mapped products where catalogue is_active is true; sublabel shows inactive count if any |
| Avg Discount | Mean of non-null discount % on mappings |
| Avg Margin | Mean of (retail − cost) / retail × 100 where both prices exist |
Table columns
| Column | Source | Editable inline |
|---|---|---|
| SKU | Product master | No |
| Product Name | Product master; Inactive badge if is_active = false | No |
| Brand | Product → brand | No |
| Supplier SKU | Mapping | Yes |
| Reorder | Mapping (reorderlevel, whole number string) | Yes |
| Cost · PKR | Product cost_price | No |
| Retail · PKR | Product price | No |
| Margin | Calculated (retail − cost) / retail; colour: green ≥25%, amber <15%, default otherwise | No |
| Discount | Mapping % | Yes |
| Actions | Edit · Save · Cancel · Remove | — |
Context bar
| Element | Source |
|---|---|
| Initials avatar | First letters of supplier name |
| Name | suppliers.name |
| Status pill | suppliers.is_active |
| Type | suppliers.supplier_type (Manufacturer, Distributor, …) |
| Location | Last segment of supplier address, if set |
Validation (inline & add dialog)
| Field | Rule |
|---|---|
| Reorder level | Optional; if set, must match ^\d+$ |
| Discount | Optional; if set, 0–100 inclusive |