BATCHREVENUEBENEFIT

Stores benefits for batch rows.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
QUANTITY smallint Default = ((0)) Number of benefits
UNITVALUE money Default = 0 Cost per benefit
DETAILS nvarchar(255) Default = '' Details
SEQUENCE int Default = 0
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.
REVENUEBENEFITID uniqueidentifier yes The benefit record id that's updated in revenue update batch.

Foreign Keys

Foreign Key Field Type Null Notes Description
BATCHREVENUEID uniqueidentifier BATCHREVENUE.ID Indicates the batch row this benefit applies to.
BENEFITID uniqueidentifier BENEFIT.ID Benefit
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
BENEFITCURRENCYID uniqueidentifier yes CURRENCY.ID The base currency of the benefit.

Indexes

Index Name Fields Unique Primary Clustered
IX_BATCHREVENUEBENEFIT_BATCHREVENUEID BATCHREVENUEID
IX_BATCHREVENUEBENEFIT_BENEFITCURRENCYID BENEFITCURRENCYID
IX_BATCHREVENUEBENEFIT_DATEADDED DATEADDED yes
IX_BATCHREVENUEBENEFIT_DATECHANGED DATECHANGED
PK_BATCHREVENUEBENEFIT ID yes yes

Triggers

Trigger Name Description
TR_BATCHREVENUEBENEFIT_AUDIT_UPDATE
TR_BATCHREVENUEBENEFIT_AUDIT_DELETE
TR_BATCHREVENUEBENEFIT_INSERTUPDATE_CURRENCY