STOCKSALEADJUSTMENT (4.0)

Stores adjustments made to posted sold stock sale.

Primary Key
Primary Key Field Type

ID

uniqueidentifier

Foreign Key Fields
Foreign Key Field Type Null Notes Description

STOCKSALEID

uniqueidentifier

false

FK to STOCKSALE

ADDEDBYID

uniqueidentifier

false

FK to CHANGEAGENT.

CHANGEDBYID

uniqueidentifier

false

FK to CHANGEAGENT.

REASONCODEID

uniqueidentifier

true

Indicates the reason this adjustment was made.

BASECURRENCYID

uniqueidentifier

true

The base currency associated with this record.

ORGANIZATIONEXCHANGERATEID

uniqueidentifier

true

The exchange rate used to calculate the organization amount.

TRANSACTIONCURRENCYID

uniqueidentifier

true

The transaction currency associated with this record.

BASEEXCHANGERATEID

uniqueidentifier

true

The exchange rate used to calculate the base amount.

Fields
Field Field Type Null Notes Description

PREVIOUSAMOUNT

money

false

0

Stock sale amount prior to adjustment

DATE

datetime

true

The date of the adjustment to the stock sale record.

POSTDATE

datetime

true

The date to use when posting the adjustment to the stock sale record.

POSTSTATUSCODE

tinyint

false

1

Flag used to indicate if the adjustment has been posted.

REASON

nvarchar(300)

false

''

Gives further details for why this adjustment was made.

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.

POSTSTATUS

nvarchar(11) (Computed)

true

Provides a translation for the 'POSTSTATUSCODE' field.

ORGANIZATIONPREVIOUSAMOUNT

money

false

0

The price at which the stock was sold in the organization currency.

TRANSACTIONPREVIOUSAMOUNT

money

false

0

The price at which the stock was sold in the transaction currency.

Indexes
Index Name Field(s) Unique Primary Clustered

IX_STOCKSALEADJUSTMENT_BASECURRENCYID

BASECURRENCYID

False

False

False

IX_STOCKSALEADJUSTMENT_BASEEXCHANGERATEID

BASEEXCHANGERATEID

False

False

False

IX_STOCKSALEADJUSTMENT_DATEADDED

DATEADDED

False

False

True

IX_STOCKSALEADJUSTMENT_DATECHANGED

DATECHANGED

False

False

False

IX_STOCKSALEADJUSTMENT_ORGANIZATIONEXCHANGERATEID

ORGANIZATIONEXCHANGERATEID

False

False

False

IX_STOCKSALEADJUSTMENT_STOCKSALEID

STOCKSALEID

False

False

False

IX_STOCKSALEADJUSTMENT_TRANSACTIONCURRENCYID

TRANSACTIONCURRENCYID

False

False

False

PK_STOCKSALEADJUSTMENT

ID

True

True

False

Triggers
Trigger Name Description

TR_STOCKSALEADJUSTMENT_AUDIT_UPDATE

TR_STOCKSALEADJUSTMENT_AUDIT_DELETE

TR_STOCKSALEADJUSTMENT_INSERTUPDATE_CURRENCY

Referenced by
Referenced by Field

ADJUSTMENTHISTORYSTOCK

STOCKSALEADJUSTMENTID