ADJUSTMENTHISTORYSTOCKDETAIL

Stores detail information on historic sold stock adjustments.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
ADJUSTEDFIELD nvarchar(100) Default = '' Indicates the field that caused the adjustment.
ADJUSTEDFIELDPREVIOUSVALUE nvarchar(4000) Default = '' Indicates the value of the adjusted field before the adjustment.
ADJUSTEDFIELDADJUSTEDVALUE nvarchar(4000) Default = '' Indicates the value of the adjusted field after the adjustment.
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.
ISMONEY bit Default = 0 Indicates whether or not the adjustment was for a monetary value.
ADJUSTEDFIELDPREVIOUSMONEYVALUE money Default = 0 Indicates the value of the adjusted money field before the adjustment.
ADJUSTEDFIELDADJUSTEDMONEYVALUE money Default = 0 Indicates the value of the adjusted money field after the adjustment.
TRANSACTIONADJUSTEDFIELDPREVIOUSVALUE nvarchar(4000) Default = '' Indicates the value of the adjusted field before the adjustment in transaction currency.
TRANSACTIONADJUSTEDFIELDADJUSTEDVALUE nvarchar(4000) Default = '' Indicates the value of the adjusted field after the adjustment in transaction currency.
TRANSACTIONADJUSTEDFIELDPREVIOUSMONEYVALUE money Default = 0 Indicates the value of the adjusted money field before the adjustment in transaction currency.
TRANSACTIONADJUSTEDFIELDADJUSTEDMONEYVALUE money Default = 0 Indicates the value of the adjusted money field after the adjustment in transaction currency.
ORGANIZATIONADJUSTEDFIELDPREVIOUSVALUE nvarchar(4000) Default = '' Indicates the value of the adjusted field before the adjustment in organization currency.
ORGANIZATIONADJUSTEDFIELDADJUSTEDVALUE nvarchar(4000) Default = '' Indicates the value of the adjusted field after the adjustment in organization currency.
ORGANIZATIONADJUSTEDFIELDPREVIOUSMONEYVALUE money Default = 0 Indicates the value of the adjusted money field before the adjustment in transaction currency.
ORGANIZATIONADJUSTEDFIELDADJUSTEDMONEYVALUE money Default = 0 Indicates the value of the adjusted money field after the adjustment in transaction currency.

Foreign Keys

Foreign Key Field Type Null Notes Description
ADJUSTMENTHISTORYSTOCKID uniqueidentifier ADJUSTMENTHISTORYSTOCK.ID Indicates the history item to which this detail belongs.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
BASECURRENCYID uniqueidentifier yes CURRENCY.ID The base currency associated with this adjustment.
TRANSACTIONCURRENCYID uniqueidentifier yes CURRENCY.ID The transaction currency associated with this adjustment.

Indexes

Index Name Fields Unique Primary Clustered
IX_ADJUSTMENTHISTORYSTOCKDETAIL_DATEADDED DATEADDED yes
IX_ADJUSTMENTHISTORYSTOCKDETAIL_DATECHANGED DATECHANGED
PK_ADJUSTMENTHISTORYSTOCKDETAIL ID yes yes

Triggers

Trigger Name Description
TR_ADJUSTMENTHISTORYSTOCKDETAIL_AUDIT_UPDATE
TR_ADJUSTMENTHISTORYSTOCKDETAIL_AUDIT_DELETE