Database Table: CALRULE

Each row in this table represents a CalculationRule, defining how to arrive at a monetary amount for a set of OrderItems.

Column Name Column Type Column Description
CALCODE_ID INTEGER
NOT NULL
The CalculationCode of which this CalculationRule is a part.
CALMETHOD_ID INTEGER
NOT NULL
The CalculationRuleCalculateMethod that calculates a monetary result for a set of OrderItems.
CALMETHOD_ID_QFY INTEGER
NOT NULL
The CalculationRuleQualifyMethod that determines which of a set of OrderItems should be sent to the CalculationRuleCalculateMethod.
CALRULE_ID INTEGER
NOT NULL
Generated unique identifier.
COMBINATION INTEGER
NOT NULL, DEFAULT 2
Specifies 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.
ENDDATE TIMESTAMP
NULL
The time this CalculationRule stops being effective.
FIELD1 DECIMAL (20,5)
NULL
Customizable.
FIELD2 VARCHAR (254)
NULL
Customizable.
FLAGS INTEGER
NOT NULL, DEFAULT 0
Used 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, where 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).
IDENTIFIER INTEGER
NOT NULL, DEFAULT 1
Uniquely identifies this CalculationRule, along with its CalculationCode.
SEQUENCE DOUBLE
NOT NULL, DEFAULT 0
CalculationRules for the same CalculationCode are processed in sequence from lowest to highest value.
STARTDATE TIMESTAMP
NULL
The time this CalculationRule begins being effective.
TAXCGRY_ID INTEGER
NULL
For TaxType CalculationUsages, the TaxCategory for which this CalculationRule is effective.
Indexes:
Index Name Indexed Column Names Index Type
I0000058 CALCODE_ID, IDENTIFIER Unique Index
SQL030416034852510 CALRULE_ID Primary Key
Constraints:
Constraint Name Column Names Foreign Table Name Foreign Column Names Constraint Type
F_169 CALCODE_ID CALCODE CALCODE_ID Cascade
F_170 TAXCGRY_ID TAXCGRY TAXCGRY_ID Cascade
F_171 CALMETHOD_ID_QFY CALMETHOD CALMETHOD_ID Cascade
F_172 CALMETHOD_ID CALMETHOD CALMETHOD_ID Cascade

Referenced By:
Constraint Name Referenced Column Name Foreign Table Name Foreign Column Names Constraint Type
F_174 CALRULE_ID CALRULEMGP CALRULE_ID Cascade
F_280 CALRULE_ID CRULESCALE CALRULE_ID Cascade
F_751 CALRULE_ID SHPJCRULE CALRULE_ID Cascade
F_820 CALRULE_ID TAXJCRULE CALRULE_ID Cascade