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 Descriptions:

NameTypeDescription
CALCODE_IDINTEGER NOT NULLGenerated unique identifier.
CODECHAR (128) NOT NULLA character string that uniquely identifies this CalculationCode, given a particular CalculationUsage and StoreEntity.
CALUSAGE_IDINTEGER NOT NULLIndicates 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_IDINTEGER NOT NULLThe CalculationCode is part of this StoreEntity.
GROUPBYINTEGER NOT NULL DEFAULT 0Bit 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 combine 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.
TXCDCLASS_IDINTEGERFor Taxation CalculationCodes, the TaxCodeClassification, if any, associated with this CalculationCode.
PUBLISHEDINTEGER NOT NULL DEFAULT 0Specifies whether or not the calculation code is published: 0 = not published (temporarily disabled). 1 = published. 2 = marked for deletion (and not published).
SEQUENCEDOUBLE NOT NULL DEFAULT 0CalculationCodes are calculated and applied in sequence from lowest to highest. When using CalculationCodeCombineCmdImpl for code combine, calculation codes are calculated and applied in sequence from lowest to highest. When using TaxCalculationCodeCombineCmdImpl for code combine, only the one with highest sequence is calculated and applied.
COMBINATIONINTEGERReserved for HCL internal use.
LASTUPDATETIMESTAMPThe time this CalculationCode (including its CalculationRules) was most recently updated.
CALMETHOD_IDINTEGER NOT NULLThe CalculationCodeCalculateMethod that defines how to calculate a monetary amount for this CalculationCode.
CALMETHOD_ID_APPINTEGER NOT NULLThe CalculationCodeApplyMethod that stores the calculated amount for the associated OrderItems.
CALMETHOD_ID_QFYINTEGER NOT NULLThe CalculationCodeQualifyMethod that defines which OrderItems are associated with this CalculationCode.
FIELD1VARCHAR (254)Customizable.
DESCRIPTIONVARCHAR (254)A brief description of this CalculationCode, suitable for display by a user interface that manages CalculationCodes.
DISPLAYLEVELINTEGER NOT NULL DEFAULT 0Amounts calculated by this CalculationCode should be displayed with each: 0 = OrderItem 1 = Order 2 = Product 3 = Item 4 = Contract
STARTDATETIMESTAMPThe time this CalculationCode begins being effective.
ENDDATETIMESTAMPThe 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.
FLAGSINTEGER NOT NULL DEFAULT 0Specifies whether the CalculationCodeQualifyMethod of this CalculationCode should be invoked: 0 = unrestricted. The method will not be invoked. 1 = restricted. The method will be invoked.
PRECEDENCEDOUBLE NOT NULL DEFAULT 0Reserved for HCL internal use.
OPTCOUNTERSMALLINT NOT NULL DEFAULT 0The optimistic concurrency control counter for the table.

Indexes:

NameColumn NamesType
<SYSTEM-GENERATED>CALCODE_IDPrimary Key
I0000054CALUSAGE_ID+CODE+STOREENT_IDUnique Index
I0000495CALMETHOD_ID_APPNon-Unique Index
I0000496CALMETHOD_IDNon-Unique Index
I0000497CALMETHOD_ID_QFYNon-Unique Index
I0000498STOREENT_IDNon-Unique Index
I0001247TXCDCLASS_IDNon-Unique Index

Constrained By Parent Tables:

ConstraintColumnsParent TableParent ColumnsType
F_151CALUSAGE_IDCALUSAGECALUSAGE_IDCascade
F_152STOREENT_IDSTOREENTSTOREENT_IDCascade
F_153TXCDCLASS_IDTXCDCLASSTXCDCLASS_IDCascade
F_154CALMETHOD_ID_QFYCALMETHODCALMETHOD_IDCascade
F_155CALMETHOD_IDCALMETHODCALMETHOD_IDCascade
F_156CALMETHOD_ID_APPCALMETHODCALMETHOD_IDCascade

Referenced By Child Tables:

ConstraintColumnsChild TableChild ColumnsType
F_1059CALCODE_IDCLCDPROMOCALCODE_IDCascade
F_157CALCODE_IDCALCODEDSCCALCODE_IDCascade
F_160CALCODE_IDCALCODEMGPCALCODE_IDCascade
F_161CALCODE_IDCALCODTXEXCALCODE_IDCascade
F_169CALCODE_IDCALRULECALCODE_IDCascade
F_193CALCODE_IDCATENCALCDCALCODE_IDCascade
F_212CALCODE_IDCATGPCALCDCALCODE_IDCascade
F_272CALCODE_IDCPPMNDISCCALCODE_IDCascade
F_491CALCODE_IDORDADJUSTCALCODE_IDCascade
F_495CALCODE_IDORDCALCDCALCODE_IDCascade
F_522CALCODE_IDORDICALCDCALCODE_IDCascade
F_693CALCODE_IDRLDISCOUNTCALCODE_IDCascade
F_769CALCODE_IDSTENCALUSGCALCODE_IDCascade
F_927CALCODE_IDSHPMODCLCDCALCODE_IDCascade