Question

I have issues with executing the credit memo functionality in Magento. Sometimes it works and sometimes it doesn't.

So far I have been able to narrow it down to a call to this function

   $order->setBaseTotalRefunded($baseOrderRefund);

This can be found in app/code/core/Mage/Sales/Model/Order/Creditmemo.php inside a function called public function refund().

I am sure it is failing here because if I comment it out the credit memo will work. Also, in cases where the credit memo won't work, if I replace $baseOrderRefund with a hardcoded figure such as 20 for example it seems to work.

I am trying to find where this function is defined and find out exactly where the process is failing but I have been unable to find this function in the code. Can anyone point me the correct direction

Was it helpful?

Solution

If you cant create a credit memo, may it be because of the following reasons:

  1. The invoice for that particular order has not been created.

  2. The grand total of that order is zero (may be after applying discount).

  3. Have you ticked the check-box that appears just above the refund amount ??(i.e whether to mail the customer the credit memo.) If Yes, then the email sending is failing and memo is not getting created.

OTHER TIPS

It turned out to be a variable in an object. This was just a way of assigning it a value.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top