Install the tax integration interface
To install and configure the tax integration interface, register the new commands provided by the tax integration kit to the database. If you are using third-party tax software, sales tax and shipping tax are now separated into individual commands for the Tax Integration Kit. If separate sales tax and shipping tax to allow separate auditing of sales and shipping tax, follow these steps instead.
For a store to use the new command provided by the tax integration kit for tax calculation, register the new commands, ApplyCalculationUsageCmd and TaxCalculationUsageTIKCmd, to the WebSphere Commerce database, by updating the CALMETHOD and STENCALUSG tables...
- Insert a new entry for ApplyCalculationUsageCmd in the CALMETHOD table.
Column Values CALMETHOD_ID The key, a unique ID that is assigned to the entry. STOREENT_ID -1 or the store_ID CALUSAGE_ID -3 TASKNAME com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageTIKCmd DESCRIPTION This is a description of the sales tax method of the ISV. SUBCLASS 12 NAME ApplyCalculationUsageTIK Use the following sample SQL statements as your guide:
DELETE FROM calmethod WHERE TASKNAME = 'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageTIKCmd' AND STOREENT_ID = store_ID AND CALUSAGE_ID = -3INSERT INTO CALMETHOD (CALMETHOD_ID, STOREENT_ID, CALUSAGE_ID, TASKNAME, DESCRIPTION, SUBCLASS, NAME) VALUES ((select coalesce((min(calmethod_id)-1),1) from calmethod), store_ID , -3 'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageTIKCmd', 'default method for calculation taxes using Taxcompany', 12, 'ApplyCalculationUsageTIK')
- Insert a new entry for TaxCalculationUsageTIKCmd in the CALMETHOD table.
Column Values CALMETHOD_ID The key, a unique ID that is assigned to the entry. STOREENT_ID -1 or the store_ID CALUSAGE_ID -3 TASKNAME com.ibm.commerce.isv.kit.tax.TaxCalculationUsageTIKCmd DESCRIPTION This is a description of the sales tax method of the ISV. SUBCLASS 14 NAME TaxCalculationUsageTIK Use the following sample SQL statements as your guide:
DELETE FROM calmethod WHERE TASKNAME = 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageTIKCmd' AND STOREENT_ID = store_ID AND CALUSAGE_ID = -3INSERT INTO CALMETHOD (CALMETHOD_ID, STOREENT_ID, CALUSAGE_ID, TASKNAME, DESCRIPTION, SUBCLASS, NAME) VALUES ((select coalesce((min(calmethod_id)-1),1) from calmethod), store_ID, -3, 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageTIKCmd', 'default method for setting audit flag using Taxcompany', 14, 'TaxCalculationUsageTIK')
- Update the STENCALUSG table with the new CALMETHOD ID (obtained from above) for the store:
update STENCALUSG set CALMETHOD_ID_APP =CALMETHOD_ID whereCALUSAGE_ID = -3 and STOREENT_ID =store_ID
Use the following sample SQL statements as your guide:
UPDATE STENCALUSG SET (CALMETHOD_ID_APP, CALMETHOD_ID_FIN) = ((SELECT CALMETHOD_ID FROM CALMETHOD WHERE TASKNAME = 'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageTIKCmd' AND STOREENT_ID = store_ID AND CALUSAGE_ID = -3), (SELECT CALMETHOD_ID FROM CALMETHOD WHERE TASKNAME = 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageTIKCmd' AND STOREENT_ID = store_ID AND CALUSAGE_ID = -3)) WHERE CALUSAGE_ID = -3 and STOREENT_ID = store_ID- If the
CMDREG contains an entry with this interface name, then remove the entry: com.ibm.commerce.taxation.commands.ApplyOrderTaxesCmdThe tax software vendor also would require you to register the TaxOrderCmd and TaxOrderItemCmd commands in the CMDREG table. Refer to the tax software vendor's documentation for details.
Use the following sample SQL statements as your guide:
DELETE FROM cmdreg WHERE storeent_id = store_ID AND interfacename = 'com.ibm.commerce.isv.kit.tax.TaxOrderCmd' AND classname = 'com.taxcompany.utl.TaxcompanyOrderCmdImpl'INSERT INTO cmdreg (storeent_id, interfacename, description, classname, properties, target) VALUES (store_ID, 'com.ibm.commerce.isv.kit.tax.TaxOrderCmd', 'Taxcompany Tax Integration Kit implementation', 'com.taxcompany.utl.TaxcompanyOrderCmdImpl', null, 'Local')
DELETE FROM cmdreg WHERE storeent_id = store_ID AND interfacename = 'com.ibm.commerce.isv.kit.tax.TaxOrderItemCmd' AND classname = 'com.taxcompany.utl.TaxcompanyOrderItemCmdImpl'
INSERT INTO cmdreg (storeent_id, interfacename, description, classname, properties, target) VALUES (store_ID, 'com.ibm.commerce.isv.kit.tax.TaxOrderItemCmd', 'Taxaware Tax Integration Kit implementation', 'com.taxcompany.utl.TaxcompanyOrderItemCmdImpl', null, 'Local')
Note: Use 0 (site) or store_ID.
Steps for separate sales tax and shipping tax when using third-party tax software
Sales tax and shipping tax can be separated into individual commands for the Tax Integration Kit (third-party tax software). This separation allows individual auditing of sales tax and shipping tax.
Complete the following steps to audit sales and shipping tax separately:
- Add the following SQL statement to update the CMDREG table:
db2 insert into CMDREG (STOREENT_ID, INTERFACENAME, DESCRIPTION, CLASSNAME, PROPERTIES, LASTUPDATE, TARGET) values (0,'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageSalesTaxTIKCmd','Sales Tax calculation usage for third-party tax providers','com.ibm.commerce.isv.kit.tax.TaxCalculationUsageSalesTaxTIKCmdImpl',null,null,'Local')db2 insert into CMDREG (STOREENT_ID, INTERFACENAME, DESCRIPTION, CLASSNAME, PROPERTIES, LASTUPDATE, TARGET) values (0,'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageShippingTaxTIKCmd','Shipping Tax calculation usage for third-party tax providers','com.ibm.commerce.isv.kit.tax.TaxCalculationUsageShippingTaxTIKCmdImpl',null,null,'Local')
db2 insert into CMDREG (STOREENT_ID, INTERFACENAME, DESCRIPTION, CLASSNAME, PROPERTIES, LASTUPDATE, TARGET) values (0,'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageSalesTaxTIKCmd','Apply Sales Tax calculation usage for third-party tax providers','com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageSalesTaxTIKCmdImpl',null,null,'Local');db2 insert into CMDREG (STOREENT_ID, INTERFACENAME, DESCRIPTION, CLASSNAME, PROPERTIES, LASTUPDATE, TARGET) values (0,'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageShippingTaxTIKCmd','Apply Shipping Tax calculation usage for third-party tax providers','com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageShippingTaxTIKCmdImpl',null,null,'Local');
- Add the following SQL statement to update the CALMETHOD table:
db2 insert into CALMETHOD (CALMETHOD_ID, STOREENT_ID, CALUSAGE_ID, TASKNAME, DESCRIPTION, SUBCLASS, NAME) VALUES ((select coalesce((min(calmethod_id)-1),1) from calmethod), store_ID, -3, 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageSalesTaxTIKCmd', 'default method for setting audit flag for sales tax using third-party tax software', 14, 'TaxCalculationUsageSalesTaxTIK')
db2 insert into CALMETHOD (CALMETHOD_ID, STOREENT_ID, CALUSAGE_ID, TASKNAME, DESCRIPTION, SUBCLASS, NAME) VALUES ((select coalesce((min(calmethod_id)-1),1) from calmethod), store_ID, -4, 'com.ibm.commerce.isv.kit.tax.TaxCalculationUsageShippingTaxTIKCmd', 'default method for setting audit flag for shipping using third-party tax software', 14, 'TaxCalculationUsageShippingTaxTIK')
insert into CALMETHOD (CALMETHOD_ID, STOREENT_ID, CALUSAGE_ID, TASKNAME, DESCRIPTION, SUBCLASS, NAME) VALUES ((select coalesce((min(calmethod_id)-1),1) from calmethod), store_ID, -3, 'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageSalesTaxTIKCmd', 'applies calculation usage sales tax', 14, 'ApplyCalculationUsageSalesTaxTIK')
insert into CALMETHOD (CALMETHOD_ID, STOREENT_ID, CALUSAGE_ID, TASKNAME, DESCRIPTION, SUBCLASS, NAME) VALUES ((select coalesce((min(calmethod_id)-1),1) from calmethod), store_ID, -4, 'com.ibm.commerce.isv.kit.tax.ApplyCalculationUsageShippingTaxTIKCmd', 'applies calculation usage shipping tax', 14, 'ApplyCalculationUsageShippingTaxTIK')
..where store_ID is the store or store group ID.
- Refresh the Calculation registry and Command registry from the Commerce Admin Console.
- Set the STENCALUSG.CALMETHOD_ID_FIN column. The STENCALUSG table must be updated so that TaxCalculationUsageSalesTaxTIKCmd and TaxCalculationUsageShippingTaxTIKCmd are called for your store.
Query the CALMETHOD table to find the CALMETHOD_ID values for com.ibm.commerce.isv.kit.tax.TaxCalculationUsageSalesTaxTIKCmd and com.ibm.commerce.isv.kit.tax.TaxCalculationUsageShippingTaxTIKCmd. Using those values, update the STENCALUSG table so that CALMETHOD_ID_FIN for shipping and sales is called. Use the following SQL statements to update the STENCALUSG table:
To update stencalusg
set CALMETHOD_ID_FIN=calmethod_ID_1 where STOREENT_ID=store_ID and CALUSAGE_ID=calusage_ID_1To update stencalusgset CALMETHOD_ID_FIN=calmethod_ID_2 where STOREENT_ID=store_ID and CALUSAGE_ID=calusage_ID_2...where calmethod_ID_1 is the CALMETHOD_ID for TaxCalculationUsageSalesTaxTIKCmd, calmethod_ID_2 is the CALMETHOD_ID for TaxCalculationUsageShippingTaxTIKCmd, store_ID is the store or store group ID, calusage_ID_1 is the calculation usage ID for sales tax (-3), and calusage_ID_2 is the calculation usage value for shipping tax (-4).
The tax software vendor also requires you to register the TaxOrderCmd and TaxOrderItemCmd commands in the CMDREG table. Refer to the tax software vendor's documentation for details.