Source: Vnecoms Blog

Vnecoms Blog How to add invoice increment id on creditmemo pdf

1. download the Custom Variable Sample package from http://www.vnecoms.com/kbase/extension-pdf-invoice-pro/add-custom-variables.html2. edit this file: app/code/community/VES/PdfProItem/Model/Observer.php3. Find this code:}elseif($type == 'creditmemo'){ $creditmemoData = $observer->getSource(); /* Varien_Object*/ $creditmemo = $observer->getModel(); /*Mage_Sales_Model_Order_Creditmemo*/ 4. replace it by }elseif($type == 'creditmemo'){ $creditmemoData = $observer->getSource(); /* Varien_Object*/ $creditmemo = $observer->getModel(); /*Mage_Sales_Model_Order_Creditmemo*/ $order = $creditmemo->getOrder(); $invoice = Mage::getResourceModel('sales/order_invoice_collection')->addFieldToFilter('order_id',$order->getId())->getFirstItem(); $creditmemoData->setData('invoice_increment_id',$invoice->getIncrementId());5. Use this variable on your credit memo pdf template to display the invoice number{{var creditmemo.invoice_increment_id}}

Read full article »
Est. Annual Revenue
$100K-5.0M
Est. Employees
1-25
CEO Avatar

CEO

Update CEO

CEO Approval Rating

- -/100