BATCHREVENUESPLIT

Stores batch info

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
AMOUNT money Default = 0
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.
TYPECODE tinyint Default = 0 The type of revenue split.
APPLICATIONCODE tinyint Default = 0 What the revenue item is applied to.
DECLINESGIFTAID bit Default = 0 Indicates whether Gift Aid is declined for this split.
ISGIFTAIDSPONSORSHIP bit Default = 0 Indicates whether this split is a Gift Aid sponsorship.
REVENUESPLITID uniqueidentifier yes Split id for revenue update batch.
APPLICATION nvarchar(18) (Computed) yes CASE [APPLICATIONCODE] WHEN 0 THEN N'Donation' WHEN 1 THEN N'Event registration' WHEN 2 THEN N'Pledge' WHEN 3 THEN N'Recurring gift' WHEN 4 THEN N'Other' WHEN 5 THEN N'Membership' WHEN 6 THEN N'Planned gift' WHEN 7 THEN N'Matching gift' WHEN 8 THEN N'Grant' WHEN 13 THEN N'Donor challenge' END Provides a translation for the 'APPLICATIONCODE' field.
OVERRIDEBUSINESSUNITS bit Default = 0 Boolean value to tell whether business units attached to the application/payment were overridden
TYPE nvarchar(27) (Computed) yes CASE [TYPECODE] WHEN 0 THEN N'Gift' WHEN 1 THEN N'Event registration' WHEN 2 THEN N'Membership' WHEN 3 THEN N'Grant' WHEN 4 THEN N'Other' WHEN 9 THEN N'Sponsorship' WHEN 17 THEN N'Sponsorship additional gift' END Provides a translation for the 'TYPECODE' field.

Foreign Keys

Foreign Key Field Type Null Notes Description
BATCHREVENUEID uniqueidentifier BATCHREVENUE.ID FK to BATCHREVENUE
DESIGNATIONID uniqueidentifier DESIGNATION.ID FK to DESIGNATION
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
REVENUESPLITBUSINESSUNITOVERRIDECODEID uniqueidentifier yes REVENUESPLITBUSINESSUNITOVERRIDECODE.ID Stores the reason for overriding business units on this revenue split record.

Indexes

Index Name Fields Unique Primary Clustered
IX_BATCHREVENUESPLIT_BATCHREVENUEID BATCHREVENUEID
IX_BATCHREVENUESPLIT_DATEADDED DATEADDED yes
IX_BATCHREVENUESPLIT_DATECHANGED DATECHANGED
PK_BATCHREVENUESPLIT ID yes yes

Triggers

Trigger Name Description
TR_BATCHREVENUESPLIT_AUDIT_UPDATE
TR_BATCHREVENUESPLIT_AUDIT_DELETE

Referenced by

Referenced by Field
BATCHREVENUESPLITBUSINESSUNIT BATCHREVENUESPLITID
BATCHREVENUESPLITCAMPAIGN BATCHREVENUESPLITID