Appearance
dbo.primeWorkOrders
Info Generated by
scripts/Generate-DataDictionary.ps1- do not edit by hand. Edit descriptions inschemas/tables/dbo.primeWorkOrders.jsonand regenerate.
Columns
| # | Column | Type | Nullable | Flags | Description |
|---|---|---|---|---|---|
| 1 | id | uniqueidentifier | no | Primary key / unique identifier for this record | |
| 2 | jobid | uniqueidentifier | no | Foreign key to primeJobs | |
| 3 | allocationid | uniqueidentifier | yes | Foreign key to primeAllocations | |
| 4 | attachmentid | uniqueidentifier | yes | Foreign key to primeAttachment | |
| 5 | label | nvarchar(255) | yes | Display label | |
| 6 | description | nvarchar(MAX) | yes | Free-text description | |
| 7 | work_order_status | nvarchar(50) | yes | Status of the work order | |
| 8 | work_order_type | nvarchar(100) | yes | Type/category of work order | |
| 9 | assignedid | uniqueidentifier | yes | Foreign key to primeUsers - the user this record is assigned to | |
| 10 | start | datetime | yes | Start timestamp | |
| 11 | end | datetime | yes | End timestamp | |
| 12 | start_time | time(7) | yes | Start time of the appointment/slot | |
| 13 | end_time | time(7) | yes | End time of the appointment/slot | |
| 14 | retention | int | yes | Retention amount/percentage withheld from payment | |
| 15 | retention_percentage | decimal(10,6) | yes | Percentage of the amount withheld as retention | |
| 16 | retention_date | date | yes | Date retention is due to be released | |
| 17 | includes_tax | bit | yes | Flag indicating whether the amount includes tax | |
| 18 | tax | decimal(5,2) | yes | Tax amount | |
| 19 | sell_tax_total | decimal(10,2) | yes | Total tax amount on the sell (billed) price | |
| 20 | cost_tax_total | decimal(10,2) | yes | Total tax amount on the cost | |
| 21 | remaining_value | decimal(10,2) | yes | Remaining value after deductions | |
| 22 | material_cost_total | decimal(10,2) | yes | Total cost of materials | |
| 23 | labour_cost_total | decimal(10,2) | yes | Total cost of labour | |
| 24 | material_sell_total | decimal(10,2) | yes | Total sell (billed) price for materials | |
| 25 | labour_sell_total | decimal(10,2) | yes | Total sell (billed) price for labour | |
| 26 | sell_total | decimal(10,2) | yes | Total sell (billed) amount | |
| 27 | cost_total | decimal(10,2) | yes | Total cost amount | |
| 28 | created_at | datetime | yes | Timestamp the record was created | |
| 29 | created_by | nvarchar(100) | yes | User/system that created the record | |
| 30 | updated_at | datetime | yes | Timestamp the record was last updated | |
| 31 | updated_by | nvarchar(100) | yes | User/system that last updated the record | |
| 32 | version | bigint | yes | Optimistic-concurrency row version number | |
| 33 | filterTags | nvarchar(MAX) | yes | Comma-separated display list of filter tags applied to this record | |
| 34 | filterTagIds | nvarchar(MAX) | yes | Comma-separated list of primeFilterTags identifiers applied to this record |
Indexes
| Name | Type | Unique | PK | Key columns | Included | Filter |
|---|---|---|---|---|---|---|
| PK_primeWorkOrders | CLUSTERED | yes | yes | id | ||
| IX_primeWorkOrders_JobId | NONCLUSTERED | jobid | ||||
| IX_primeWorkOrders_JobId_Label_Identifiers | NONCLUSTERED | jobid, label, allocationid, attachmentid, assignedid |
Relationships (inferred)
| From | To | Confidence |
|---|---|---|
| dbo.optimoRouteOrder.primeJobID | dbo.primeWorkOrders.jobid | medium |
| dbo.optimoRouteOrder.primeWorkOrderID | dbo.primeWorkOrders.id | high |
| dbo.optimoRouteOrder.Version | dbo.primeWorkOrders.version | medium |
| dbo.PrimeAccountsPayableInvoices.WorkOrderId | dbo.primeWorkOrders.id | high |
| dbo.primeScheduleItem.ObjectId | dbo.primeWorkOrders.id | high |
| dbo.primeWorkOrderItems.workorderid | dbo.primeWorkOrders.id | medium |
| dbo.primeWorkOrders.assignedid | dbo.primeContacts.id | high |
| dbo.primeWorkOrders.created_by | dbo.primeUsers.fullName | high |
| dbo.primeWorkOrders.jobid | dbo.primeJobs.Id | high |
Referenced by
Procedures: dbo.spEthGetQueuedIDs, dbo.spEthQueueMissingJobs, dbo.spEthQueueMissingKpis, dbo.spEthSyncQueueMissingObjects, dbo.spOptimoRouteGetNotScheduledOrders, dbo.spOptimoRouteGetNotScheduledOrdersEmailQueue, dbo.spOptimoRouteGetWorkOrderQueue, dbo.spPrimeGetWIPUpdatesWorksCompleted, dbo.spPrimeGetWIPUpdatesWorksInProgress, dbo.spPrimeGetWIPUpdatesWorksUpcoming, dbo.spPrimeUpsertWorkOrder

