eGift Card compensation never happens
@engcom-November is already working on this.
Since Jun 26, 2025.
- Dominant language
- PHP
- Stars
- 357
- Forks
- 262
- PR merge metrics
- No merged PRs in 30d
Description
Preconditions (*)
- V 2.4.6-p8
Steps to reproduce (*)
- Create an eGift card and assign at least one source to it, make the qty 0 and make it available for backorder.
- Create the order for the eGift card
- Make sure the invoice is created (if invoice is not automatically created, create from admin)
Expected result (*)
- Order is created as well as invoice.
- There should be 2 entries in
inventory_reservationtable for that order and SKU:- for the reservation
- for the compensation
Actual result (*)
- Order is created, and invoice is created.
- There is only one entry in
inventory_reservationtable and that is for reservation - No
compensationentry is created.
The actual issue
When system is trying to create the compensation it tries to gather the qty info for that product.
https://github.com/magento/inventory/blob/132d98c9a7afe75d7d7e74ad2b340cfc0baecc80/InventorySourceSelectionApi/Model/Algorithms/Result/GetDefaultSortedSourcesResult.php#L116
In this line you can see it is going to set $qtyToDeduct to 0 as we have set 0 in the product level.
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.