SALESORDERADJUSTABLEDISCOUNT (4.0SP20)

Holds adjustable discount information for sales orders

Primary Key
Primary Key Field Type

ID

uniqueidentifier

Foreign Key Fields
Foreign Key Field Type Null Notes Description

SALESORDERID

uniqueidentifier

false

FK to SALESORDER

DISCOUNTREASONCODEID

uniqueidentifier

false

The reason for the adjustable discount

ADDEDBYID

uniqueidentifier

false

FK to CHANGEAGENT.

CHANGEDBYID

uniqueidentifier

false

FK to CHANGEAGENT.

Fields
Field Field Type Null Notes Description

CALCULATIONTYPECODE

tinyint

false

0

The calculation type for the discount: 0 - Amount, 1 - Percentage.

CALCULATIONTYPE

nvarchar(11) (Computed)

true

Provides a translation for the 'CALCULATIONTYPECODE' field.

PERCENT

decimal(5, 2)

false

0.00

The percentage of a discount.

AMOUNT

money

false

0.00

The amount for a discount.

DISCOUNTNAME

nvarchar(100)

false

''

Name of discount at time of sale.

DATEADDED

datetime

false

getdate()

Indicates the date this record was added.

DATECHANGED

datetime

false

getdate()

Indicates the date this record was last changed.

TS

timestamp

false

Timestamp.

TSLONG

bigint (Computed)

true

Numeric representation of the timestamp.

Indexes
Index Name Field(s) Unique Primary Clustered

IX_SALESORDERADJUSTABLEDISCOUNT_DATEADDED

DATEADDED

False

False

True

IX_SALESORDERADJUSTABLEDISCOUNT_DATECHANGED

DATECHANGED

False

False

False

PK_SALESORDERADJUSTABLEDISCOUNT

ID

True

True

False

UIX_SALESORDERADJUSTABLEDISCOUNT_SALESORDERID

SALESORDERID

True

False

False

Triggers
Trigger Name Description

TR_SALESORDERADJUSTABLEDISCOUNT_AUDIT_UPDATE

TR_SALESORDERADJUSTABLEDISCOUNT_AUDIT_DELETE