Appearance
dbo.primeWorkOrderItems
Info Generated by
scripts/Generate-DataDictionary.ps1- do not edit by hand. Edit descriptions inschemas/tables/dbo.primeWorkOrderItems.jsonand regenerate.
Columns
| # | Column | Type | Nullable | Flags | Description |
|---|---|---|---|---|---|
| 1 | id | uniqueidentifier | no | Primary key / unique identifier for this record | |
| 2 | workorderid | uniqueidentifier | no | Foreign key to primeWorkOrders | |
| 3 | trade | nvarchar(100) | yes | Trade/skill category (e.g. Plumbing, Electrical, Carpentry) | |
| 4 | description | nvarchar(MAX) | yes | Free-text description | |
| 5 | notes | nvarchar(MAX) | yes | Free-text internal notes | |
| 6 | materialQuantity | decimal(18,2) | yes | Quantity of materials | |
| 7 | materialUnit | nvarchar(50) | yes | Unit of measure for material quantity | |
| 8 | labourQuantity | decimal(18,2) | yes | Quantity of labour (hours/units) | |
| 9 | labourUnit | nvarchar(50) | yes | Unit of measure for labour quantity | |
| 10 | categoryLabel | nvarchar(255) | yes | Display label of the estimate category | |
| 11 | materialCostTotal | decimal(10,2) | yes | Total cost of materials | |
| 12 | materialSellTotal | decimal(10,2) | yes | Total sell (billed) price for materials | |
| 13 | labourCostTotal | decimal(10,2) | yes | Total cost of labour | |
| 14 | labourSellTotal | decimal(10,2) | yes | Total sell (billed) price for labour | |
| 15 | start | datetime | yes | Start timestamp | |
| 16 | end | datetime | yes | End timestamp | |
| 17 | includesTax | bit | yes | Flag indicating whether the amount includes tax | |
| 18 | includesMaterial | bit | yes | Flag indicating whether this line item includes material | |
| 19 | includesLabour | bit | yes | Flag indicating whether this line item includes labour | |
| 20 | tax | decimal(5,2) | yes | Tax amount | |
| 21 | estimateItemId | uniqueidentifier | yes | Foreign key to the related estimate line item | |
| 22 | estimateId | uniqueidentifier | yes | Foreign key to the related estimate | |
| 23 | estimateLabel | nvarchar(255) | yes | Display label/name of the estimate | |
| 24 | version | bigint | yes | Optimistic-concurrency row version number |
Indexes
| Name | Type | Unique | PK | Key columns | Included | Filter |
|---|---|---|---|---|---|---|
| PK__primeWor__3213E83FB3C88B18 | CLUSTERED | yes | yes | id | ||
| IX_primeWorkOrderItems_WorkOrderId | NONCLUSTERED | workorderid |
Relationships (inferred)
| From | To | Confidence |
|---|---|---|
| dbo.primeWorkOrderItems.workorderid | dbo.primeWorkOrders.id | medium |
| dbo.primeWorkOrderItems.workorderid | dbo.primeScheduleItem.ObjectId | high |
Referenced by
Procedures: dbo.spPrimeGetWIPUpdatesWorksCompleted, dbo.spPrimeGetWIPUpdatesWorksInProgress, dbo.spPrimeGetWIPUpdatesWorksUpcoming, dbo.spPrimeUpsertWorkOrder, dbo.spPrimeUpsertWorkOrderItems

