Difference between revisions of "Purchasing.PurchaseOrderHeader (table)"
Line 5: | Line 5: | ||
| '''Table | | '''Table | ||
| Purchasing.PurchaseOrderHeader | | Purchasing.PurchaseOrderHeader | ||
+ | |- valign="top" | ||
+ | | '''Description | ||
+ | | General purchase order information. See PurchaseOrderDetail. | ||
|- | |- | ||
|} | |} | ||
Line 15: | Line 18: | ||
| '''Nullable | | '''Nullable | ||
| '''Default | | '''Default | ||
− | | '''PK | + | | '''Description / PK / Index |
− | |||
− | |- | + | |- valign="top" |
| PurchaseOrderID | | PurchaseOrderID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | PK_PurchaseOrderHeader_PurchaseOrderID | + | | Primary key.<br />PK_PurchaseOrderHeader_PurchaseOrderID |
− | + | |- valign="top" | |
− | |- | ||
| RevisionNumber | | RevisionNumber | ||
| tinyint | | tinyint | ||
| not null | | not null | ||
| ((0)) | | ((0)) | ||
− | | | + | | Incremental number to track changes to the purchase order over time.<br /> |
− | + | |- valign="top" | |
− | |- | ||
| Status | | Status | ||
| tinyint | | tinyint | ||
| not null | | not null | ||
| ((1)) | | ((1)) | ||
− | | | + | | Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete<br /> |
− | + | |- valign="top" | |
− | |- | ||
| EmployeeID | | EmployeeID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | | + | | Employee who created the purchase order. Foreign key to Employee.EmployeeID.<br />IX_PurchaseOrderHeader_EmployeeID |
− | + | |- valign="top" | |
− | |- | ||
| VendorID | | VendorID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | | + | | Vendor with whom the purchase order is placed. Foreign key to Vendor.VendorID.<br />IX_PurchaseOrderHeader_VendorID |
− | + | |- valign="top" | |
− | |- | ||
| ShipMethodID | | ShipMethodID | ||
| int | | int | ||
| not null | | not null | ||
| | | | ||
− | | | + | | Shipping method. Foreign key to ShipMethod.ShipMethodID.<br /> |
− | + | |- valign="top" | |
− | |- | ||
| OrderDate | | OrderDate | ||
| datetime | | datetime | ||
| not null | | not null | ||
| (getdate()) | | (getdate()) | ||
− | | | + | | Purchase order creation date.<br /> |
− | + | |- valign="top" | |
− | |- | ||
| ShipDate | | ShipDate | ||
| datetime | | datetime | ||
| null | | null | ||
| | | | ||
− | | | + | | Estimated shipment date from the vendor.<br /> |
− | + | |- valign="top" | |
− | |- | ||
| SubTotal | | SubTotal | ||
| money | | money | ||
| not null | | not null | ||
| ((0.00)) | | ((0.00)) | ||
− | | | + | | Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID.<br /> |
− | + | |- valign="top" | |
− | |- | ||
| TaxAmt | | TaxAmt | ||
| money | | money | ||
| not null | | not null | ||
| ((0.00)) | | ((0.00)) | ||
− | | | + | | Tax amount.<br /> |
− | + | |- valign="top" | |
− | |- | ||
| Freight | | Freight | ||
| money | | money | ||
| not null | | not null | ||
| ((0.00)) | | ((0.00)) | ||
− | | | + | | Shipping cost.<br /> |
− | + | |- valign="top" | |
− | |- | ||
| TotalDue | | TotalDue | ||
| | | | ||
| | | | ||
| | | | ||
− | | | + | | Total due to vendor. Computed as Subtotal + TaxAmt + Freight.<br /> |
− | + | |- valign="top" | |
− | |- | ||
| ModifiedDate | | ModifiedDate | ||
| datetime | | datetime | ||
| not null | | not null | ||
| (getdate()) | | (getdate()) | ||
− | | | + | | Date and time the record was last updated.<br /> |
− | |||
|} | |} | ||
Line 156: | Line 145: | ||
| ON UPDATE | | ON UPDATE | ||
|} | |} | ||
+ | |||
+ | |||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Dependency Type | ||
+ | | '''Object Type | ||
+ | | '''Referenced Object | ||
+ | |||
+ | | '''Child Type | ||
+ | | '''Child Object | ||
+ | |||
+ | |- | ||
+ | | Update | ||
+ | | Table | ||
+ | | [[Purchasing.PurchaseOrderHeader_(table)|Purchasing.PurchaseOrderHeader]] | ||
+ | |||
+ | | Trigger | ||
+ | | uPurchaseOrderHeader | ||
+ | |- | ||
+ | | Execute | ||
+ | | Procedure | ||
+ | | [[dbo.uspLogError_(procedure)|dbo.uspLogError]] | ||
+ | |||
+ | | Trigger | ||
+ | | uPurchaseOrderHeader | ||
+ | |- | ||
+ | | Execute | ||
+ | | Procedure | ||
+ | | [[dbo.uspPrintError_(procedure)|dbo.uspPrintError]] | ||
+ | |||
+ | | Trigger | ||
+ | | uPurchaseOrderHeader | ||
+ | |} | ||
+ | |||
+ | |||
+ | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
+ | |- style="background:silver" | ||
+ | | '''Reference Type | ||
+ | | '''Object Type | ||
+ | | '''Referencing Object | ||
+ | |||
+ | | '''Child Type | ||
+ | | '''Child Object | ||
+ | |||
+ | |- | ||
+ | | Select | ||
+ | | Table | ||
+ | | [[Purchasing.PurchaseOrderDetail_(table)|Purchasing.PurchaseOrderDetail]] | ||
+ | |||
+ | | Trigger | ||
+ | | iPurchaseOrderDetail | ||
+ | |- | ||
+ | | Update | ||
+ | | Table | ||
+ | | [[Purchasing.PurchaseOrderDetail_(table)|Purchasing.PurchaseOrderDetail]] | ||
+ | |||
+ | | Trigger | ||
+ | | iPurchaseOrderDetail | ||
+ | |- | ||
+ | | Update | ||
+ | | Table | ||
+ | | [[Purchasing.PurchaseOrderDetail_(table)|Purchasing.PurchaseOrderDetail]] | ||
+ | |||
+ | | Trigger | ||
+ | | uPurchaseOrderDetail | ||
+ | |- | ||
+ | | Update | ||
+ | | Table | ||
+ | | [[Purchasing.PurchaseOrderHeader_(table)|Purchasing.PurchaseOrderHeader]] | ||
+ | |||
+ | | Trigger | ||
+ | | uPurchaseOrderHeader | ||
+ | |} | ||
+ | |||
+ | |||
+ | |||
== automatically generated == | == automatically generated == | ||
Revision as of 22:55, 28 December 2009
wikibot
Table | Purchasing.PurchaseOrderHeader |
Description | General purchase order information. See PurchaseOrderDetail. |
Column | Data Type | Nullable | Default | Description / PK / Index |
PurchaseOrderID | int | not null | Primary key. PK_PurchaseOrderHeader_PurchaseOrderID | |
RevisionNumber | tinyint | not null | ((0)) | Incremental number to track changes to the purchase order over time. |
Status | tinyint | not null | ((1)) | Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete |
EmployeeID | int | not null | Employee who created the purchase order. Foreign key to Employee.EmployeeID. IX_PurchaseOrderHeader_EmployeeID | |
VendorID | int | not null | Vendor with whom the purchase order is placed. Foreign key to Vendor.VendorID. IX_PurchaseOrderHeader_VendorID | |
ShipMethodID | int | not null | Shipping method. Foreign key to ShipMethod.ShipMethodID. | |
OrderDate | datetime | not null | (getdate()) | Purchase order creation date. |
ShipDate | datetime | null | Estimated shipment date from the vendor. | |
SubTotal | money | not null | ((0.00)) | Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. |
TaxAmt | money | not null | ((0.00)) | Tax amount. |
Freight | money | not null | ((0.00)) | Shipping cost. |
TotalDue | Total due to vendor. Computed as Subtotal + TaxAmt + Freight. | |||
ModifiedDate | datetime | not null | (getdate()) | Date and time the record was last updated. |
Relation | Column | Referenced Column |
HumanResources.Employee | EmployeeID | EmployeeID |
Purchasing.ShipMethod | ShipMethodID | ShipMethodID |
Purchasing.Vendor | VendorID | VendorID |
Detail Table | Column | Referencing Column |
Purchasing.PurchaseOrderDetail | PurchaseOrderID | PurchaseOrderID |
Triggers | Type |
uPurchaseOrderHeader | ON UPDATE |
Dependency Type | Object Type | Referenced Object | Child Type | Child Object |
Update | Table | Purchasing.PurchaseOrderHeader | Trigger | uPurchaseOrderHeader |
Execute | Procedure | dbo.uspLogError | Trigger | uPurchaseOrderHeader |
Execute | Procedure | dbo.uspPrintError | Trigger | uPurchaseOrderHeader |
Reference Type | Object Type | Referencing Object | Child Type | Child Object |
Select | Table | Purchasing.PurchaseOrderDetail | Trigger | iPurchaseOrderDetail |
Update | Table | Purchasing.PurchaseOrderDetail | Trigger | iPurchaseOrderDetail |
Update | Table | Purchasing.PurchaseOrderDetail | Trigger | uPurchaseOrderDetail |
Update | Table | Purchasing.PurchaseOrderHeader | Trigger | uPurchaseOrderHeader |
automatically generated
Table | Purchasing.PurchaseOrderHeader |
Description | General purchase order information. See PurchaseOrderDetail. |
Column | Data Type | Nullable | Default | Description / PK / Index |
PurchaseOrderID | int | not null | Primary key. PK_PurchaseOrderHeader_PurchaseOrderID | |
RevisionNumber | tinyint | not null | (0) | Incremental number to track changes to the purchase order over time. |
Status | tinyint | not null | (1) | Order current status. 1 = Pending; 2 = Approved; 3 = Rejected; 4 = Complete |
EmployeeID | int | not null | Employee who created the purchase order. Foreign key to Employee.EmployeeID. IX_PurchaseOrderHeader_EmployeeID | |
VendorID | int | not null | Vendor with whom the purchase order is placed. Foreign key to Vendor.VendorID. IX_PurchaseOrderHeader_VendorID | |
ShipMethodID | int | not null | Shipping method. Foreign key to ShipMethod.ShipMethodID. | |
OrderDate | datetime | not null | (GETDATE()) | Purchase order creation date. |
ShipDate | datetime | null | Estimated shipment date from the vendor. | |
SubTotal | money | not null | (0.00) | Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the appropriate PurchaseOrderID. |
TaxAmt | money | not null | (0.00) | Tax amount. |
Freight | money | not null | (0.00) | Shipping cost. |
TotalDue | Total due to vendor. Computed as Subtotal + TaxAmt + Freight. | |||
ModifiedDate | datetime | not null | (GETDATE()) | Date and time the record was last updated. |
Relation | Column | Referenced Column |
HumanResources.Employee | EmployeeID | EmployeeID |
Purchasing.ShipMethod | ShipMethodID | ShipMethodID |
Purchasing.Vendor | VendorID | VendorID |
Detail Table | Column | Referencing Column |
Purchasing.PurchaseOrderDetail | PurchaseOrderID | PurchaseOrderID |
Triggers | Type |
uPurchaseOrderHeader | ON UPDATE |
Dependency Type | Object Type | Referenced Object | Child Type | Child Object |
Schema | Schema | Purchasing | ||
Update | Table | Purchasing.PurchaseOrderHeader | Trigger | uPurchaseOrderHeader |
Execute | Procedure | dbo.uspLogError | Trigger | uPurchaseOrderHeader |
Execute | Procedure | dbo.uspPrintError | Trigger | uPurchaseOrderHeader |
Reference Type | Object Type | Referencing Object | Child Type | Child Object |
Select | Table | Purchasing.PurchaseOrderDetail | Trigger | iPurchaseOrderDetail |
Update | Table | Purchasing.PurchaseOrderDetail | Trigger | iPurchaseOrderDetail |
Update | Table | Purchasing.PurchaseOrderDetail | Trigger | uPurchaseOrderDetail |
Update | Table | Purchasing.PurchaseOrderHeader | Trigger | uPurchaseOrderHeader |