I haven't tested the tax method out (need to fix my development environment, so going off memory), but I don't think it works against the journal header (or journals at all, only order lines and free text lines) judging by how it's used in the standard application.
Sleeping on it, the best bet might be to just replicate the display method, since it's fairly simple if we disregard any country/region functionality. It might not be needed in your case.
If we examine the form display method, it contains the following code (as of 10.0.40). I have blacked out any country/region functionality we don't care about:
display TaxBase displayTaxBaseAmount(TaxTrans _taxTrans)
{
//<GEECZ>
changeDisplaySign = this.doChangeDisplaySign(_taxTrans);
//</GEECZ>
return _taxTrans.TaxBaseAmount * this.taxChangeDisplaySign(_taxTrans.TaxDirection, _taxTrans.ReverseCharge_W, Tax::changeSignForReverseCharge(_taxTrans));
}
The method taxChangeDisplaySign
contains the following code:
private int taxChangeDisplaySign(TaxDirection _taxDirection, TaxReverseCharge _taxReverseCharge = NoYes::No, boolean _changeSignForReverseCharge = true)
{
if (changeDisplaySign && (_taxReverseCharge == NoYes::No || _changeSignForReverseCharge))
{
return Tax::changeDisplaySign(_taxDirection);
}
else
{
return 1;
}
}
So, looking at the code, we can see that:
_taxTrans.TaxBaseAmount
._taxTrans.TaxDirection
, and a call to Tax::changeSignForReverseCharge(_taxTrans)
, it will flip the sign.I think this logic should be easy to implement. Let me know if you need an example or if I should test the Tax method.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,900 Super User 2024 Season 2
Martin Dráb 229,275 Most Valuable Professional
nmaenpaa 101,156