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

If a store does not exist, you must first publish a store, and then add the Taxware data for the published store to the database.

About this task

To integrate Taxware with your store, add the Taxware data to the WebSphere Commerce database. For information about how to publish a starter store, see Publishing a store archive.

Procedure

  1. Connect to the WebSphere Commerce database (for example, mall).
  2. 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.
    1. delete from calmethod where name = 'ApplyCalculationUsageTIK'
    2. delete from cmdreg where interfacename = 'com.ibm.commerce.ApplyOrderTaxesCmd'
    3. 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 of 10001:
      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')
      You can locate your store ID in the STOREENT database table.
    4. 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 of 10001:
      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')
    5. 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 of 1235 and store_ID with a value of 10001:
      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')
      You can choose a unique ID from the CALMETHOD database table.
      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 the properties field of the CMDREG entry for the interface with name ApplyCalculationUsageSalesTaxTIKCmd.
        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');
        
    6. 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:
      set sales_calmethod_ID = 1235 
      where the value of sales_calmethod_ID is the ID that you chose from the CALMETHOD database table. For example:
      update stencalusg set calmethod_id_app=1235 where calusage_id=-3 and storeent_id=-1 
      or
      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)
    7. 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.ApplyCalculationUsageShippingTaxTIKCmd', 'Shipping Tax', 12 , 'ApplyCalculationUsageShippingTaxTIK')
      The following example shows unique_ID with a value of 1236:
      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')
      You can choose a unique ID from the CALMETHOD database table. Ensure that this ID is different from the one you specified earlier.
    8. 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:
      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)
      For example:
      shipping_calmethod_ID = 1236
      update stencalusg set calmethod_id_app=1236 where calusage_id=-4 and storeent_id=-1
      where the value of shipping_calmethod_ID is the ID that you chose from the CALMETHOD database table or
      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)
    9. insert 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')
      The following example shows store_ID with a value of 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')
  3. Run the following commands to set up the CalculationCode to interface with WebSphere Commerce:
    1. 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)
      If you use the following values:
      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.
      The resulting command is:
      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)
    2. insert into catencalcd (store_id, catencalcd_id, trading_id, catentry_id, calcode_id ) values ( store_ID , unique_ID , null, null, calcode_ID)
      For example, if you use the following values:
      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.
      The resulting command is:
      insert into catencalcd (store_id, catencalcd_id, trading_id, catentry_id, calcode_id ) values (10001 ,1234 , null, null, 1234)
    3. 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:
      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.
      The resulting command is:
      insert into CATGPCALCD (store_id, CATGPCALCD_ID, trading_id, CATGROUP_ID, 
      calcode_id ) values values (10001 ,5678, null, 11001, 1234)
  4. Optional: If tax audit function is enabled. Run the following commands to configure command in the CALMETHOD and STENCALUSG tables.
    1. 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:

      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')
      You can choose a unique ID from the CALMETHOD database table. Ensure that this ID is different from the one you specified earlier.
      Note: Do not use a negative ID since they are reserved for system use only.
    2. 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 
    3. 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:

      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')
      You can choose a unique ID from the CALMETHOD database table. Ensure that this ID is different from the one you specified earlier.
      Note: Do not use a negative ID since they are reserved for system use only.
    4. 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
  5. Restart your WebSphere Commerce instance.