Thursday, October 10, 2013

Tax customizations to update tax from third party !!

While customizing tax integration with third party, it is important to understand the end points provided by commerce to customize.
Please find below out of box commerce tables and commands that needs to be customized.


INSERT INTO CALMETHOD (CALMETHOD_ID, STOREENT_ID, CALUSAGE_ID, TASKNAME, 
DESCRIPTION, SUBCLASS, NAME) VALUES ((select coalesce((min(calmethod_id)-1),1)
from calmethod), 10701 , -3,'com.custom.commerce.order.calculation.ApplyCalculationUsageCmd', 'custommethod for calculation sales taxes', 12, 'ApplyCalculationUsageSalesTax')

update stencalusg SET CALMETHOD_ID_APP = 
(SELECT CALMETHOD_ID FROM CALMETHOD WHERE TASKNAME = 'com. custom .commerce.order.calculation.ApplyCalculationUsageCmd'
AND STOREENT_ID = 10701 AND CALUSAGE_ID = -3) and calusage_id=-3

insert into CMDREG (STOREENT_ID, INTERFACENAME, DESCRIPTION, CLASSNAME, PROPERTIES, LASTUPDATE, TARGET) values 
(0,'com.custom.commerce.order.calculation.ApplyCalculationUsageCmd','Sales Tax calculation usage for third-party tax 
providers','com.custom.commerce.order.calculation.ApplyCalculationUsageSalesTaxCmdImpl',null,null,'Local')

//out of the box command required to be extended.
public class ApplyCalculationUsageSalesTaxCmdImpl extends ApplyCalculationUsageCmdImpl implements com.custom.commerce.order.calculation.ApplyCalculationUsageCmd{

    public static final String CLASSNAME = ApplyCalculationUsageSalesTaxCmdImpl.class.getName();

    private static Logger LOGGER = Logger.getLogger(CLASSNAME);

   public void performExecute()

    throws ECException
   {
       String methodName = "performExecute";
       if (LoggingHelper.isEntryExitTraceEnabled(LOGGER)) {
           LOGGER.entering(CLASSNAME, methodName);
       }
    
     //get tax from Third party
       BigDecimal orderTax = new BigDecimal(100.00);
       
       Item[] items = super.getItems();
       // set on first order item
       for (int i = 0; i < 1; i++) {
            items[i].setSalesTaxTotal(orderTax);
            items[i].commit();
       }
       if (LoggingHelper.isEntryExitTraceEnabled(LOGGER)) {
           LOGGER.exiting(CLASSNAME, methodName);
       }
   }   


10 comments:

  1. While customizing tax integration with third party, it is important to understand the end points provided by commerce to customize.dottore commercialista milano

    ReplyDelete
  2. This is wonderful! I love the bit about hoping. That's the thing that really got me to make my final decision to sign with my agent; she had this amazing optimism just leaking out of her pores when she called to offer representation.

    ReplyDelete
  3. Nice article, Which you have shared here about the taxation. Your article is very informative and useful to know more about the tax customization. Thanks for sharing this article here. free tax software canada

    ReplyDelete
  4. When the decedent's government annual tax return(s) has been documented with the IRS the Fiduciary may record a composed application mentioning discharge from individual risk for money and blessing taxes. Verfahrensdokumentation Vorlage

    ReplyDelete
  5. This is an amazing blog; I was trying to figure out how to keep in contact with your blog until I found a decent information about tax customization. I really wish you to have a good day and keep with the good work! CRA Address Change

    ReplyDelete
  6. Interpersonal and relational abilities, which help in scattering data about the organization's moral approaches and help criminological accountants to lead meets and acquire significantly required data. London accountant

    ReplyDelete
  7. La verdad es que la información es buena y amena, su fácil comprensión me ha atrapado desde el primer momento y ha conseguido que me informe de lo que quería saber. Se nota que estás encantado con lo que haces. =)

    ReplyDelete
  8. La verdad es que la información es buena y amena, su fácil comprensión me ha atrapado desde el primer momento y ha conseguido que me informe de lo que quería saber. Se nota que estás encantado con lo que haces. =)

    ReplyDelete
  9. No es lo que estaba buscando ahora mismo, pero el post me ha llamado bastante la atención ya que te cuenta cosas interesantes que pueden ser útiles, encima se nota que le has puesto mucho esfuerzo ¡felicidades!

    ReplyDelete
  10. What's up i am kavin, itss my first occasion to commenting anywhere,
    when i read this article i thoght i could also create
    comment due to this brilliant post.

    ReplyDelete