List columns
| Column | Source | Format / notes |
|---|
| Name | suppliers.name | Bold; primary identifier; must be unique per tenant |
| Type | suppliers.supplier_type | Pill with coloured dot — see types below |
| Credit Terms | suppliers.credit_terms | {n} days or N/A if empty |
| Credit Limit | suppliers.credit_limit | PKR, zero decimal places; N/A if null |
| Status | suppliers.is_active | Active (green pill) or Inactive (grey pill) |
| Actions | — | Edit → /wms/suppliers/{id} · Delete → confirmation dialog |
Supplier types
| Value | Label | Dot colour |
|---|
manufacturer | Manufacturer | Blue #2563eb |
distributor | Distributor | Purple #7c3aed |
wholesaler | Wholesaler | Amber #d97706 |
importer | Importer | Teal #0d9488 |
local | Local | Green #16a34a |
other | Other | Slate #64748b |
Type filter dropdown shows All Types (N) plus each type with count, e.g. Manufacturer (6).
KPI strip (full dataset, not filtered table)
| KPI | Calculation | Sub-label |
|---|
| Total Suppliers | Count of all suppliers | across all hubs |
| Active | is_active = true count | {inactive} inactive |
| Credit Exposure | Sum of credit_limit | total credit limit — compact PKR X.XM when ≥ 1M |
| Avg Credit Terms | Mean of numeric credit_terms | net payment window — rounded whole days |
Search scope
Client-side filter matches (case-insensitive substring):
name
supplier_type
ntn
stn
| Field | Required | Notes |
|---|
| Supplier Name | Yes | Min 2 characters |
| Supplier Type | Yes | Enum above |
| Official Distributor/Partner | No | is_official boolean |
| Active | No | Default true |
| NTN / STN | No | Tax registration |
| Credit Limit | No | ≥ 0 PKR |
| Credit Terms | No | Integer days ≥ 0 |
| Expiry intimation days | No | Default 90 on create |
| Delivery days | No | Stored as array |
| Bank name / account title / IBAN | No | PO payment block |
| Notes | No | Free text |
Delete behaviour
On confirm delete the app removes supplier_contacts and supplier_addresses for the ID, then the suppliers row. Blocked when GRNs reference the supplier (grns_supplier_id_fkey).