External Tax Calculation and Outstanding Amount

Noisy_VanNoisy_Van Member Posts: 47
Hello,

I am in the process of creating a customization that overrides the stock NAV tax calculation in NAV 2009. I had been using the built in external tax engine functionality provided by NAV, which has worked fairly well so far (couple small bugs with the stock NAV code with this, but no big deal).

Anyway, when tracking down a bug, I have found something I did not expect. There is a tax calculation performed each time a sales line is validated. This is performed in order to initialize the Outstanding Amount. In the "Sales Line".InitOutstandingAmount() method, tax is calculated for the line using the SalesTaxCalculate.CalculateTax() method. However, there is no check here to see if external tax calculation should be performed or not. So it is just assuming that it should use stock NAV tax calculation. It seems like this was overlooked when adding the external tax engine functionality.

I have located at least one issue that pops up because of this. If I try to print a test report for an invoice that is open, and include the Summary, the tax amount I calculate won't be included, as the report is going straight to the OutstandingAmount field to figure out the total for the invoice. For released documents, it is not a problem, as the outstanding amount gets populated in the release process. I can insert some code into this particular report (Sales Document - Test) to override this amount with the correct amount. Or I can override the "Sales Line".InitOutstandingAmount() method to perform our tax calculation. The latter option is really not preferred as the calculation can take 2-3 seconds due to being web based, and InitOutstandingAmount() is called often.

My question is this. Is there anywhere else that this outstanding amount is used? If this is the only place, I'll simply override the amount that is pulled in by the report. If it's used in many places, I may have to rethink things a bit.

Any help is greatly appreciated.

Thanks,
Greg

Comments

Sign In or Register to comment.