Mage_Adminhtml_Controller_Sales_Invoice Class Reference

Inheritance diagram for Mage_Adminhtml_Controller_Sales_Invoice:

Mage_Adminhtml_Controller_Action Mage_Core_Controller_Varien_Action Mage_Adminhtml_Sales_InvoiceController Mage_Adminhtml_Sales_Order_InvoiceController

List of all members.

Public Member Functions

 indexAction ()
 viewAction ()
 printAction ()
 pdfinvoicesAction ()

Protected Member Functions

 _construct ()
 _initAction ()
 _isAllowed ()


Detailed Description

Adminhtml sales orders controller

Author:
Magento Core Team <core@magentocommerce.com>

Definition at line 32 of file Invoice.php.


Member Function Documentation

_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

Returns:
Mage_Adminhtml_Sales_InvoiceController

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     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:11 2009 for Magento by  doxygen 1.5.8