CALRULE

Each row in this table represents a CalculationRule, it defines how to arrive at a monetary amount for a set of OrderItems. For each CalculationCode, one or more CalculationRules can be defined. The CalculationRules which belong to one CalculationCode are responsible for doing the calculation.

Column Descriptions:

NameTypeDescription
CALRULE_IDINTEGER NOT NULLGenerated unique identifier.
CALCODE_IDINTEGER NOT NULLThe CalculationCode of which this CalculationRule is a part.
STARTDATETIMESTAMPThe time this CalculationRule begins being effective.
TAXCGRY_IDINTEGERFor TaxType CalculationUsages, the TaxCategory for which this CalculationRule is effective.
ENDDATETIMESTAMPThe time this calculation rule stops being effective. You can specify a null value. If you do not specify a value, the default value is '9999-12-31 23:59:59.0', which means that the calculation code never expires.
SEQUENCEDOUBLE NOT NULL DEFAULT 0CalculationRules for the same CalculationCode are processed in sequence from lowest to highest value.
COMBINATIONINTEGER NOT NULL DEFAULT 2Specifies the bit flag to indicate special processing to be performed by the default CalculationRuleCombineMethod implementation. Used by the default implementation of the CalculationRuleCombineMethod to determine how this CalculationRule may be combined with other CalculationRules as follows:
  • 0 = inAdditionTo - can be combined with any rules.
  • 1 = notInCombinationWith - can only be combined with "0" rules.
  • 2 = inCombinationWith - cannot be combined with "1" rules.
CALMETHOD_IDINTEGER NOT NULLThe CalculationRuleCalculateMethod that calculates a monetary result for a set of OrderItems.
CALMETHOD_ID_QFYINTEGER NOT NULLThe CalculationRuleQualifyMethod that determines which of a set of OrderItems should be sent to the CalculationRuleCalculateMethod.
FIELD1DECIMAL (20,5)Customizable.
FIELD2VARCHAR (254)Customizable.
FLAGSINTEGER NOT NULL DEFAULT 0Used by CalculationRuleCombineMethod to determine how this CalculationRule may be combined with other CalculationRules. Contains the following bit flag indicating special processing to be performed by the default CalculationRuleCombineMethod implementation: 1 = restricted - certain conditions must be met before the CalculationRule qualifies. Calls the CalculationRuleQualifyMethod to determine if the CalculationRule qualifies. If this flag is not 1, then the CalculationRule always qualifies. Example 1: For discount CalculationRules, the customer must be in one of the associated MemberGroups recognized by the Store as customer groups (see CALRULEMGP and STOREMBRGP). Example 2: For shipping CalculationRules, the shipping address, shipping mode and fulfillment center must match one of the ShippingJurisdictionGroupCalculationRules (see SHIPJCRULE). Example 3: For tax CalculationRules the shipping address and fulfillment center must match one of the TaxJurisdictionGroupCalculationRules (see TAXJCRULE).
IDENTIFIERINTEGER NOT NULL DEFAULT 1Uniquely identifies this CalculationRule, along with its CalculationCode.
OPTCOUNTERSMALLINT NOT NULL DEFAULT 0The optimistic concurrency control counter for the table. Every time there is an update to the table, the counter is incremented.

Indexes:

NameColumn NamesType
<SYSTEM-GENERATED>CALRULE_IDPrimary Key
I0000058CALCODE_ID+IDENTIFIERUnique Index
I0000504TAXCGRY_IDNon-Unique Index
I0000505CALMETHOD_IDNon-Unique Index
I0000506CALMETHOD_ID_QFYNon-Unique Index

Constrained By Parent Tables:

ConstraintColumnsParent TableParent ColumnsType
F_169CALCODE_IDCALCODECALCODE_IDCascade
F_170TAXCGRY_IDTAXCGRYTAXCGRY_IDCascade
F_171CALMETHOD_ID_QFYCALMETHODCALMETHOD_IDCascade
F_172CALMETHOD_IDCALMETHODCALMETHOD_IDCascade

Referenced By Child Tables:

ConstraintColumnsChild TableChild ColumnsType
F_174CALRULE_IDCALRULEMGPCALRULE_IDCascade
F_280CALRULE_IDCRULESCALECALRULE_IDCascade
F_751CALRULE_IDSHPJCRULECALRULE_IDCascade
F_820CALRULE_IDTAXJCRULECALRULE_IDCascade