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

eGift Card compensation never happens #3418

Open
adarshkhatri opened this issue Dec 6, 2024 · 1 comment
Open

eGift Card compensation never happens #3418

adarshkhatri opened this issue Dec 6, 2024 · 1 comment

Comments

@adarshkhatri
Copy link

adarshkhatri commented Dec 6, 2024

Preconditions (*)

  1. V 2.4.6-p8

Steps to reproduce (*)

  1. Create an eGift card and assign at least one source to it, make the qty 0 and make it available for backorder.
  2. Create the order for the eGift card
  3. Make sure the invoice is created (if invoice is not automatically created, create from admin)

Expected result (*)

  1. Order is created as well as invoice.
  2. There should be 2 entries in inventory_reservation table for that order and SKU:
    • for the reservation
    • for the compensation

Actual result (*)

  1. Order is created, and invoice is created.
  2. There is only one entry in inventory_reservation table and that is for reservation
  3. No compensation entry is created.

The actual issue

When system is trying to create the compensation it tries to gather the qty info for that product.

$qtyToDeduct = min(max($sourceItemQtyAvailable, 0.0), $itemsTdDeliver[$normalizedSku] ?? 0.0);

In this line you can see it is going to set $qtyToDeduct to 0 as we have set 0 in the product level.

if ($sourceSelectionItem->getQtyToDeduct() < 0.000001) {

And because of this system cannot mark any source to deduct which is why it will never compensate them.

Because of this, there are so many entries in the reservation table that will stay there forever.

Copy link

m2-assistant bot commented Dec 6, 2024

Hi @adarshkhatri. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

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

No branches or pull requests

1 participant