-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to calculate tax "Exclusively" from the gross sum. #65
Comments
According to this german source the calculation is correct. In fact, you are right if you assume the price does already include tax but the workflow of this package is to use the Does your implementation depend on the tax to be inclusive? |
It's common practice, in ecommerce application, to have a parameter to define if item prices are including or excluding taxes. That said, I'll take a look if we can easily add such parameter to enable gross price as base price |
I had some time today, and I've checked it and I've made a test version I've added a config option to set gross price as base price (default is false to be backward-compatible) Note In fact I've sent a PR but I didn't meant to ... anyway give a try to the branch feature-gross-price |
@Sartoric as always awesome work 👍! So from the code side it seems pretty straight forward and i saw nothing obvious. I have seen another fork today that also modified the calculation, that got me thinking if we should not abstract the @frequentredundancy If you want you may please take a look at the feature-gross-price branch and check in if there is anything obvious that would block your implementation? |
@bumbummen99 Should we add a new "enhancement" issue to keep track of it ? Out of curiosity, which is the fork ? |
@Sartoric Yeah i would not have made it any differently tbh, i think for now this will be just fine 😄 . Sure, further documentation and reminders never hurt 👍 : I think it was this one https://github.com/manojo123/LaravelShoppingcart but i had not much time looking into it and what he is trying to achieve. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days |
Currently the tax in this package is calculated like this;
But in the EU, it is common that prices are listed VAT inclusive and use a different formula. It's calculated like so;
VAT calculation formula for VAT exclusion is the following: to calculate VAT having the gross amount you should divide the gross amount by 1 + VAT percentage (i.e. if it is 15%, then you should divide by 1.15), then subtract the gross amount, multiply by -1 and round to the closest value (including eurocents). The last two operations are not mandatory since you see the VAT value even before you do them.
Source: https://vatcalconline.com/
To see the difference, let me give an example;
Is it possible we can get this as a configuration option whether we want it to be inclusive or exclusive? Since technically speaking anyone currently using this to calculate VAT isn't doing it correctly and there could be issues legally because of this.
The text was updated successfully, but these errors were encountered: