Develop > Controller layer > Integrate with back-end systems and external applications > Tax integration > Integrating WebSphere Commerce with Taxware


Add the Taxware data to the WebSphere Commerce database

Overview

To integrate WebSphere Commerce with Taxware, add the Taxware data for the published store to the database.

If a store does not already exist...

To integrate Taxware with the store, add the Taxware data to the WebSphere Commerce database.


Procedure

  1. Connect to the WebSphere Commerce database (for example, mall).

  2. Run the following commands to...

    If any of the delete commands fail because they cannot find a matching row to delete, the Taxware commands will 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 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 the store ID in the STOREENT database table.

    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')
    
    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.

    Do not use a negative ID since they are reserved for system use only.

    update stencalusg 
    set calmethod_id_app=sales_calmethod_ID 
    where calusage_id=-3 
      and storeent_id=store_ID
    

    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)
    
    
    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.

    update stencalusg 
    set calmethod_id_app=shipping_calmethod_ID 
    where calusage_id=-4 
      and storeent_id=store_ID
    

    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)
    

    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:

    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)
    

    For example, 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)
    
    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)
    
    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 (10001 ,
            5678, 
            null, 
            11001, 
            1234)
    

  4. Restart your WCS instance.


Previous topic: Deploy the TaxwareLink package to the WebSphere Commerce environment


Next topic: Enable promotions in Taxware


+

Search Tips   |   Advanced Search