DOCUMENT

A printable document

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
NAME nvarchar(100) Default = '' Friendly name for the document
DESCRIPTION nvarchar(255) Default = ''
TYPECODE tinyint Default = 0 Defines the type of document the template defines
ISACTIVE bit Default = 1
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.
SEQUENCE int Default = 0 Priority of document within type - does not apply to tickets
TYPE nvarchar(26) (Computed) yes CASE [TYPECODE] WHEN 0 THEN N'Ticket' WHEN 1 THEN N'Itemized Receipt' WHEN 2 THEN N'Credit Card Receipt' WHEN 3 THEN N'Mailing Header' WHEN 4 THEN N'Will Call Header' WHEN 5 THEN N'Refund Itemized Receipt' WHEN 6 THEN N'Refund Credit Card Receipt' END Provides a translation for the 'TYPECODE' field.
PRINTFORGROUPSALES bit Default = 0
PRINTFORZEROBALANCEORDER bit Default = 0

Foreign Keys

Foreign Key Field Type Null Notes Description
REPORTCATALOGID uniqueidentifier yes REPORTCATALOG.ID The Report Spec used by this document
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
PRINTERLISTID uniqueidentifier yes PRINTERLIST.ID The printer list that describes the printers this template is designed for

Indexes

Index Name Fields Unique Primary Clustered
IX_DOCUMENT_DATEADDED DATEADDED yes
IX_DOCUMENT_DATECHANGED DATECHANGED
PK_DOCUMENT ID yes yes
UC_DOCUMENT_NAME NAME yes

Triggers

Trigger Name Description
TR_DOCUMENT_AUDIT_UPDATE
TR_DOCUMENT_AUDIT_DELETE

Referenced by

Referenced by Field
BATCHTICKETPRINTJOB DOCUMENTID
DOCUMENTPRINTINGRULE DOCUMENTID
DOCUMENTSVGTEMPLATE ID
PROGRAMDOCUMENT DOCUMENTID