CATEGORYDEFINITION

Configuration for account categories.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
FROMCODE nvarchar(10) Default = ''
TOCODE nvarchar(10) Default = ''
CATEGORYCODE tinyint Default = 1 1=Asset, 2=Liability, 3=Net asset, 4=Revenue, 5=Expense
NORMALBALANCECODE tinyint Default = 1 1=Debit, 2=Credit
NORMALBALANCE nvarchar(6) (Computed) yes CASE [NORMALBALANCECODE] WHEN 1 THEN N'Debit' WHEN 2 THEN N'Credit' END Provides a translation for the 'NORMALBALANCECODE' field.
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.
CATEGORY nvarchar(9) (Computed) yes CASE [CATEGORYCODE] WHEN 1 THEN N'Asset' WHEN 2 THEN N'Liability' WHEN 3 THEN N'Net asset' WHEN 4 THEN N'Revenue' WHEN 5 THEN N'Expense' END Provides a translation for the 'CATEGORYCODE' field.
SUBCATEGORYCODE tinyint Default = 0 0=, 1=Gift, 2=Transfer, 3=Gain, 4=Loss
SUBCATEGORY nvarchar(8) (Computed) yes CASE [SUBCATEGORYCODE] WHEN 0 THEN N'' WHEN 1 THEN N'Gift' WHEN 2 THEN N'Transfer' WHEN 3 THEN N'Gain' WHEN 4 THEN N'Loss' END Provides a translation for the 'SUBCATEGORYCODE' field.

Foreign Keys

Foreign Key Field Type Null Notes Description
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
PDACCOUNTSYSTEMID uniqueidentifier PDACCOUNTSYSTEM.ID Accounting system ID

Indexes

Index Name Fields Unique Primary Clustered
IX_CATEGORYDEFINITION_DATEADDED DATEADDED yes
IX_CATEGORYDEFINITION_DATECHANGED DATECHANGED
PK_CATEGORYDEFINITION ID yes yes

Triggers

Trigger Name Description
TR_CATEGORYDEFINITION_AUDIT_UPDATE
TR_CATEGORYDEFINITION_AUDIT_DELETE
TR_CATEGORYDEFINITION_INSUPD_VALIDATE