Adding the Taxware data to the WebSphere Commerce database
To integrate WebSphere Commerce with Taxware, you must add the Taxware data for your published store to the database.
Before you begin
About this task
Procedure
- Connect to the WebSphere Commerce database (for example, mall).
- To set up Taxware commands in the CMDREG database table
and to configure these commands in the CALMETHOD, STENCALUSG, and
CALCODE database tables:Note: If any of the delete commands fail because they cannot find a matching row to delete, the Taxware commands still succeed.
delete from calmethod where name = 'ApplyCalculationUsageTIK'
delete from cmdreg where interfacename = 'com.ibm.commerce.ApplyOrderTaxesCmd'
insert into cmdreg (storeent_id, interfacename, description, classname, properties, target) values (store_ID, 'com.ibm.commerce.isv.kit.tax.TaxIntegrationOrderCmd', 'Taxware Tax Integration Kit implementation', 'com.taxware.utl.TaxwareIntegrationOrderCmdImpl', null, 'Local')
The following example shows store_ID with a value of10001
:
You can locate your store ID in the STOREENT database table.insert into cmdreg (storeent_id, interfacename, description, classname, properties, target) values (10001, 'com.ibm.commerce.isv.kit.tax.TaxIntegrationOrderCmd', 'Taxware Tax Integration Kit implementation', 'com.taxware.utl.TaxwareIntegrationOrderCmdImpl', null, 'Local')
insert into cmdreg (storeent_id, interfacename, description, classname, properties, target) values (store_ID, 'com.ibm.commerce.isv.kit.tax.TaxIntegrationOrderItemCmd', 'Taxware Tax Integration Kit implementation', 'com.taxware.utl.TaxwareIntegrationOrderItemCmdImpl', null, 'Local')
The following example shows store_ID with a value of10001
:insert into cmdreg (storeent_id, interfacename, description, classname, properties, target) values (10001, 'com.ibm.commerce.isv.kit.tax.TaxIntegrationOrderItemCmd', 'Taxware Tax Integration Kit implementation', 'com.taxware.utl.TaxwareIntegrationOrderItemCmdImpl', null, 'Local')
insert into calmethod (calmethod_id, storeent_id, calusage_id, taskname, description, subclass, name ) values (unique_ID, store_ID, -3, 'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageSalesTaxTIKCmd', 'Sales Tax', 12 , 'ApplyCalculationUsageSalesTaxTIK')
The following example shows unique_ID with a value of1235
and store_ID with a value of10001
:
You can choose a unique ID from the CALMETHOD database table.insert into calmethod (calmethod_id, storeent_id, calusage_id, taskname, description, subclass, name ) values (1235, 10001, -3, 'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageSalesTaxTIKCmd', 'Sales Tax', 12 , 'ApplyCalculationUsageSalesTaxTIK')
Note:- Do not use a negative ID since they are reserved for system use only.
- To configure tax calculations based on components of a kit, specify the
useComponentInfo=true
property in theproperties
field of theCMDREG
entry for the interface with nameApplyCalculationUsageSalesTaxTIKCmd
.If this entry does not exist, you can insert it with a statement similar to the following:insert into cmdreg (storeent_id, interfacename, description, classname, properties, target) values (store_ID, 'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageSalesTaxTIKCmd', ' Tax Sales Integration Kit implementation', 'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageSalesTaxTIKCmdImpl', 'useComponentInfo=true', 'Local');
update stencalusg set calmethod_id_app=sales_calmethod_ID where calusage_id=-3 and storeent_id=store_ID
Note: If the record does not exist in the STENCALUSG table:
where the value of sales_calmethod_ID is the ID that you chose from the CALMETHOD database table. For example:set sales_calmethod_ID = 1235
orupdate stencalusg set calmethod_id_app=1235 where calusage_id=-3 and storeent_id=-1
insert into stencalusg (storeent_id, calusage_id, actcc_calmethod_id, actrc_calmethod_id, calcode_id, calmethod_id_app, calmethod_id_sum, calmethod_id_fin, usageflags, calmethod_id_ini, sequence) values ( 10001, -3, -41, -45, null, 1235, -223, null, 1, -221, 3.0)
The following example shows unique_ID with a value ofinsert into calmethod (calmethod_id, storeent_id, calusage_id, taskname, description, subclass, name ) values (unique_ID, store_ID, -4, 'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageShippingTaxTIKCmd', 'Shipping Tax', 12 , 'ApplyCalculationUsageShippingTaxTIK')
1236
:
You can choose a unique ID from the CALMETHOD database table. Ensure that this ID is different from the one you specified earlier.insert into calmethod (calmethod_id, storeent_id, calusage_id, taskname, description, subclass, name ) values (1236, 10001, -4, 'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageShippingTaxTIKCmd', 'Shipping Tax', 12 , 'ApplyCalculationUsageShippingTaxTIK')
update stencalusg set calmethod_id_app=shipping_calmethod_ID where calusage_id=-4 and storeent_id=store_ID
Note: If the record does not exist in the STENCALUSG table:
For example:insert into stencalusg (storeent_id, calusage_id, actcc_calmethod_id, actrc_calmethod_id, calcode_id, calmethod_id_app, calmethod_id_sum, calmethod_id_fin, usageflags, calmethod_id_ini, sequence) values (store_ID, -4, -61, -65, null, shipping_calmethod_ID, -233, null, 1, -231, 4.0)
where the value of shipping_calmethod_ID is the ID that you chose from the CALMETHOD database table orshipping_calmethod_ID = 1236 update stencalusg set calmethod_id_app=1236 where calusage_id=-4 and storeent_id=-1
insert into stencalusg (storeent_id, calusage_id, actcc_calmethod_id, actrc_calmethod_id, calcode_id, calmethod_id_app, calmethod_id_sum, calmethod_id_fin, usageflags, calmethod_id_ini, sequence) values ( 10001, -4, -61, -65, null, 1236, -233, null, 1, -231, 4.0)
The following example shows store_ID with a value ofinsert into cmdreg (storeent_id, interfacename, description, classname, properties, target) values (store_ID, 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageSalesTaxTIKCmd', 'Taxware Tax Sales Integration Kit implementation', 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageSalesTaxTIKCmdImpl', null, 'Local')
10001
:insert into cmdreg (storeent_id, interfacename, description, classname, properties, target) values (10001, 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageSalesTaxTIKCmd', 'Taxware Tax Sales Integration Kit implementation', 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageSalesTaxTIKCmdImpl', null, 'Local')
- Run the following commands to set up the CalculationCode
to interface with WebSphere Commerce:
If you use the following values:insert into calcode (calcode_id, code, calusage_id, storeent_id, calmethod_id, calmethod_id_app, calmethod_id_qfy, description, published, sequence) values (calcode_ID,'tax_code',-3, store_ID, -43, -44, -42, 'tax_code_description', 1,1.0)
The resulting command is:Value Description calcode_ID = 1234 A unique ID, selected from the CALCODE database table. tax_code = 4200 A unique string that represents the tax code. tax_code_description = Clothing Tax Code The description of the tax code. insert into calcode (calcode_id, code, calusage_id, storeent_id, calmethod_id, calmethod_id_app, calmethod_id_qfy, description, published, sequence) values (1234, '42000',-3, 10001, -43, -44, -42, 'Clothing Tax Code', 1,1.0)
For example, if you use the following values:insert into catencalcd (store_id, catencalcd_id, trading_id, catentry_id, calcode_id ) values ( store_ID , unique_ID , null, null, calcode_ID)
The resulting command is:Value Description unique_ID = 1234 A unique ID selected from the CATENCALCD database table. calcode_ID = 1234 The ID that you chose in the previous command. insert into catencalcd (store_id, catencalcd_id, trading_id, catentry_id, calcode_id ) values (10001 ,1234 , null, null, 1234)
insert into CATGPCALCD (store_id, CATGPCALCD_ID, trading_id, CATGROUP_ID, calcode_id ) values ( store_ID , unique_ID , null, some catgroup ID, calcode_ID)
For example, if you use the following values:
The resulting command is:Value Description unique_ID = 5678 A unique ID selected from the CATENCALCD database table. calcode_ID = 1234 The ID that you chose in the previous command. catgroup_ID = 11001 The CatGroup ID. insert into CATGPCALCD (store_id, CATGPCALCD_ID, trading_id, CATGROUP_ID, calcode_id ) values values (10001 ,5678, null, 11001, 1234)
- Optional: If
tax audit function is enabled. Run the following
commands to configure command in the CALMETHOD and STENCALUSG tables.
insert into calmethod (calmethod_id, storeent_id, calusage_id, taskname, description, subclass, name ) values (unique_ID, store_ID, -3, 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageSalesTaxTIKCmd', 'Finalize Sales Tax', 14 , 'TaxCalculationUsageSalesTaxTIKCmd')
The following example shows unique_ID with a value of 1240 and store_ID with a value of 10001:
You can choose a unique ID from the CALMETHOD database table. Ensure that this ID is different from the one you specified earlier.insert into calmethod (calmethod_id, storeent_id, calusage_id, taskname, description, subclass, name ) values (1240, 10001, -3, 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageSalesTaxTIKCmd', 'Finalize Sales Tax', 14 , 'TaxCalculationUsageSalesTaxTIKCmd')
Note: Do not use a negative ID since they are reserved for system use only.update stencalusg set calmethod_id_fin=fin_salestax_calmethod_ID where calusage_id=-3 and storeent_id=store_ID
The following example shows fin_salestax_calmethod_ID with 1240 and store_ID with 10001
update stencalusg set calmethod_id_fin=1240 where calusage_id=-3 and storeent_id=10001
insert into calmethod (calmethod_id, storeent_id, calusage_id, taskname, description, subclass, name ) values (unique_ID, store_ID, -4, 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageShippingTaxTIKCmd', 'Finalize Shipping Tax', 14 , 'TaxCalculationUsageShippingTaxTIKCmd')
The following example shows unique_ID with a value of 1241 and store_ID with a value of 10001:
You can choose a unique ID from the CALMETHOD database table. Ensure that this ID is different from the one you specified earlier.insert into calmethod (calmethod_id, storeent_id, calusage_id, taskname, description, subclass, name ) values (1241, 10001, -4, 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageShippingTaxTIKCmd', 'Finalize Shipping Tax', 14 , 'TaxCalculationUsageShippingTaxTIKCmd')
Note: Do not use a negative ID since they are reserved for system use only.update stencalusg set calmethod_id_fin=fin_shippingtax_calmethod_ID where calusage_id=-4 and storeent_id=store_ID
The following example shows fin_shippingtax_calmethod_ID with 1241 and store_ID with 10001:update stencalusg set calmethod_id_fin=1241 where calusage_id=-4 and storeent_id=10001
- Restart your WebSphere Commerce instance.