Support table for auto apply discounts - Discount options for a sales order.
Fields
| Field |
Field Type |
Null |
Notes |
Description |
|
NUMBERID
|
int
|
false
|
|
Numeric ID for the discount scnenario
|
|
DISCOUNTGROUPID
|
uniqueidentifier
|
false
|
|
GUID of the DISCOUNTGROUP ID - Used during discount calculation and does not need to be a true foreign key.
|
|
DISCOUNTTYPECODE
|
tinyint
|
false
|
|
DISCOUNTTYPECODE value for discount.
|
|
DISCOUNTTICKETSFORCODE
|
tinyint
|
false
|
|
DISCOUNTTICKETSFORCODE value for discount
|
|
DISCOUNTSCENARIOID
|
uniqueidentifier
|
false
|
|
GUID of the discount scenario - can span multiple rows and this field links these rows.
|
|
APPLIEDMANUALLY
|
tinyint
|
false
|
|
Denotes whether the discount was manually added to order
|
|
NUMBEROFTIMESAPPLIED
|
int
|
false
|
|
Number of time this discount is applied in the discount scenario.
|
|
QUALIFYINGORDERITEMID
|
uniqueidentifier
|
false
|
|
Foreign key to the SALESORDERITEM table for the order item to be used to qualify for the discount.
|
|
QUALIFYINGGROUPITEMID
|
uniqueidentifier
|
false
|
|
Foreign key to either EVENTID or PROGRAMID depending on value of DISCOUNTTICKETSFORCODE (0 - EVENTID; 1 - PROGRAMID) for the qualifying item.
|
|
QUALIFYINGPRICETYPECODEID
|
uniqueidentifier
|
false
|
|
Foreign key to the PRICETYPECODE table for the price type of the order item to be used to qualify for the discount.
|
|
NUMBEROFQUALIFYINGITEMS
|
int
|
false
|
|
Number of qualifying items for the QUALIFYINGORDERITEMID of the row.
|
|
NUMBEROFQUALIFYINGITEMSSTILLNEEDED
|
int
|
false
|
|
Number of qualifying items still needed to complete discount scenario.
|
|
TOTALQUALIFYINGQUANTITY
|
int
|
false
|
|
Number of items for the QUALIFYINGORDERITEMID that exist in order - used to calculate other values.
|
|
DISCOUNTEDORDERITEMID
|
uniqueidentifier
|
false
|
|
Foreign key to the SALESORDERITEM table for the order item to be discounted.
|
|
DISCOUNTEDGROUPITEMID
|
uniqueidentifier
|
false
|
|
Foreign key to either EVENTID or PROGRAMID depending on value of DISCOUNTTICKETSFORCODE (0 - EVENTID; 1 - PROGRAMID) for the discounted item.
|
|
DISCOUNTEDPRICETYPECODEID
|
uniqueidentifier
|
false
|
|
Foreign key to the PRICETYPECODE table for the price type of the order item to be discounted.
|
|
NUMBEROFDISCOUNTEDITEMS
|
int
|
false
|
|
Number of discounted items for the DISCOUNTEDORDERITEMID of the row.
|
|
NUMBEROFDISCOUNTEDITEMSSTILLOPEN
|
int
|
false
|
|
Number of discounted items open to fill discount scenario.
|
|
TOTALDISCOUNTEDQUANTITY
|
int
|
false
|
|
Number of items for the DISCOUNTEDORDERITEMID that exist in order - used to calculate other values.
|
|
DISCOUNTAMOUNT
|
money
|
false
|
|
Total amount for discount for row - sum this column for a given discount secneario to get total discount for scenario.
|
|
COMPLETED
|
tinyint
|
false
|
|
Completed status of scenarion 0 - incomplete, 1 - complete, 2 - failed.
|
|
DATEADDED
|
datetime
|
false
|
|
Indicates the date this record was added.
|
|
DATECHANGED
|
datetime
|
false
|
|
Indicates the date this record was last changed.
|
|
TS
|
timestamp
|
false
|
|
Timestamp.
|
|
TSLONG
|
bigint (Computed)
|
true
|
|
Numeric representation of the timestamp.
|
|
DISCOUNTSCENARIOGROUPID
|
uniqueidentifier
|
false
|
|
GUID of the discount scenario group - groups together discount scenarios that have overlapping items. Discount scenarios groups can be combined independently.
|