ChrisH
ChrisH

Reputation: 1281

Magento Credit memo, changing ORDER-id to INVOICE-id

In Magento you can cancel an order or invoice, and set it to a creditmemo. This is working correctly, but in our case we need the INVOICE-id, instead of an ORDER-id. By default, Magento uses the INVOICE-id.

This isn't some "setting", but it would probably need to be coded by hand. That's not a problem for me, but I can't seem to find the right file to edit.

Does anyone know whether this is even possible? Or does someone else had this problem before?

Thanks in advance!

:( Can't seem to set a bounty, otherwise i would have done it.

Upvotes: 1

Views: 1815

Answers (1)

Joe Mastey
Joe Mastey

Reputation: 27109

If you have an invoice ID, you can trivially retrieve the order ID of the order it is tied to.

$invoice = Mage::getModel("sales/order_invoice")->load($invoice_id);
$order_id = $invoice->getOrderId();

Hope that helps!

Thanks, Joe

Upvotes: 1

Related Questions