Skip to content

Commit

Permalink
fixed typos for zero ordertotal creditmemo feature
Browse files Browse the repository at this point in the history
  • Loading branch information
viral-wagento committed Nov 29, 2018
1 parent 1a805d0 commit 6918011
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/code/Magento/Sales/Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions app/code/Magento/Sales/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 6918011

Please sign in to comment.