Skip to content
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

Calculate prices excluding tax, show them including tax #7833

Open
stefandoorn opened this issue Mar 24, 2017 · 23 comments
Open

Calculate prices excluding tax, show them including tax #7833

stefandoorn opened this issue Mar 24, 2017 · 23 comments
Assignees
Labels
Do not stale Important issues and PRs, that should not be stalled by Stale Bot RFC Discussions about potential changes or new features.

Comments

@stefandoorn
Copy link
Contributor

stefandoorn commented Mar 24, 2017

I'm currently having some custom calculators to calculate the price of variants based on the variant itself but also on some additional information supplied on the OrderItem (sizes). I calculated everything excluding taxes, and had set the 'is_included_in_price' setting for the tax category to 0. Works fine, until I figured out that on the front-end my prices are still shown without tax in the cart, while it should be including tax. The summary does show the tax, but it should be on the product line itself. Therefore I rewrote my calculators to include tax in it, but due to rounding errors it can happen the final price excluding tax is still one cent of. Can be fixed ofcourse, but it led me to do some searching on how it works.

I found this page (http://docs.sylius.org/en/latest/book/orders/taxation.html#taxrates-included-in-price) telling two scenarios:

  • Calculate price without tax, show it without tax and only show tax in summary
  • Calculate price with tax, show it with tax and also show tax in summary

There is one missing scenario that makes sense to me:

  • Calculate price without tax, show it with tax and show tax in summary

Most often it's way easier to do price calculations without tax to find the base price. Based on context, tax should be added on top of it. In the calculator itself, I prefer not to include dependencies on context aware things to make the calculations.

Am I overlooking a feature in the framework that already suits this method, or would this be something that could be added? I think it's a quite important one, especially when having to do complex pricing.

@pjedrzejewski pjedrzejewski added the RFC Discussions about potential changes or new features. label Mar 25, 2017
@psihius
Copy link
Contributor

psihius commented Mar 27, 2017

I definitely second the ability to show prices in the product listings with or without the tax depending on the some setting - I'm building a multi-channel store myself and I need to show prices with tax conditionally - people from some countries pay VAT tax, other's don't.
As taxes may change, it is inconvenient to set a price with tax included, especially when there are many channels.

The tax applying also should be available to be switched on a customer/session basis, as when customer switches the country he is from (via a selector, and we are going to do some GeoIP detection to make it more friendly), we need to be able to toggle to toggle if the price needs to be shown with or without tax . Right now it is not possible - you either enter prices with tax and tick "tax included in price" or you set prices without tax and person see's how much tax he is paying only in the cart/checkout.
For our region (Eastern Europe) displaying prices without a tax is a big "no-no" - our prices always reflect what customer must pay for the good with all taxes included. But when you sell to multiple countries, sometimes the customer does not pay the tax and we need to show them that price without the tax - ideally a person switches the country he is buying from and that handles the tax settings. I believe that current zone and tax functionality can handle that, but sylius, as far as I know, can only apply taxes channel based and there is no "customer's country" concept at the moment and taxes are re-calculated only when a shipping/billing country is selected.
Essentially, what I would like to see are 2 things:

  • Ability to set a country for the customer and apply zoning based on that country before any shipping info is entered.
  • Ability to toggle application of tax when displaying product prices. Maybe this will be solved via 1st by using zoning.

@mrjingles
Copy link

I am not sure if my problem fits in that scenario. I have set up "tax included" to not calculate my netto prices depending on tax rate. So everything is fine, when the customer can see tax amount in cart. But when the customer selects a tax free shipping method (I added a VAT field for that to trigger if that method is available) the cart shows still the full price with included tax. So imho the price should be reduced with calculated tax amount, right?

@stefandoorn
Copy link
Contributor Author

I think this is a different scenario, as it's mainly about showing it until the cart/checkout without any knowledge about the customer's location. I want to calculate excluding tax, but show it including tax. Yours might be quite a special case - probably EU VAT stuff - but not sure what is the best way to solve your issue.

@mrjingles
Copy link

But also after selecting shipping address and shipping method (without tax) on last checkout page the prices are not excluded tax, but tax position is 0.00. That doesn't make sense to me, but maybe I should open separate issue for that.

@stefandoorn
Copy link
Contributor Author

True. The thing is that my issue is more about the calculation of product prices on a lower level when using a custom product calculator. It's separate indeed, as this is more about whether to apply tax or not based on certain scenario. Both make sense, as this is probably something regarding US -> EU trade or the other way around e.g.

@mrjingles
Copy link

@stefandoorn I am going your way now. Calculating without tax, but want to show it in frontend with tax included. Do you already have a solution that works for you?

@pjedrzejewski pjedrzejewski added this to the v1.0.0 milestone Aug 8, 2017
@stefandoorn
Copy link
Contributor Author

@mrjingles I went with a Twig helper to show the including VAT price based on the product / variant settings in the correct templates. Had to rewrite many of them anyway for our custom needs, so it was not a that big deal.

@mrjingles
Copy link

@stefandoorn I tried with a custom ProductVariantPriceCalculator, but this didn't work very well. Tax is still added in cart, when I have non EU shipment.
So can you give me a link to that twig helper and how to add it in templates?

@stefandoorn
Copy link
Contributor Author

@mrjingles This seems to be different than my use case. I wanted to calculate prices without tax, and show it including - anywhere. We only ship at 21% VAT, period. So for me it was rather easy, as I don't need to have any clue about the customers location. I'm not sure how you can get around with your use case, as it seems to depend on customer context.

@pjedrzejewski pjedrzejewski modified the milestones: v1.1.0, v1.0.0 Sep 11, 2017
@pjedrzejewski
Copy link
Member

Just like with tax categories for customer, we decided to tackle this after 1.0. It should be doable without BC breaks by introducing new Twig helpers that calculate proper amounts.

@stale
Copy link

stale bot commented Feb 2, 2018

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Issues and PRs with no recent activity, about to be closed soon. label Feb 2, 2018
@stale stale bot closed this as completed Feb 9, 2018
@rowanvanekeren
Copy link

@pjedrzejewski is there any progression with this? It's pretty relevant for my use case aswell

@vvasiloi
Copy link
Contributor

vvasiloi commented Jul 1, 2019

@rowanvanekeren in the meantime you can create a Twig helper like that: https://gist.github.com/vvasiloi/a381b4313d672abf4492cdbd1b36fb9d

@bochkarev-artem
Copy link

Please reopen this issue, its not fixed yet in 1.6.1 but its very usefull to have: when you have multiple countries with different VATs you cannot include tax in price, so you need to exclude it, but would be good to have such an option still to show prices on front with tax included (also in api: some field like total_tax_included on item level and cart level)

@lchrusciel lchrusciel reopened this Oct 19, 2019
@stale stale bot removed the Stale Issues and PRs with no recent activity, about to be closed soon. label Oct 19, 2019
@stale
Copy link

stale bot commented Jan 19, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Issues and PRs with no recent activity, about to be closed soon. label Jan 19, 2020
@vvasiloi
Copy link
Contributor

Do not stale.

@stale stale bot removed the Stale Issues and PRs with no recent activity, about to be closed soon. label Jan 19, 2020
@michalhosna
Copy link

Do not stale.

@lchrusciel lchrusciel added the Do not stale Important issues and PRs, that should not be stalled by Stale Bot label Feb 17, 2020
@vvasiloi
Copy link
Contributor

Just adding some Twig helpers might not be enough, since the only way to get the tax zone right now, outside the checkout, is the channel's default tax zone.
Letting the customer choose a country isn't consistent with the way tax is calculated during checkout, so it can yield different results.
To keep it consistent, the customer will have to choose from the defined [tax] zones.
It might be better to implement different use-cases as plugins, instead of a general implementation in Sylius core.

@CoderMaggie
Copy link
Member

image

Hello! Long time no update on this issue, while in Sylius we've had major changes regarding the order summaries and taxes display (last year, I believe).

How do you feel after these changes? Is anything more still required?

@lchrusciel
Copy link
Member

lchrusciel commented Dec 22, 2021

Should be fixed together with: #10417

@vvasiloi
Copy link
Contributor

@CoderMaggie @lchrusciel this issue is not about displaying the prices in the admin section, but in the shop section, specifically outside the checkout process, i.e. the catalog.
This is especially important for B2B shops.
However, it's a complex problem... as it is always with taxes.
As I said before, it's probably better to isolate the uses cases and provide dedicated solutions through plugins, instead of trying to solve it in the Sylius core.

@Fakrae
Copy link

Fakrae commented Dec 23, 2022

As some additional information for why/when this would be usefull/needed, check OSS-laws from Mid 2021: https://vat-one-stop-shop.ec.europa.eu/select-language?destination=/node/1
Basically most if not all European countries need prices for private customers to be displays including taxes, but taxes depend on the delivery-address of the customer (different taxrates for the same product in different countries) so victors twig-helper would be the bare minimum (along with a way for the customer to set the country of delivery before entering the checkout/on the first visit).
So I'd argue, that it is even more relevant for B2C shops than for B2B - in B2B you could get away with displaying the prices without VAT.

I think in some countries it would theoretically be sufficient to display the totals during checkout, but the customer would not expect that and will not like/understand that the carts total changes after he enters his address...

@stefandoorn
Copy link
Contributor Author

@GSadee @jakubtobiasz I want to bring your attention to this one for v2.0. I think this is pretty crucial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do not stale Important issues and PRs, that should not be stalled by Stale Bot RFC Discussions about potential changes or new features.
Projects
None yet
Development

No branches or pull requests