Database Table: CALCODE

A row in this table represents a CalculationCode. CalculationCodes represent ways of determining monetary amounts associated with OrderItems. They are used to calculate discounts, shipping charges, sales tax, and shipping tax.

Column Name Column Type Column Description
CALCODE_ID INTEGER
NOT NULL
Generated unique identifier.
CALMETHOD_ID INTEGER
NOT NULL
The CalculationCodeCalculateMethod that defines how to calculate a monetary amount for this CalculationCode.
CALMETHOD_ID_APP INTEGER
NOT NULL
The CalculationCodeApplyMethod that stores the calculated amount for the associated OrderItems.
CALMETHOD_ID_QFY INTEGER
NOT NULL
The CalculationCodeQualifyMethod that defines which OrderItems are associated with this CalculationCode.
CALUSAGE_ID INTEGER
NOT NULL
Indicates the kind of calculation this CalculationCode is used for. For example, the CalculationCode may be used to calculate one of the following monetary amounts: discounts, shipping charges, sales tax, or shipping tax.
CODE CHARACTER (128)
NOT NULL
A character string that uniquely identifies this CalculationCode, given a particular CalculationUsage and StoreEntity.
COMBINATION INTEGER
NULL
For schema based discount, this column is used to check if there is a combination between CALCODE and CALRULE etc.

For rules based discount, this column is used to check if this Promotion requires a PromotionCode.
DESCRIPTION VARCHAR (254)
NULL
A brief description of this CalculationCode, suitable for display by a user interface that manages CalculationCodes.
DISPLAYLEVEL INTEGER
NOT NULL, DEFAULT 0
Amounts calculated by this CalculationCode should be displayed with each:
0 = OrderItem
1 = Order
2 = Product
3 = Item
4 = Contract.
ENDDATE TIMESTAMP
NULL
The time this CalculationCode stops being effective.
FIELD1 VARCHAR (254)
NULL
Customizable.
FLAGS INTEGER
NOT NULL, DEFAULT 0
Specifies whether the CalculationCodeQualifyMethod of this CalculationCode should be invoked:
0 = unrestricted. The method will not be invoked.
1 = restricted. The method will be invoked.
GROUPBY INTEGER
NOT NULL, DEFAULT 0
Bit flags indicating to the CalculationCodeCombineMethod how OrderItems should be grouped when performing calculations. Each group of OrderItems is used to calculate a monetary amount, which is applied separately using the CalculationCodeApplyMethod. The default CalculationCodeCombineMethods recognize the following bit flags, from low to high order bits:
1 = perProduct - OrderItems with different CatalogEntries should be grouped separately. When a CatlogEntry has a PRODUCT_ITEM parent in the CATENTREL table, then the parent CatalogEntry is used instead.
2 = perTradingAgreement - OrderItems with different TradingAgreements should be grouped separately.
4 = perOffer - OrderItems with different Offers should be grouped separately.
8 = perAddress - OrderItems with different shipping addresses should be grouped separately.
Bit flags can be added together to specify combinations of the above groupings. For example:
0 = No grouping. Place all applicable OrderItems in a single group.
1 = Use perProduct grouping.
2 = Use perTradingAgreement grouping.
3 = Use perProduct and perTradingAgreement grouping.
4 = Use perOffer grouping.
6 = Use perOffer and perTradingAgreement grouping.
9 = Use perProduct and perAddress grouping.
LASTUPDATE TIMESTAMP
NULL
The time this CalculationCode (including its CalculationRules) was most recently updated.
PRECEDENCE DOUBLE
NOT NULL, DEFAULT 0
Reserved for IBM internal use.
PUBLISHED INTEGER
NOT NULL, DEFAULT 0
Specifies whether or not the calculation code is published:
0 = not published (temporarily disabled).
1 = published.
2 = marked for deletion (and not published).
SEQUENCE DOUBLE
NOT NULL, DEFAULT 0
CalculationCodes are calculated and applied in sequence from lowest to highest.
STARTDATE TIMESTAMP
NULL
The time this CalculationCode begins being effective.
STOREENT_ID INTEGER
NOT NULL
The CalculationCode is part of this StoreEntity.
TXCDCLASS_ID INTEGER
NULL
For Taxation CalculationCodes, the TaxCodeClassification, if any, associated with this CalculationCode.
Indexes:
Index Name Indexed Column Names Index Type
I0000054 CALUSAGE_ID, CODE, STOREENT_ID Unique Index
SQL030416034850170 CALCODE_ID Primary Key
Constraints:
Constraint Name Column Names Foreign Table Name Foreign Column Names Constraint Type
F_151 CALUSAGE_ID CALUSAGE CALUSAGE_ID Cascade
F_152 STOREENT_ID STOREENT STOREENT_ID Cascade
F_153 TXCDCLASS_ID TXCDCLASS TXCDCLASS_ID Cascade
F_154 CALMETHOD_ID_QFY CALMETHOD CALMETHOD_ID Cascade
F_155 CALMETHOD_ID CALMETHOD CALMETHOD_ID Cascade
F_156 CALMETHOD_ID_APP CALMETHOD CALMETHOD_ID Cascade

Referenced By:
Constraint Name Referenced Column Name Foreign Table Name Foreign Column Names Constraint Type
F_157 CALCODE_ID CALCODEDSC CALCODE_ID Cascade
F_160 CALCODE_ID CALCODEMGP CALCODE_ID Cascade
F_161 CALCODE_ID CALCODTXEX CALCODE_ID Cascade
F_169 CALCODE_ID CALRULE CALCODE_ID Cascade
F_193 CALCODE_ID CATENCALCD CALCODE_ID Cascade
F_212 CALCODE_ID CATGPCALCD CALCODE_ID Cascade
F_272 CALCODE_ID CPPMNDISC CALCODE_ID Cascade
F_491 CALCODE_ID ORDADJUST CALCODE_ID Cascade
F_495 CALCODE_ID ORDCALCD CALCODE_ID Cascade
F_522 CALCODE_ID ORDICALCD CALCODE_ID Cascade
F_693 CALCODE_ID RLDISCOUNT CALCODE_ID Cascade
F_769 CALCODE_ID STENCALUSG CALCODE_ID Cascade
F_927 CALCODE_ID SHPMODCLCD CALCODE_ID Cascade