Cancelling a partially refunded order triggers fatal exception
Open
- Dominant language
- PHP
- Stars
- 73
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Description
Sylius version affected: 1.7 and appears unfixed in master
Description
If you partially refund an order and then attempt to cancel it (for example you refunded the items but not the shipping) you get InvalidArgumentException "Not enough units to decrease on hold quantity from the inventory of a variant". But it should not be attempting to release the hold, because the hold was already released when the order was paid.
Steps to reproduce
- Place an order with a tracked product
- Complete the payment
- View the order in admin, refund part of the payment
- Cancel the order, get exception
Possible Solution
Account for OrderPaymentStates::STATE_PARTIALLY_REFUNDED in OrderInventoryOperator::cancel()
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.