Hi.Events icon indicating copy to clipboard operation
Hi.Events copied to clipboard

🌟 Add "Tax inclusive" pricing

Open elronalds opened this issue 1 year ago • 4 comments

Describe the bug When setting up ticket that needs to be tax inclusive the tax isn't calculated correctly. For example if I wish to sell a tax inclusive (10% tax) ticket for $25.00 I have to enter the price for the ticket with the tax not included. The ticket would be sold with price $22.73 and then when purchasing a single ticket the customer is charged $25.00 exactly (with $2.27 of tax included). The ticket on the front end is advertised as $25.00 which is correct. However, when purchasing two tickets the customer is charged $50.01 with this tax rounded up. This doesn't seem correct as the ticket on the front end is advertised as $25 / ticket and the customer should be charged $50.00 exactly.

I would recommend having an option or setting where the pricing for a ticket can be entered as tax inclusive. This could be a setting on the Ticket Options dialogue in the Show Additional options screen where the taxes and fees are shown. Tax inclusive should be an option after selecting the tax type in that field.

The rounding issue for multiple ticket purchases should also be addressed and corrected as it is not great to be charging more than the advertised single ticketing price, even if it is just $0.01.

To Reproduce Steps to reproduce the behavior:

  1. Setup a ticket with price $22.73
  2. Configure option to Include tax and fees in price
  3. Create a tax of 10% and apply the tax to this ticket priced at $22.73
  4. Create a test order of 2 tickets
  5. Ticket price is advertised as $25.00 which is correct
  6. Purchasing two tickets has a total order amount of $50.01 which is incorrect, it should be $50.00 exactly.

Expected behavior Customer in this instance should only be charged $50.

elronalds avatar Aug 07 '24 04:08 elronalds

In addition to this any coupon codes are also tax exclusive which is not clear in the interface. If i enter a coupon code with a $5.00 discount, the discount given is actually $5.50 with the 10% tax on top of the $5 discount. This isn't clear and gives a larger discount than expected.

elronalds avatar Aug 07 '24 04:08 elronalds

Thanks for pointing this out. The math behind the current tax calculation is technically correct, but I agree that the user experience isn't great.

The issue arises because the total comes to $50.006 for two tickets, and with half-up rounding, it rounds to $50.01. I'll add tax-inclusive pricing to the roadmap.

daveearley avatar Aug 08 '24 01:08 daveearley

Using floats for storing money values is definitely not a good idea. I think it is better to switch to a format that doesn't have floating point errors as soon as possible to avoid technical debt. So it is better for to use something like https://github.com/brick/money for all money values.

Naofal-Helal avatar Sep 17 '24 07:09 Naofal-Helal

Thanks for the suggestion, @Naofal-Helal! We're actually already using Brick/Money in some areas and are in the process of introducing it in others. The issue above isn't due to floating point errors—it's the expected behavior based on the calculations, though it does result in a less-than-ideal user experience. We're working on improving that!

daveearley avatar Sep 17 '24 15:09 daveearley