Field Name | Data Type | Size | Original Type | Default | Nullable | Description | Check |
---|---|---|---|---|---|---|---|
PurchaseOrderID | int | Not null | Primary key. Foreign key to PurchaseOrderHeader.PurchaseOrderID. | ||||
PurchaseOrderDetailID | int identity | int | Not null | Primary key. One line number per purchased product. | |||
DueDate | datetime | Not null | Date the product is expected to be received. | ||||
OrderQty | smallint | Not null | Quantity ordered. | ([OrderQty]>(0)) | |||
ProductID | int | Not null | Product identification number. Foreign key to Product.ProductID. | ||||
UnitPrice | money | 19,4 | decimal(19,4) | Not null | Vendor's selling price of a single product. | ([UnitPrice]>=(0.00)) | |
LineTotal | money | 19,4 | decimal(19,4) | Not null | Per product subtotal. Computed as OrderQty * UnitPrice. | ||
ReceivedQty | decimal | 8,2 | Not null | Quantity actually received from the vendor. | ([ReceivedQty]>=(0.00)) | ||
RejectedQty | decimal | 8,2 | Not null | Quantity rejected during inspection. | ([RejectedQty]>=(0.00)) | ||
StockedQty | decimal | 9,2 | Not null | Quantity accepted into inventory. Computed as ReceivedQty - RejectedQty. | |||
ModifiedDate | datetime | getdate() | Not null | Date and time the record was last updated. |
The object has no extended properties.
Primary Key Name | Field Names |
---|---|
PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailID | PurchaseOrderID, PurchaseOrderDetailID |
Foreign | Primary | Key Name |
---|---|---|
PurchaseOrderDetail.ProductID | Product.ProductID | FK_PurchaseOrderDetail_Product_ProductID |
PurchaseOrderDetail.PurchaseOrderID | PurchaseOrderHeader.PurchaseOrderID | FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID |
Index Name | Description | Clustered | Unique | Fields |
---|---|---|---|---|
PK_PurchaseOrderDetail_PurchaseOrderID_PurchaseOrderDetailID | Clustered index created by a primary key constraint. | Yes | Yes | PurchaseOrderID, PurchaseOrderDetailID |
IX_PurchaseOrderDetail_ProductID | Nonclustered index. | No | No | ProductID |
Name | Description | Type | Enabled |
---|---|---|---|
iPurchaseOrderDetail | AFTER INSERT trigger that inserts a row in the TransactionHistory table and updates the PurchaseOrderHeader.SubTotal column. | after Insert | Yes |
uPurchaseOrderDetail | AFTER UPDATE trigger that inserts a row in the TransactionHistory table, updates ModifiedDate in PurchaseOrderDetail and updates the PurchaseOrderHeader.SubTotal column. | after Update | Yes |
Object Name | Type | Field Name |
---|---|---|
Purchasing.PurchaseOrderDetail | user table | OrderQty |
Purchasing.PurchaseOrderDetail | user table | UnitPrice |
Purchasing.PurchaseOrderDetail | user table | ReceivedQty |
Purchasing.PurchaseOrderDetail | user table | RejectedQty |