TAXDECLARATION

Stores tax declaration information for each constituent.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
DECLARATIONMADE datetime yes Date the declaration was made.
DECLARATIONSTARTS datetime Date the declaration starts.
DECLARATIONENDS datetime yes Date the declaration ends.
DECLARATIONINDICATORCODE tinyint Default = 0 The indicator for this declaration.
SCANNEDDOCSEXIST bit Default = 0 Indicates if scanned documents exist.
CONFIRMATIONSENT datetime yes Date the confirmation was sent.
CONFIRMATIONRETURNED datetime yes Date the confirmation was returned.
PAYSTAXCODE tinyint Default = 2 Indicates whether a constituent pays tax.
COMMENTS nvarchar(255) Default = '' Comments for this declaration.
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.
DECLARATIONINDICATOR nvarchar(8) (Computed) yes CASE [DECLARATIONINDICATORCODE] WHEN 0 THEN N'Written' WHEN 1 THEN N'Oral' WHEN 2 THEN N'Internet' END Provides a translation for the 'DECLARATIONINDICATORCODE' field.
PAYSTAX nvarchar(7) (Computed) yes CASE [PAYSTAXCODE] WHEN 0 THEN N'No' WHEN 1 THEN N'Yes' WHEN 2 THEN N'Unknown' END Provides a translation for the 'PAYSTAXCODE' field.

Foreign Keys

Foreign Key Field Type Null Notes Description
CONSTITUENTID uniqueidentifier CONSTITUENT.LOCALID The constituent to which this declaration belongs.
DECLARATIONSOURCECODEID uniqueidentifier yes DECLARATIONSOURCECODE.LOCALID The source of this declaration.
TAXSTATUSCODEID uniqueidentifier yes TAXSTATUSCODE.ID The status of this declaration.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHARITYCLAIMREFERENCENUMBERID uniqueidentifier CHARITYCLAIMREFERENCENUMBER.ID FK to CHARITYCLAIMREFERENCENUMBER
ADDRESSID uniqueidentifier yes ADDRESS.LOCALID
ALIASID uniqueidentifier yes ALIAS.ID

Indexes

Index Name Fields Unique Primary Clustered
IX_TAXDECLARATION_ADDRESSID ADDRESSID
IX_TAXDECLARATION_ALIASID ALIASID
IX_TAXDECLARATION_CONSTITUENTID_CHARITYCLAIMREFERENCENUMBERID CONSTITUENTID, CHARITYCLAIMREFERENCENUMBERID
IX_TAXDECLARATION_DATEADDED DATEADDED yes
IX_TAXDECLARATION_DATECHANGED DATECHANGED
PK_TAXDECLARATION ID yes yes

Triggers

Trigger Name Description
TR_TAXDECLARATION_AUDIT_UPDATE
TR_TAXDECLARATION_AUDIT_DELETE