Primary Key Field Type
 ID uniqueidentifier

Field Field Type Null Notes Description
 NAME nvarchar(100)   Default = '' The name used to identify the discount.
 DESCRIPTION nvarchar(255)   Default = '' The description of the discount.
 APPLIESTOCODE tinyint   Default = 0 The type of discount: 0 - Order, 1 - Item
 PERCENT decimal(5, 2)   Default = 0 The percentage of a discount.
 AMOUNT money   Default = 0 The amount for a discount.
 ISACTIVE bit   Default = 1 Indicates if the discount is currently active.
 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.
 APPLICATIONTYPECODE tinyint   Default = 0 How the discount is applied: 0 - Automatically, 1 - Manually, 2- Promo Code.
 NUMBERTOPURCHASE int   Default = 1 The number of items to be purchased for the discount to occur.
 NUMBERTODISCOUNT int   Default = 1 The maximum number of eligible items to be discounted in purchase.
 NUMBEROFDISCOUNTSPERORDER int   Default = 1 The maximum number of instances for this discount per order.
 DISCOUNTTICKETSFORCODE tinyint   Default = 0 Discount tickets for same event or program: 0 - event, 1 - program.
 LIMITDISCOUNTSPERORDER bit   Default = 0 Are number of discounts per order limited?
 DISCOUNTTYPECODE tinyint   Default = 0 The type of discount: 0 - Standard, 1 - Item with purchase of same item.
 CALCULATIONTYPECODE tinyint   Default = 0 The calculation type for the discount: 0 - Amount, 1 - Percentage.
 NUMBERTODISCOUNTTYPECODE tinyint   Default = 0 Items to included per discount: 0 - number, 1 - unlimited.
 APPLIESTO nvarchar(5) (Computed) CASE [APPLIESTOCODE] WHEN 0 THEN N'Order' WHEN 1 THEN N'Item' END Provides a translation for the 'APPLIESTOCODE' field.
 APPLICATIONTYPE nvarchar(13) (Computed) CASE [APPLICATIONTYPECODE] WHEN 0 THEN N'Automatically' WHEN 1 THEN N'Manually' WHEN 2 THEN N'With code' END Provides a translation for the 'APPLICATIONTYPECODE' field.
 NUMBERTODISCOUNTTYPE nvarchar(17) (Computed) CASE [NUMBERTODISCOUNTTYPECODE] WHEN 0 THEN N'Specific quantity' WHEN 1 THEN N'Unlimited' END Provides a translation for the 'NUMBERTODISCOUNTTYPECODE' field.
 DISCOUNTTICKETSFOR nvarchar(35) (Computed) CASE [DISCOUNTTICKETSFORCODE] WHEN 0 THEN N'Same event as the purchased event' WHEN 1 THEN N'Same program as the purchased event' END Provides a translation for the 'DISCOUNTTICKETSFORCODE' field.
 CALCULATIONTYPE nvarchar(14) (Computed) CASE [CALCULATIONTYPECODE] WHEN 0 THEN N'Amount off' WHEN 1 THEN N'Percent off' WHEN 2 THEN N'Specific price' END Provides a translation for the 'CALCULATIONTYPECODE' field.
 APPLIESTOMERCHANDISE bit   Default = 0 Indicates that an item discount or order discount calculated by percent applies to merchandise
 APPLIESTOTICKETS bit   Default = 1 Indicates that an item discount or order discount calculated by percent applies to tickets.
 MERCHANDISEPERCENT decimal(5, 2)   Default = 0.00 The percentage of a discount that is applied to merchandise.
 MERCHANDISEAMOUNT money   Default = 0.00 The amount for a discount that is applied to merchandise.
 QUALIFYINGITEMTYPECODE tinyint   Default = 0 Type of qualifying purchase for requiring a purchase discount: 0 - tickets, 1 - merchandise.
 QUALIFYINGITEMTYPE nvarchar(11) (Computed) CASE [QUALIFYINGITEMTYPECODE] WHEN 0 THEN N'Tickets' WHEN 1 THEN N'Merchandise' END Provides a translation for the 'QUALIFYINGITEMTYPECODE' field.
 DISCOUNTMERCHANDISEFORCODE tinyint   Default = 0 Discount merchandise for : 0 - same item, 1 - department, 2 - no restriction.
 DISCOUNTITEMTYPECODE tinyint   Default = 0 Type of discount purchase for requiring a purchase discount: 0 - tickets, 1 - merchandise.
 DISCOUNTITEMTYPE nvarchar(11) (Computed) CASE [DISCOUNTITEMTYPECODE] WHEN 0 THEN N'Tickets' WHEN 1 THEN N'Merchandise' END Provides a translation for the 'DISCOUNTITEMTYPECODE' field.
 DISCOUNTTYPE nvarchar(22) (Computed) CASE [DISCOUNTTYPECODE] WHEN 0 THEN N'Standard' WHEN 1 THEN N'With required purchase' WHEN 2 THEN N'By quantity' END Provides a translation for the 'DISCOUNTTYPECODE' field.
 DISCOUNTMERCHANDISEFOR nvarchar(41) (Computed) CASE [DISCOUNTMERCHANDISEFORCODE] WHEN 0 THEN N'Same merchandise as purchased merchandise' WHEN 1 THEN N'Same department as purchased merchandise' WHEN 2 THEN N'No restriction' END Provides a translation for the 'DISCOUNTMERCHANDISEFORCODE' field.

Foreign Key Field Type Null Notes Description
 ADDEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.
 CHANGEDBYID uniqueidentifier   CHANGEAGENT.ID FK to CHANGEAGENT.

Index Name Field(s) Unique Primary Clustered
 IX_DISCOUNT_DATEADDED DATEADDED    
 IX_DISCOUNT_DATECHANGED DATECHANGED      
 PK_DISCOUNT ID  
 UC_DISCOUNT_NAME NAME    

Trigger Name Description
 TR_DISCOUNT_AUDIT_UPDATE
 TR_DISCOUNT_AUDIT_DELETE

Referenced by Field
 CREDITITEM_EXT DISCOUNTID
 DAILYSALEITEMDISCOUNT DISCOUNTID
 DISCOUNTADDRESS ID
 DISCOUNTAVAILABILITY DISCOUNTID
 DISCOUNTCONSTITUENCY DISCOUNTID
 DISCOUNTGLMAPPING ID
 DISCOUNTGROUP DISCOUNTID
 DISCOUNTMEMBER DISCOUNTID
 DISCOUNTPRICETYPE DISCOUNTID
 DISCOUNTQUALIFYINGPRICETYPE DISCOUNTID
 DISCOUNTTAX DISCOUNTID
 GROUPSIZEDISCOUNT DISCOUNTID
 PROGRAMDISCOUNT DISCOUNTID
 PROMOTIONALCODE DISCOUNTID
 SALESMETHODDISCOUNT DISCOUNTID
 SALESORDERDISCOUNTLIMITOVERRIDE DISCOUNTID
 SALESORDERITEMITEMDISCOUNT DISCOUNTID
 SALESORDERITEMORDERDISCOUNT DISCOUNTID
 SALESORDERMANUALDISCOUNT DISCOUNTID

Entity-Relationship diagram of this table (CREDIT-SALESORDERITEMORDERDISCOUNT)
Entity-Relationship diagram of this table (SALESORDERMANUALDISCOUNT)