Skip to content

Commit 5091255

Browse files
committed
ACP2E-2756: [Cloud] Order Status changed to complete when partially refund of a partially shipped order
1 parent 9db0072 commit 5091255

File tree

1 file changed

+9
-9
lines changed
  • app/code/Magento/Sales/Model/ResourceModel/Order/Handler

1 file changed

+9
-9
lines changed

app/code/Magento/Sales/Model/ResourceModel/Order/Handler/State.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class State
2222
public function check(Order $order)
2323
{
2424
$currentState = $order->getState();
25-
if ($this->canBeProcessingStatus($order, $currentState)) {
25+
if ($this->checkForProcessingState($order, $currentState)) {
2626
$order->setState(Order::STATE_PROCESSING)
2727
->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_PROCESSING));
2828
$currentState = Order::STATE_PROCESSING;
@@ -31,13 +31,13 @@ public function check(Order $order)
3131
return $this;
3232
}
3333

34-
if ($this->canBeClosedStatus($order, $currentState)) {
34+
if ($this->checkForClosedState($order, $currentState)) {
3535
$order->setState(Order::STATE_CLOSED)
3636
->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_CLOSED));
3737
return $this;
3838
}
3939

40-
if ($this->canBeCompleteStatus($order, $currentState)) {
40+
if ($this->checkForCompleteState($order, $currentState)) {
4141
$order->setState(Order::STATE_COMPLETE)
4242
->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_COMPLETE));
4343
return $this;
@@ -47,13 +47,13 @@ public function check(Order $order)
4747
}
4848

4949
/**
50-
* Check if order can be automatically switched to complete status
50+
* Check if order can be automatically switched to complete state
5151
*
5252
* @param Order $order
5353
* @param string|null $currentState
5454
* @return bool
5555
*/
56-
private function canBeCompleteStatus(Order $order, ?string $currentState): bool
56+
private function checkForCompleteState(Order $order, ?string $currentState): bool
5757
{
5858
if ($currentState === Order::STATE_PROCESSING && !$order->canShip()) {
5959
return true;
@@ -63,13 +63,13 @@ private function canBeCompleteStatus(Order $order, ?string $currentState): bool
6363
}
6464

6565
/**
66-
* Check if order can be automatically switched to closed status
66+
* Check if order can be automatically switched to closed state
6767
*
6868
* @param Order $order
6969
* @param string|null $currentState
7070
* @return bool
7171
*/
72-
private function canBeClosedStatus(Order $order, ?string $currentState): bool
72+
private function checkForClosedState(Order $order, ?string $currentState): bool
7373
{
7474
if (in_array($currentState, [Order::STATE_PROCESSING, Order::STATE_COMPLETE])
7575
&& !$order->canCreditmemo()
@@ -87,13 +87,13 @@ private function canBeClosedStatus(Order $order, ?string $currentState): bool
8787
}
8888

8989
/**
90-
* Check if order can be automatically switched to processing status
90+
* Check if order can be automatically switched to processing state
9191
*
9292
* @param Order $order
9393
* @param string|null $currentState
9494
* @return bool
9595
*/
96-
private function canBeProcessingStatus(Order $order, ?string $currentState): bool
96+
private function checkForProcessingState(Order $order, ?string $currentState): bool
9797
{
9898
if ($currentState == Order::STATE_NEW && $order->getIsInProcess()) {
9999
return true;

0 commit comments

Comments
 (0)