Primary Key Field Type
 ID uniqueidentifier

Field Field Type Null Notes Description
 TYPECODE tinyint   Default = 0 The type of sales document
 TYPE nvarchar(26) (Computed) 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.
 REPRINTJOBID uniqueidentifier
 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.
 PRINTDATEWITHTIMEOFFSET datetimeoffset Holds date and time document was printed

Foreign Key Field Type Null Notes Description
 SALESORDERID uniqueidentifier SALESORDER.ID Sales order that generated the sales document
 APPUSERID uniqueidentifier   APPUSER.ID Application user that printed the sales document
 WORKSTATIONID uniqueidentifier WORKSTATION.ID Workstation the sales document was printed from
 CREDITCARDPAYMENTMETHODDETAILID uniqueidentifier CREDITCARDPAYMENTMETHODDETAIL.ID FK to CREDITCARDPAYMENTMETHODDETAIL
 CREDITID uniqueidentifier FINANCIALTRANSACTION.ID FK to CREDIT
 CREDITPAYMENTID uniqueidentifier CREDITPAYMENT.ID FK to CREDITPAYMENT
 ADDEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.
 CHANGEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.

Index Name Field(s) Unique Primary Clustered
 IX_DOCUMENTPRINTINGHISTORY_CREDITID CREDITID      
 IX_DOCUMENTPRINTINGHISTORY_DATEADDED DATEADDED    
 IX_DOCUMENTPRINTINGHISTORY_DATECHANGED DATECHANGED      
 PK_DOCUMENTPRINTINGHISTORY ID  

Trigger Name Description
 TR_DOCUMENTPRINTINGHISTORY_AUDIT_UPDATE
 TR_DOCUMENTPRINTINGHISTORY_AUDIT_DELETE

Entity-Relationship diagram of this table