REVENUEBENEFITTEMP

Stores revenue benefit information.

Fields

Field Field Type Null Notes Description
ID uniqueidentifier Default = (newid()) Primary Key.
REVENUEID uniqueidentifier FK to REVENUE table.
BENEFITID uniqueidentifier The benefit for this row.
QUANTITY int Default = 0 Number of benefits
UNITVALUE money Default = 0 Cost or percentage of the benefit
DETAILS nvarchar(255) Default = '' Comments
SEQUENCE int Default = 0
ADDEDBYID uniqueidentifier FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier FK to CHANGEAGENT.
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.
SENDBENEFIT tinyint Default = 2 Designates when to create distribution for benefit (0-Committed, 1-Fully Paid, 2-no distribution).
PERCENTAPPLICABLEAMOUNT money Default = 0 This is the amount used to determine the value for percentage based benefits
VALUEPERCENT decimal(20, 4) Default = 0 This is the percentage used to determine the value for percentage based benefits
TRANSACTIONTOTALVALUE money Default = 0 The total value in the transaction currency of the revenue.
ORGANIZATIONTOTALVALUE money Default = 0 The total value in the organization currency.
BASECURRENCYID uniqueidentifier yes The base currency associated with this revenue benefit total amount.
TRANSACTIONCURRENCYID uniqueidentifier yes The transaction currency associated with this revenue benefit total amount.
BASEEXCHANGERATEID uniqueidentifier yes The exchange rate used to convert to the base amount.
ORGANIZATIONEXCHANGERATEID uniqueidentifier yes The exchange rate used to convert to the organization amount.
TOTALVALUE money (Computed) yes cast((QUANTITY * UNITVALUE) + (PERCENTAPPLICABLEAMOUNT * VALUEPERCENT/100) as money)
REVENUESPLITID uniqueidentifier yes

Indexes

Index Name Fields Unique Primary Clustered
IX_REVENUEBENEFIT_DATEADDED DATEADDED yes

Triggers

Trigger Name Description
TR_REVENUEBENEFIT_AUDIT_UPDATE
TR_REVENUEBENEFIT_AUDIT_DELETE
TR_REVENUEBENEFIT_T2BDELETE
TR_REVENUEBENEFIT_INSERTUPDATE_CURRENCY