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:
Name | Type | Description |
CALRULE_ID | INTEGER NOT NULL | Generated unique identifier. |
CALCODE_ID | INTEGER NOT NULL | The CalculationCode of which this CalculationRule
is a part. |
STARTDATE | TIMESTAMP | The time this CalculationRule begins being
effective. |
TAXCGRY_ID | INTEGER | For TaxType CalculationUsages, the TaxCategory
for which this CalculationRule is effective. |
ENDDATE | TIMESTAMP | The 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. |
SEQUENCE | DOUBLE NOT NULL DEFAULT 0 | CalculationRules for the same CalculationCode are
processed in sequence from lowest to highest value. |
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.
|
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. |
FIELD1 | DECIMAL (20,5) | Customizable. |
FIELD2 | VARCHAR (254) | 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: 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. |
OPTCOUNTER | SMALLINT | The optimistic concurrency control counter for
the table. Every time there is an update to the table, the counter
is incremented. |
Indexes:
Name | Column Names | Type |
<SYSTEM-GENERATED> | CALRULE_ID | Primary Key |
I0000058 | CALCODE_ID+IDENTIFIER | Unique Index |
I0000504 | TAXCGRY_ID | Non-Unique Index |
I0000505 | CALMETHOD_ID | Non-Unique Index |
I0000506 | CALMETHOD_ID_QFY | Non-Unique Index |
Constrained By Parent Tables:
Constraint | Columns | Parent Table | Parent Columns | 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 Child Tables:
Constraint | Columns | Child Table | Child Columns | 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 |