Closed
Description
A canceled invoice can be canceled again. I think \Magento\Sales\Model\Order\Invoice::cancel
should check whether the invoice can be canceled before executing all cancel operations.
Preconditions
- Tested on Magento 2.1.5
Steps to reproduce
- Load a canceled invoice programmatically
- Call
$invoice->cancel()
Expected result
- Throw an exception saying the invoice has already been canceled.
Actual result
- The invoice gets canceled twice, so order amounts are also being adjusted twice.
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.2 release lineGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release