diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index 345ff036a2be6..dcbc02a69a97b 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -656,8 +656,8 @@ private function canCreditmemoForZeroTotalRefunded($totalRefunded) $isRefundZero = abs($totalRefunded) < .0001; // Case when Adjustment Fee (adjustment_negative) has been used for first creditmemo $hasAdjustmentFee = abs($totalRefunded - $this->getAdjustmentNegative()) < .0001; - $hasActinFlag = $this->getActionFlag(self::ACTION_FLAG_EDIT) === false; - if ($isRefundZero || $hasAdjustmentFee || $hasActinFlag) { + $hasActionFlag = $this->getActionFlag(self::ACTION_FLAG_EDIT) === false; + if ($isRefundZero || $hasAdjustmentFee || $hasActionFlag) { return false; } @@ -676,13 +676,12 @@ public function canCreditmemoForZeroTotal($totalRefunded) //check if total paid is less than grandtotal $checkAmtTotalPaid = $totalPaid <= $this->getGrandTotal(); //case when amount is due for invoice - $dueAmountCondition = $this->canInvoice() && ($checkAmtTotalPaid); + $hasDueAmount = $this->canInvoice() && ($checkAmtTotalPaid); //case when paid amount is refunded and order has creditmemo created - $creditmemos = ($this->getCreditmemosCollection() === false) ? true : (count($this->getCreditmemosCollection()) > 0); $paidAmtIsRefunded = $this->getTotalRefunded() == $totalPaid && $creditmemos; - if (($dueAmountCondition || $paidAmtIsRefunded) || + if (($hasDueAmount || $paidAmtIsRefunded) || (!$checkAmtTotalPaid && abs($totalRefunded - $this->getAdjustmentNegative()) < .0001)) { return false; diff --git a/app/code/Magento/Sales/i18n/en_US.csv b/app/code/Magento/Sales/i18n/en_US.csv index 2bf0eddc022b6..c5657f3a309f7 100644 --- a/app/code/Magento/Sales/i18n/en_US.csv +++ b/app/code/Magento/Sales/i18n/en_US.csv @@ -795,3 +795,5 @@ Created,Created "PDF Shipments","PDF Shipments" "PDF Creditmemos","PDF Creditmemos" Refunds,Refunds +"Allow Zero GrandTotal for Creditmemo","Allow Zero GrandTotal for Creditmemo" +"Allow Zero GrandTotal","Allow Zero GrandTotal"