add tax_calculation_method :ITEM_BASED which changes tax amount validation to item based#25
Conversation
…ation to item based
|
Hmmmpfff, this feels like we need to overhaul this but maybe it is also just a function of the inherent complexity. I'll merge this for now, but I'm not happy with amassing all of these various modes :) |
|
I stumbled over this by accident while looking into an issue I had with one of our invoices. @halfbyte and @SubandiK I'm convinced that the If there is an issue with validation then we should have a fixture/test case that illustrates the problem with the current implementation and then look into the cause for the issue and how to fix it (or work out, why there is an error in the fixture if there would be any). Furthermore I think that the check in L117 repeats the exact same check as L106 does, as the taxes From what I can tell by analyzing the check, I think everything that would be needed here instead of this PR is to change |
Another of those specific use-cases I'm afraid:
We are rounding taxes on a per-line-item basis, not like Secretariat currently validates for on a per-taxrate basis.
The new :NONE option doesn't work here, because it actually changes the taxes. What we need is to just change / skip the"Base amount and summed tax base amount" validation.
By using the new :ITEM_BASED option, the validation now compares the invoice's tax_amount with the sum of the item tax amounts.