Develop > Controller layer > Application developer > Tax codes > Value Added Tax (VAT)


Enable Value Added Tax (VAT) at store level

How to register the VAT set of commands to enable VAT at store level.

You need to register the new set of tax commands in order to enable VAT. VAT can be enabled at both store level and site level, although usually it is enabled at store level.


Procedure

  1. Add the new calculation method for VAT calculation by running SQL statements similar to:

    insert into calmethod(CALMETHOD_ID,STOREENT_ID,CALUSAGE_ID,TASKNAME,DESCRIPTION,SUBCLASS,NAME) 
    values(@any unique id 1, @customer's store ID,-3,'com.ibm.commerce.order.calculation.VATCalculationRuleCombineCmd', 'default method to identify sales tax rules (referenced by STENCALUSG.ACTRC_CALMETHOD_ID) when Value-Added-Tax is
    enabled',5,'VATCalculationRuleCombine (sales tax)')
    

    insert into calmethod(CALMETHOD_ID,STOREENT_ID,CALUSAGE_ID,TASKNAME,DESCRIPTION,SUBCLASS,NAME) 
    values(@any unique id 2, @customer's store ID,-4,'com.ibm.commerce.order.calculation.VATCalculationRuleCombineCmd', 'default method to identify shipping tax rules (referenced by STENCALUSG.ACTRC_CALMETHOD_ID) when Value-Added-Tax is
    enabled',5,'VATCalculationRuleCombine (shipping tax)')
    

  2. Register the new calculation methods for sales tax and shipping tax's calculation.

    • If defaults are defined at the site level, run SQL statements similar to:

      insert into stencalusg (storeent_id, calusage_id, actcc_calmethod_id, actrc_calmethod_id,calmethod_id_app,calmethod_id_sum,usageflags,calmethod_id_ini,sequence) values(<store_id>,-3,-61,@any unique id 2,-232,-233,1,-231,<sequence>); 
      

      insert into stencalusg (storeent_id, calusage_id, actcc_calmethod_id, actrc_calmethod_id,calmethod_id_app,calmethod_id_sum,usageflags,calmethod_id_ini,sequence) values(<store_id>,-4,-61,@any unique id 2,-232,-233,1,-231,<sequence>); 
      

    • If defaults are defined at the store level, run SQL statements similar to:

      update stencalusg set ACTRC_CALMETHOD_ID=
      @any unique id 1 where storeent_id=@customer's store ID and calusage_id=-3
      

      update stencalusg set ACTRC_CALMETHOD_ID=
      @any unique id 2 where storeent_id=@customer's store ID and calusage_id=-4
      

  3. Register the command to calculate tax for a single catalog entry before adding it to an order by running SQL statements similar to:

    insert into cmdreg(STOREENT_ID,INTERFACENAME,CLASSNAME,TARGET)
    values(@customer's store ID, 'com.ibm.commerce.taxation.commands.GetDisplayTaxesCmd', 'com.ibm.commerce.taxation.commands.GetDisplayVATTaxesCmdImpl','Local')
    

  4. Register the proper implementation for OrderCalculateCmd.

    • If defaults are defined at the site level:

      If you are using com.ibm.commerce.order.commands.PromotionEngineOrderCalculateCmdImpl as the implementation of OrderCalculateCmd, then we will need to use:

      insert into cmdreg(STOREENT_ID,INTERFACENAME,CLASSNAME,TARGET) values(<store_id>, 'com.ibm.commerce.order.commands.OrderCalculateCmd','com.ibm.commerce.order.commands.VATPromotionEngineOrderCalculateCmdImpl', 'Local');
      

      If you are using com.ibm.commerce.order.commands.OrderCalculateCmdImpl as the implementation of OrderCalculateCmd, then we will need to use:

      insert into cmdreg(STOREENT_ID,INTERFACENAME,CLASSNAME,TARGET) values(<store_id>, 'com.ibm.commerce.order.commands.OrderCalculateCmd','com.ibm.commerce.order.commands.VATOrderCalculateCmdImpl', 'Local');
      

    • If defaults are defined at the store level:

      If you are using com.ibm.commerce.order.commands.PromotionEngineOrderCalculateCmdImpl as the implementation of OrderCalculateCmd, then we will need to use:

      update cmdreg set CLASSNAME='com.ibm.commerce.order.commands.VATPromotionEngineOrderCalculateCmdImpl'
      where interfacename = 'com.ibm.commerce.order.commands.OrderCalculateCmd' and storeent_id=@customer's store id
      

      If you are using com.ibm.commerce.order.commands.OrderCalculateCmdImpl as the implementation of OrderCalculateCmd, then we will need to use:

      update cmdreg set CLASSNAME='com.ibm.commerce.order.commands.VATOrderCalculateCmdImpl'
      where interfacename = 'com.ibm.commerce.order.commands.OrderCalculateCmd' and storeent_id=@customer's store id
      

  5. Register the command to sum a single order's total amount by running an SQL statement similar to:

    insert into cmdreg(STOREENT_ID,INTERFACENAME,CLASSNAME, TARGET)
    values(@customer's store id,'com.ibm.commerce.order.commands.GetOrderTotalAmountCmd', 'com.ibm.commerce.order.commands.VATGetOrderTotalAmountCmdImpl','Local')
    

  6. Register the command to sum a set of order items' total amount by running an SQL statement similar to:

    insert into cmdreg(STOREENT_ID,INTERFACENAME,CLASSNAME,TARGET)
    values(@customer's store id,'com.ibm.commerce.orderitems.commands.GetOrderItemsTotalAmountCmd', 'com.ibm.commerce.orderitems.commands.VATGetOrderItemsTotalAmountCmdImpl','Local')
    

  7. Register the command to sum up a history order's total amount by running an SQL statement similar to:

    insert into cmdreg(STOREENT_ID,INTERFACENAME,CLASSNAME,TARGET)
    values(@customer's store id,'com.ibm.commerce.order.commands.GetHistoryOrderTotalAmountCmd', 'com.ibm.commerce.order.commands.VATGetHistoryOrderTotalAmountCmdImpl','Local')
    

  8. Register the command to sum up an order release's total amount by running an SQL statement similar to:

    insert into cmdreg(STOREENT_ID,INTERFACENAME,CLASSNAME,TARGET)
    values(@customer's store id,'com.ibm.commerce.order.commands.GetOrderReleaseTotalAmountCmd', 'com.ibm.commerce.order.commands.VATGetOrderReleaseTotalAmountCmdImpl','Local')
    

    After registering the above SQL commands, restart the server to make them take effect.


+

Search Tips   |   Advanced Search