awesomemotive / easy-digital-downloads

Sell digital downloads through WordPress
https://easydigitaldownloads.com
GNU General Public License v2.0
862 stars 475 forks source link

Add support for fees that include taxes #4200

Open felixarntz opened 8 years ago

felixarntz commented 8 years ago

Currently one can only add fees that exclude taxes. The plugin does not support fees which include taxes, it basically overrides the global setting by adding a filter in edd_get_cart_fee_tax() for example.

I'm proposing to add support for fees that include taxes, just like we have for regular download products. I'm currently using a pretty hacky solution to (kind of) fix this problem (which I can share if desired), but I would appreciate if EDD actually supported it in a solid way.

Before we approach this issue, we'd have to think about whether we would take the global setting into account for those fees or whether we made it an additional argument for every individual fee itself. I prefer the latter approach since fees can be of any kind and the way that they are handled may differ. Also, if we just took the global setting, we'd break backwards compatibility with people who have the "fees included" setting active but define their fees without tax.

Maybe we could add a new property to a fee called tax_mode and then allow values like 'none', 'include' or 'exclude'. 'exclude' would be the default (for compatibility), and we could migrate the no_tax property to this new one by setting the tax_mode to 'none' for those. Of course this enhancement would go beyond that in terms of how taxes, subtotal and total are calculated, so we'd need to work on these processes as well.

Opinions on this?

pippinsplugins commented 8 years ago

@felixarntz I'm not clear what you mean by we don't support taxes on fees. When no_tax is set to false, tax gets added to the fees.

felixarntz commented 8 years ago

Yes, taxes on fees are supported, but they are always added on top of the fee amount. I'm talking about the possibility to add fees where their taxes are automatically included in the fee amount you specify. Similar like it is possible for regular products as well. Basically adding fee prices inclusive of tax. Right now we can only add fee prices exclusive of tax.

pippinsplugins commented 8 years ago

Ah! That makes more sense, thanks :)

mintplugins commented 7 years ago

I believe this is causing incorrect tax amounts when using EDD Recurring sign-up fees if you have taxes set to be included in prices.

Steps to replicate incorrect tax amounts:

Set prices to include tax:

screen shot 2016-11-11 at 10 35 43 am

Create recurring product with a signup fee:

screen shot 2016-11-11 at 10 33 44 am

Total should be $200 as taxes are set to be included in the price.

screen shot 2016-11-11 at 10 34 33 am

I believe this is more of a bug than a feature/enhancement. If you have taxes set to be included in the price, taxes are calculated wrong for fees - including sign-up fees in recurring.

mintplugins commented 7 years ago

I have a bit of a wild proposal which is likely not something we'll do - but I wanted to throw it out there and see.

Instead of making fees work with prices where taxes are included in the entered price, we replace the option to enter prices including tax, and instead make it an option to simply display prices including tax.

The way it currently is (enter prices including tax):

My proposed new way (display prices including tax):

What this changes:

Backwards Compatibility: For stores that already use the "Enter prices including tax" option, nothing changes for them. They still have that option. However, if they run into this bug, they can simply switch to use the new "Display Prices including tax" instead. They would have to then modify the entered price of their product.

Forward Motion: New stores and stores not currently using the "Enter prices including tax" option will not see the option any longer. It will be replaced for them with the "Display prices including tax".

Legal Questions: In my understanding, countries like Germany require that prices always be displayed including tax. This solution still fits with laws requiring that.

My thoughts:

pippinsplugins commented 7 years ago

@mintplugins So basically put the responsibility of calculating the pre-tax amount on the store owner?

mintplugins commented 7 years ago

@pippinsplugins Exactly, yes.

pippinsplugins commented 7 years ago

I'm not immediately opposed or in support of it. Let's think on it.

mintplugins commented 7 years ago

I proposed this idea to a customer having this issue (tax being added "on top" of signup fee despite having taxes set to be included in the price).

They are based in Germany and don't see any issue with it legally. They also said they wouldn't mind having to adjust their prices:

https://secure.helpscout.net/conversation/275104971/46368/?folderId=749231

pippinsplugins commented 7 years ago

That's good news.

felixarntz commented 7 years ago

I'm not really convinced of that approach since having to calculate the tax amount is not user-friendly. If it was a lot easier to implement, it might be worth considering, but generally the user should be able to enter final fee amounts and have the included taxes being calculated.

mintplugins commented 7 years ago

@felixarntz Just to throw out an additional possibility, what if while you were entering the price, beside the field it showed you what the output would be so you could keep adjusting the price until it was what you wanted. This way you don't need to do any actual math but just play with the entered price.

For example, if you entered $9.00 (at 10% tax), beside the field it would show "$9.90 Including Tax". You could then adjust the price until it came out to exactly $10.

If you had many different tax rates set up, it could show you the price in all locations. For example, if you are charging taxes in both Canada (13%), and in Germany (19%), if you entered $9, beside/beneath the price field it would show:

Maybe it's just me, but I would prefer to know that i'm making $9 from the product - rather than being unsure of my earnings based on which country the user is in. With this solution, I know that when I enter $9, I am earning $9. The government is then adding their tax to my price, rather than my price being adjusted for their tax. If I know my product costs $9, I want to know I am earning $9 from it in all situations.

Again, this is a wild proposal and I don't know that it's the best one - but just trying to hit the problem from all possible angles.

felixarntz commented 7 years ago

That would be nicer in terms of UX, but I'm still wary about this. I think the best solution would be to have an option for how to enter fee amounts, similar to how an option exists for regular prices.

There are use-cases where someone wants to have a product price or fee that is always 9.99, regardless of tax, just so that it always has that "psychological advantage" of being a .99 price. There are other use-cases where there is one fixed product price or fee amount, and the taxes should just be added.

In short, I think actual products and fees should have similar behaviors. Also, by making the tax handling of fees an option, we would stay backward-compatible simply by setting the default value to "exclude tax".

mintplugins commented 7 years ago

You are most likely correct. While it would greatly simplify the code and remove a lot of potential bugs, it may be too late in the game to remove the "price includes tax" functionality.

michaelbeil commented 7 years ago

Still pondering on this, but I am not too keen on changing the "price includes tax" functionality from what it is. I would be more apt to give some better descriptions and tooltips.

Having to require further calculations of a price total would be rather poor UX, IMHO.

mintplugins commented 7 years ago

@m I would agree. We could open a separate issue for tools tips and descriptions.

I would also argue that we not add any new options.

Rather, we just need to fix the bug happening with the way that taxes are calculated for fees when taxes are included. So to clarify for this issue:

The Bug: Taxes are not calculated correctly on fees when prices are set to "include tax". Rather than calculating the tax to be included in the entered fee amount, it is being added to the entered fee amount.

michaelbeil commented 7 years ago

Yes, taxes not calculating correctly on fees is a bug.

mintplugins commented 6 years ago

Customer Ticket: https://secure.helpscout.net/conversation/434682291/67018/

mintplugins commented 6 years ago

Customer Ticket: https://secure.helpscout.net/conversation/575648679/81694?folderId=749231

mintplugins commented 5 years ago

This will require some major testing with anything that uses the Fees API, especially Discounts Pro, and anything that has negative fees.

shaynesanderson-zz commented 3 years ago

I wanted to follow up here and see if this is going to get any traction. I have a customer asking about this functionality but I'm unsure on how to reply since this thread is quite old.

LisaCee commented 3 years ago

I wanted to follow up here and see if this is going to get any traction. I have a customer asking about this functionality but I'm unsure on how to reply since this thread is quite old.

I'm not quite sure if this is what you're looking for, but the option to apply taxes to a fee was added for manual orders in 3.0 recently. comment

ashleyfae commented 3 years ago

@shaynesanderson To be honest it's just low priority, as the impact is quite small. It's not going to be even considered until after 3.0.