Reference > Database > WebSphere Commerce database tables > C
WebSphere Commerce 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 Description CALCODE_ID INTEGER NOT NULL Generated unique identifier. CODE CHAR(128) NOT NULL A character string that uniquely identifies this CalculationCode, given a particular CalculationUsage and StoreEntity. 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. Out of box: -1 is for Discount, -2 is for Shipping, -3 is for Sales Tax. -4 is for Shipping Tax, -5 is for Coupon and -6 is for Surcharge. STOREENT_ID INTEGER NOT NULL The CalculationCode is part of this StoreEntity. 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:
Bit flags can be added together to combine groupings. For example:
- 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.
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.TXCDCLASS_ID INTEGER For Taxation CalculationCodes, the TaxCodeClassification, if any, associated with this CalculationCode. 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. COMBINATION INTEGER For schema based discount, this column is used to check if there is a combination between CALCODE and CALRULE.
For rules based discount, this column is used to check if this Promotion requires a PromotionCode.LASTUPDATE TIMESTAMP The time this CalculationCode (including its CalculationRules) was most recently updated. 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. FIELD1 VARCHAR(254) Customizable. DESCRIPTION VARCHAR(254) 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.
STARTDATE TIMESTAMP The time this CalculationCode begins being effective. ENDDATE TIMESTAMP The time this calculation code 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. 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.PRECEDENCE DOUBLE NOT NULL DEFAULT 0 Reserved for IBM internal use. OPTCOUNTER SMALLINT Reserved for IBM internal use.
Indexes Index Name Indexed Column Names Index Type I0000054 CALUSAGE_ID+CODE+STOREENT_ID Unique Index SQL100520030307330 CALCODE_ID Primary Key I0000495 CALMETHOD_ID_APP Non-Unique Index I0000496 CALMETHOD_ID Non-Unique Index I0000497 CALMETHOD_ID_QFY Non-Unique Index I0000498 STOREENT_ID Non-Unique Index I0001247 TXCDCLASS_ID Non-Unique Index
Constraints Constraint Name Column Names Foreign Table Name Foreign Column Names Constraint Type 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 F_151 CALUSAGE_ID CALUSAGE CALUSAGE_ID Cascade F_152 STOREENT_ID STOREENT STOREENT_ID Cascade F_153 TXCDCLASS_ID TXCDCLASS TXCDCLASS_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_1059 CALCODE_ID CLCDPROMO 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_927 CALCODE_ID SHPMODCLCD CALCODE_ID Cascade F_769 CALCODE_ID STENCALUSG CALCODE_ID Cascade
Related reference
- Calculation usage data model
- Calculation rule - tax data model
- Calculation rule - shipping data model
- Calculation rule - discount data model
- Tax type and category data model
- Order adjustment data model
- Calculation method data model
- Calculation rule data model
- E-coupon data model
- E-promotions data model
- Calculation code data model
- Calculation code - direct attachment data model
- Calculation code - indirect attachment data model
_vcc_freeselect_bottom_