Skip to content

Cancelling a partially refunded order triggers fatal exception #418

@robgwin

Description

@robgwin

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()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions