Primary Key Field Type
 ID uniqueidentifier

Field Field Type Null Notes Description
 CONTRAACCOUNT bit   Default = 0 Is this a contra account code?
 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.
 CATEGORYCODE tinyint   Default = 1 1=Asset, 2=Liability, 3=Net asset, 4=Revenue, 5=Expense
 CATEGORY nvarchar(9) (Computed) 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=Gain, 2=Gift, 3=Loss, 4=Transfer
 NORMALBALANCECODE int (Computed)   (case when CATEGORYCODE in (1,5) then 1 else 2 end) Normal balance code based on the category. 1 - Debit, 2 - Credit.
 NORMALBALANCE varchar(6) (Computed)   (case when CATEGORYCODE in (1,5) then 'Debit' else 'Credit' end) Normal balance based on the category.
 TYPE int (Computed)   1 Maps to the type field in the Accounting Element table.
 SUBCATEGORY nvarchar(8) (Computed) CASE [SUBCATEGORYCODE] WHEN 0 THEN N'' WHEN 1 THEN N'Gain' WHEN 2 THEN N'Gift' WHEN 3 THEN N'Loss' WHEN 4 THEN N'Transfer' END Provides a translation for the 'SUBCATEGORYCODE' field.

Foreign Key Field Type Null Notes Description
 ID uniqueidentifier   PDACCOUNTSEGMENTVALUE.ID Primary Key.
 CASHFLOWCODEID uniqueidentifier CASHFLOWCODE.ID Defines the cash flow for an account code.
 WORKINGCAPITALCODEID uniqueidentifier WORKINGCAPITALCODE.ID Defines the working capital for an account code.
 STATUSCODEID uniqueidentifier ACCOUNTCODESTATUSCODE.ID Defines the account code status
 SITEID uniqueidentifier SITE.ID Site using this Account Code.
 ADDEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.
 CHANGEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.

Index Name Field(s) Unique Primary Clustered
 IX_ACCOUNTCODE_DATEADDED DATEADDED    
 IX_ACCOUNTCODE_DATECHANGED DATECHANGED      
 PK_ACCOUNTCODE ID  

Trigger Name Description
 TR_ACCOUNTCODE_AUDIT_UPDATE
 TR_ACCOUNTCODE_AUDIT_DELETE

Referenced by Field
 GLACCOUNTCODEATTACHMENT GLACCOUNTCODEID
 GLACCOUNTCODEMEDIALINK GLACCOUNTCODEID
 GLACCOUNTCODENOTE GLACCOUNTCODEID

Entity-Relationship diagram of this table