Public Member Functions | |
indexAction () | |
viewAction () | |
pdfcreditmemosAction () | |
printAction () | |
Protected Member Functions | |
_construct () | |
_initAction () | |
_isAllowed () |
Definition at line 32 of file Creditmemo.php.
_construct | ( | ) | [protected] |
Additional initialization
Reimplemented from Mage_Core_Controller_Varien_Action.
Definition at line 38 of file Creditmemo.php.
00039 { 00040 $this->setUsedModuleName('Mage_Sales'); 00041 }
_initAction | ( | ) | [protected] |
Init layout, menu and breadcrumb
Definition at line 48 of file Creditmemo.php.
00049 { 00050 $this->loadLayout() 00051 ->_setActiveMenu('sales/order') 00052 ->_addBreadcrumb($this->__('Sales'), $this->__('Sales')) 00053 ->_addBreadcrumb($this->__('Credit Memos'),$this->__('Credit Memos')); 00054 return $this; 00055 }
_isAllowed | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Controller_Action.
Definition at line 115 of file Creditmemo.php.
00116 { 00117 return Mage::getSingleton('admin/session')->isAllowed('sales/creditmemo'); 00118 }
indexAction | ( | ) |
Creditmemos grid
Definition at line 60 of file Creditmemo.php.
00061 { 00062 $this->_initAction() 00063 ->_addContent($this->getLayout()->createBlock('adminhtml/sales_creditmemo')) 00064 ->renderLayout(); 00065 }
pdfcreditmemosAction | ( | ) |
Definition at line 79 of file Creditmemo.php.
00079 { 00080 $creditmemosIds = $this->getRequest()->getPost('creditmemo_ids'); 00081 if (!empty($creditmemosIds)) { 00082 $invoices = Mage::getResourceModel('sales/order_creditmemo_collection') 00083 ->addAttributeToSelect('*') 00084 ->addAttributeToFilter('entity_id', array('in' => $creditmemosIds)) 00085 ->load(); 00086 if (!isset($pdf)){ 00087 $pdf = Mage::getModel('sales/order_pdf_creditmemo')->getPdf($invoices); 00088 } else { 00089 $pages = Mage::getModel('sales/order_pdf_creditmemo')->getPdf($invoices); 00090 $pdf->pages = array_merge ($pdf->pages, $pages->pages); 00091 } 00092 00093 return $this->_prepareDownloadResponse('creditmemo'.Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').'.pdf', $pdf->render(), 'application/pdf'); 00094 } 00095 $this->_redirect('*/*/'); 00096 }
printAction | ( | ) |
Definition at line 98 of file Creditmemo.php.
00099 { 00100 /** @see Mage_Adminhtml_Sales_Order_InvoiceController */ 00101 if ($creditmemoId = $this->getRequest()->getParam('invoice_id')) { // invoice_id?! 00102 if ($creditmemo = Mage::getModel('sales/order_creditmemo')->load($creditmemoId)) { 00103 if ($creditmemo->getStoreId()) { 00104 Mage::app()->setCurrentStore($creditmemo->getStoreId()); 00105 } 00106 $pdf = Mage::getModel('sales/order_pdf_creditmemo')->getPdf(array($creditmemo)); 00107 $this->_prepareDownloadResponse('creditmemo'.Mage::getSingleton('core/date')->date('Y-m-d_H-i-s').'.pdf', $pdf->render(), 'application/pdf'); 00108 } 00109 } 00110 else { 00111 $this->_forward('noRoute'); 00112 } 00113 }
viewAction | ( | ) |
Creditmemo information page
Reimplemented in Mage_Adminhtml_Sales_Order_CreditmemoController.
Definition at line 70 of file Creditmemo.php.
00071 { 00072 if ($creditmemoId = $this->getRequest()->getParam('creditmemo_id')) { 00073 $this->_forward('view', 'sales_order_creditmemo', null, array('come_from' => 'sales_creditmemo')); 00074 } else { 00075 $this->_forward('noRoute'); 00076 } 00077 }