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

Unit price calculation is wrong on line item #311

Open
laurentdabbb opened this issue Dec 27, 2023 · 1 comment
Open

Unit price calculation is wrong on line item #311

laurentdabbb opened this issue Dec 27, 2023 · 1 comment

Comments

@laurentdabbb
Copy link

laurentdabbb commented Dec 27, 2023

Hi,

The "unit_price" stored in sylius_invoicing_plugin_line_item is wrong when a promotion is applied on the item.
This unit_price is the unit net price stored on lineItem entity in OrderItemUnitsToLineItemsConverter service.

This unit net price is calculated from UnitNetPriceProvider service, but the calculation doesn't seem right.

image

You retrieve unitPrice from orderItem (unit sale price, before discount) and you substract orderItemUnit tax adjustments calculated on the discounted price... So tax amount is not related to the unit sale price.

To reproduce simply apply a cart promotion and compare unitPrice from the Sylius Admin Order page (gross unit sale price if tax are included in price) and the unit net price on the invoice. You can recalculate gross and net price, the amount is wrong.

An example with an order placed on the demo website (https://master.demo.sylius.com), so without custom developments.

image

image

Unit net price of the item "Off shoulder boho dress" should be 24,55$ and not 24,67.

24,67 = 26,27 (order item unit price) - 1,60 (tax amount of the discounted price)

Thanks

@t-n-y
Copy link

t-n-y commented Jan 5, 2024

Hi,
I noticed the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants