SALESORDERITEMORDERDISCOUNT

Defines an order discount on a sales order

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
DATEADDED datetime Default = getdate() Indicates the date this record was added.
DATECHANGED datetime Default = getdate() Indicates the date this record was last changed.
TS timestamp Timestamp.
TSLONG bigint (Computed) yes CONVERT(bigint, TS) Numeric representation of the timestamp.
DISCOUNTNAME nvarchar(100) Default = '' Name of discount at time of sale.
ISADJUSTABLEDISCOUNT bit Default = 0 Determines whether this discount is a preconfigured or adjustable discount

Foreign Keys

Foreign Key Field Type Null Notes Description
ID uniqueidentifier SALESORDERITEM.ID Primary Key.
DISCOUNTID uniqueidentifier yes DISCOUNT.ID FK to DISCOUNT
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_SALESORDERITEMORDERDISCOUNT_DATEADDED DATEADDED yes
IX_SALESORDERITEMORDERDISCOUNT_DATECHANGED DATECHANGED
IX_SALESORDERITEMORDERDISCOUNT_DISCOUNTID DISCOUNTID
PK_SALESORDERITEMORDERDISCOUNT ID yes yes

Triggers

Trigger Name Description
TR_SALESORDERITEMORDERDISCOUNT_AUDIT_UPDATE
TR_SALESORDERITEMORDERDISCOUNT_AUDIT_DELETE

Referenced by

Referenced by Field
SALESORDERITEMORDERDISCOUNTDETAIL SALESORDERITEMORDERDISCOUNTID