Skip to content

eGift Card compensation never happens #3418

Open
@adarshkhatri

Description

@adarshkhatri

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions