Facebooktwittergoogle_plusredditpinterestlinkedin

Hi Everyone,

The purpose of this post is to help you fix a tax calculation error. By default, ADempiere calculates Sales Order and Customer Invoice tax based on the Bill To Address. This is not correct, at least not in the US.

The tax code can be somewhat confusing at first look. Let’s break it down to help you understand the code and, ultimately, fix the issue. There are two general areas where taxes are evaluated:

  1. When fields are modified (example: product and charge) that can change the tax consequences, the system will update the document line’s tax ID in real time. These changes happen in the CalloutOrder and CalloutInvoice classes. As you walk your way back through the code, you will land on the Tax.java’s getTax method at around line 489. You will notice that that even though the method passes both the ShipTo and the BillTo, the code only uses the BillTo to calculate tax. The simple fix is to use the ShipTo when available, else use the BillTo.
  2. When document lines are saved, the MOrderLine’s or MInvoiceLine’s beforeSave method will call on the setLineNetAmt method. This method uses the above TaxID to determine the total tax from this line.

The details listed in bullet one solve the stated issue. Bullet number two is included for reference to help complete the picture. If you would like help understanding how ADempiere or iDempiere function, let me know.

I hope this helps!!

Please note that ADempiere, iDempiere and Openbravo are forks or copies from Compiere. Therefore, they have similar abilities mentioned above. The biggest difference is that ADempiere and iDempiere are pure open source. There are no features held behind a commercial or paid license.

About Chuck Boecking: I am an ERP educator. I believe that open source ERP have achieved mainstream capabilities, and as a result, more companies can create greater efficiency across their organization. I started using the iDempiere code base in 2003. Back then, it was called Compiere. In 2006, I started my first multi-million dollar installation. Since then, ADempiere has helped me create great success with distribution and manufacturing companies all over the world. My vision of success is to find companies that can best use open source ERP to help them achieve a single, global instance that drives a discontinuous increase in profitability. I believe that organizations win when they own their technology.

If you have questions, comments or concerns, let me know. I definitely want your feedback.

You can contact me by phone using 512.850.6068.

My email is chuck@chuboe.com.

You can complete the form on this page.

Thank you for taking the time. I look forward to speaking with you.

Regards,
Chuck Boecking
http://www.linkedin.com/pub/chuck-boecking/10/970/17b

 

 

Facebooktwittergoogle_plusredditpinterestlinkedin

Leave a Reply

Your email address will not be published. Required fields are marked *