magento2: Can't create more than one credit memo if order's grand total is 0

Preconditions (*)

Magento 2.3.3

Steps to reproduce (*)

  1. Crete order with 100% discount on all items and shipping. (Cart rule promo code can be used for that) Grand total (including shipping) must be 0. Order must contain product’s quantity atleast as 2
  2. Create credit memo and refund order with “Qty to Refund” = 1. (“Return to stock” doesn’t affect on this issue) 2021-06-1413:35:50

Expected result (*)

  1. Be able to refund left ordered/invoiced items (to fully refund order/items)

Actual result (*)

  1. Magento 2 doesn’t give ability to create additional credit memo

In my opinion the problem lies in Magento\Sales\Model\Order.php canCreditmemo() and in canCreditmemoForZeroTotal() see HERE

//check if total paid is less than grandtotal
$checkAmtTotalPaid = $totalPaid <= $this->getGrandTotal();

So if totalPaid ==0 and grandTotal ==0 then canCreditmemoForZeroTotal==false

But more precise maybe this code: $paidAmtIsRefunded = $this->getTotalRefunded() == $totalPaid && $creditmemos; totalRefunded==0, totalPaid==0 and has credit memos

Is there some patch or workaround for that?

  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

any update on this ?