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

PricingSetting::INPUT_PRICE_TYPE is not respected on several places #2684

Open
vitek-rostislav opened this issue Jul 28, 2023 · 2 comments
Open
Labels
Bug Something isn't working In Backlog

Comments

@vitek-rostislav
Copy link
Contributor

Describe the bug

The application allows us to choose the input price type (it can be set in the admnistration admin/superadmin/pricing/). However, when I start using INPUT_PRICE_TYPE_WITHOUT_VAT (typical for B2B stores), I can see several issues:

  • QuantifiedProductPriceCalculation::calculatePrice has hardcoded price calculation from price with VAT, which might result in the wrong results - the customer might see badly calculated prices without VAT in the cart
  • the same applies to OrderItemPriceCalculation - the customer then sees badly calculated prices of order items in order mail and on the order detail page. Also, the administrator sees the bad prices.

I tried to simulate the problem on the current master version of SSFWCC:

  • I set the input price to "Without VAT"
  • I created a new VAT with a 19 % rate and set it as default for the SK domain
  • I set the SK domain price for Hello Kitty to 5,80 €
  • On the SK domain, I put Hello Kitty in the cart, and change the quantity to 3 pcs. One of the problems is (rather UX), I can not see the total price without VAT...However, if it was possible to see it, I would see it is badly calculated to 17,39 € (while it should be 3 x 5,80 = 17,4 €)
  • After finishing the order, I can see the item's bad prices in administration (see image 1)
  • Also, the order detail on SF is quite weird (see image 2) - the total price without VAT is wrong and the first column with unit price without VAT is labeled as "Unit price with VAT"

Image 1:
Screenshot from 2023-07-28 15-10-39

Image 2:
Screenshot (3)

@vitek-rostislav
Copy link
Contributor Author

vitek-rostislav commented Jul 28, 2023

While digging deeper into this, I would say another problem is that the whole OrderItem::hasForcedTotalPrice() related logic heavily counts on the fact the application uses input prices with VAT 😞 see https://github.com/shopsys/shopsys/blob/13.0/packages/framework/src/Model/Order/Item/OrderItemData.php#L20

@vitek-rostislav vitek-rostislav added the Bug Something isn't working label Jul 31, 2023
@vitek-rostislav
Copy link
Contributor Author

Another problematic (or questionable, at least) place is here - https://github.com/shopsys/shopsys/blob/13.0/project-base/app/tests/FrontendApiBundle/Test/GraphQlTestCase.php#L250 - the prices in tests are calculated using both approaches (from price with VAT and from price without VAT). I would say it should also respect the application settings 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working In Backlog
Projects
None yet
Development

No branches or pull requests

2 participants