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