Primary Key Field Type
 ID uniqueidentifier

Field Field Type Null Notes Description
 PROJECT nvarchar(100)   Default = '' Project field
 REFERENCE nvarchar(255)   Default = '' Reference field
 AMOUNT money   Default = 0 Amount
 ACCOUNT nvarchar(100)   Default = '' Account
 TRANSACTIONTYPECODE tinyint   Default = 0 The transaction type (debit or credit) for the record
 TRANSACTIONTYPE nvarchar(6) (Computed) CASE [TRANSACTIONTYPECODE] WHEN 0 THEN N'Debit' WHEN 1 THEN N'Credit' END Provides a translation for the 'TRANSACTIONTYPECODE' field.
 OUTDATED bit   Default = 0 Specifies whether or not this distribution is outdated.
 ORGANIZATIONAMOUNT money   Default = 0 The amount of the GL distribution in organization currency.
 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) CONVERT(bigint, TS) Numeric representation of the timestamp.

Foreign Key Field Type Null Notes Description
 REVENUEID uniqueidentifier REVENUE.LOCALID ForeignKey to REVENUE table
 GLTRANSACTIONID uniqueidentifier GLTRANSACTION.ID Foreign key to the GLTRANSACTION table.
 BASECURRENCYID uniqueidentifier CURRENCY.ID The base currency associated with this GL distribution.
 ADDEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.
 CHANGEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.

Index Name Field(s) Unique Primary Clustered
 IX_UNREALIZEDGAINLOSSGLDISTRIBUTION_BASECURRENCYID BASECURRENCYID      
 IX_UNREALIZEDGAINLOSSGLDISTRIBUTION_DATEADDED DATEADDED    
 IX_UNREALIZEDGAINLOSSGLDISTRIBUTION_DATECHANGED DATECHANGED      
 IX_UNREALIZEDGAINLOSSGLDISTRIBUTION_GLTRANSACTIONID GLTRANSACTIONID      
 IX_UNREALIZEDGAINLOSSGLDISTRIBUTION_REVENUEID_GLTRANSACTIONID REVENUEID, GLTRANSACTIONID      
 PK_UNREALIZEDGAINLOSSGLDISTRIBUTION ID  

Trigger Name Description
 TR_UNREALIZEDGAINLOSSGLDISTRIBUTION_AUDIT_UPDATE
 TR_UNREALIZEDGAINLOSSGLDISTRIBUTION_AUDIT_DELETE
 TR_UNREALIZEDGAINLOSSGLDISTRIBUTION_DELETE_GLTRANSACTION
 TR_UNREALIZEDGAINLOSSGLDISTRIBUTION_INSERTUPDATE_CURRENCY

Entity-Relationship diagram of this table