Skip to content
Snippets Groups Projects
Commit 8a6c3f2d authored by Anton Evers's avatar Anton Evers Committed by GitHub
Browse files

Loose integer check for creditmemo state

`$creditmemo->getState() = "1"`
`Creditmemo::STATE_OPEN = 1`
parent 9380c95b
No related merge requests found
...@@ -195,7 +195,7 @@ class CreditmemoService implements \Magento\Sales\Api\CreditmemoManagementInterf ...@@ -195,7 +195,7 @@ class CreditmemoService implements \Magento\Sales\Api\CreditmemoManagementInterf
*/ */
protected function validateForRefund(\Magento\Sales\Api\Data\CreditmemoInterface $creditmemo) protected function validateForRefund(\Magento\Sales\Api\Data\CreditmemoInterface $creditmemo)
{ {
if ($creditmemo->getId() && $creditmemo->getState() !== \Magento\Sales\Model\Order\Creditmemo::STATE_OPEN) { if ($creditmemo->getId() && $creditmemo->getState() != \Magento\Sales\Model\Order\Creditmemo::STATE_OPEN) {
throw new \Magento\Framework\Exception\LocalizedException( throw new \Magento\Framework\Exception\LocalizedException(
__('We cannot register an existing credit memo.') __('We cannot register an existing credit memo.')
); );
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment