Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Items Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Items:

Mage_Adminhtml_Block_Sales_Items_Abstract Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getOrder ()
 getSource ()
 getOrderTotalData ()
 getOrderTotalbarData ()
 getCreditmemo ()
 canEditQty ()
 getUpdateButtonHtml ()
 getUpdateUrl ()
 canReturnToStock ()
 canSendCreditmemoEmail ()

Protected Member Functions

 _prepareLayout ()


Detailed Description

Definition at line 35 of file Items.php.


Member Function Documentation

_prepareLayout (  )  [protected]

Prepare child blocks

Returns:
Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Items

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 42 of file Items.php.

00043     {
00044         $onclick = "submitAndReloadArea($('creditmemo_item_container'),'".$this->getUpdateUrl()."')";
00045         $this->setChild(
00046             'update_button',
00047             $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
00048                 'label'     => Mage::helper('sales')->__('Update Qty\'s'),
00049                 'class'     => 'update-button',
00050                 'onclick'   => $onclick,
00051             ))
00052         );
00053 
00054         if ($this->getCreditmemo()->canRefund()) {
00055             if ($this->getCreditmemo()->getInvoice()) {
00056                 $this->setChild(
00057                     'submit_button',
00058                     $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
00059                         'label'     => Mage::helper('sales')->__('Refund'),
00060                         'class'     => 'save submit-button',
00061                         'onclick'   => 'editForm.submit()',
00062                     ))
00063                 );
00064             }
00065 
00066             if ($this->getCreditmemo()->canRefund()) {
00067                 $this->setChild(
00068                     'submit_offline',
00069                     $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
00070                         'label'     => Mage::helper('sales')->__('Refund Offline'),
00071                         'class'     => 'save submit-button',
00072                         'onclick'   => 'editForm.submit()',
00073                     ))
00074                 );
00075             }
00076 
00077         }
00078         else {
00079             $this->setChild(
00080                 'submit_button',
00081                 $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array(
00082                     'label'     => Mage::helper('sales')->__('Refund'),
00083                     'class'     => 'save submit-button',
00084                     'onclick'   => 'editForm.submit()',
00085                 ))
00086             );
00087         }
00088 
00089         return parent::_prepareLayout();
00090     }

canEditQty (  ) 

Check availability to edit quantity of item

Returns:
boolean

Disable editing of quantity of item if creating of shipment forced and ship partially disabled for order

Reimplemented from Mage_Adminhtml_Block_Sales_Items_Abstract.

Definition at line 150 of file Items.php.

00151     {
00152         if ($this->getCreditmemo()->getOrder()->getPayment()->canCapture()) {
00153             return $this->getCreditmemo()->getOrder()->getPayment()->canCapturePartial();
00154         }
00155         return true;
00156     }

canReturnToStock (  ) 

CREDITMEMO

Reimplemented from Mage_Adminhtml_Block_Sales_Items_Abstract.

Definition at line 171 of file Items.php.

00171                                        {
00172 
00173         $canReturnToStock = Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT);
00174         if (Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT)) {
00175             return true;
00176         } else {
00177             return false;
00178         }
00179     }

canSendCreditmemoEmail (  ) 

Definition at line 181 of file Items.php.

00182     {
00183         return Mage::helper('sales')->canSendNewCreditmemoEmail($this->getOrder()->getStore()->getId());
00184     }

getCreditmemo (  ) 

Retrieve creditmemo model instance

Returns:
Mage_Sales_Model_Creditmemo

Reimplemented from Mage_Adminhtml_Block_Sales_Items_Abstract.

Definition at line 145 of file Items.php.

00146     {
00147         return Mage::registry('current_creditmemo');
00148     }

getOrder (  ) 

Retrieve invoice order

Returns:
Mage_Sales_Model_Order

Reimplemented from Mage_Adminhtml_Block_Sales_Items_Abstract.

Definition at line 97 of file Items.php.

00098     {
00099         return $this->getCreditmemo()->getOrder();
00100     }

getOrderTotalbarData (  ) 

Retrieve order totalbar block data

Returns:
array

Definition at line 127 of file Items.php.

00128     {
00129         $totalbarData = array();
00130         $this->setPriceDataObject($this->getOrder());
00131         $totalbarData[] = array(Mage::helper('sales')->__('Paid Amount'), $this->displayPriceAttribute('total_invoiced'), false);
00132         $totalbarData[] = array(Mage::helper('sales')->__('Refund Amount'), $this->displayPriceAttribute('total_refunded'), false);
00133         $totalbarData[] = array(Mage::helper('sales')->__('Shipping Amount'), $this->displayPriceAttribute('shipping_invoiced'), false);
00134         $totalbarData[] = array(Mage::helper('sales')->__('Shipping Refund'), $this->displayPriceAttribute('shipping_refunded'), false);
00135         $totalbarData[] = array(Mage::helper('sales')->__('Order Grand Total'), $this->displayPriceAttribute('grand_total'), true);
00136 
00137         return $totalbarData;
00138     }

getOrderTotalData (  ) 

Retrieve order totals block settings

Returns:
array

Definition at line 117 of file Items.php.

00118     {
00119         return array();
00120     }

getSource (  ) 

Retrieve source

Returns:
Mage_Sales_Model_Order_Creditmemo

Reimplemented from Mage_Adminhtml_Block_Sales_Items_Abstract.

Definition at line 107 of file Items.php.

00108     {
00109         return $this->getCreditmemo();
00110     }

getUpdateButtonHtml (  ) 

Definition at line 158 of file Items.php.

00159     {
00160         return $this->getChildHtml('update_button');
00161     }

getUpdateUrl (  ) 

Definition at line 163 of file Items.php.

00164     {
00165         return $this->getUrl('*/*/updateQty', array(
00166                 'order_id'=>$this->getCreditmemo()->getOrderId(),
00167                 'invoice_id'=>$this->getRequest()->getParam('invoice_id', null),
00168         ));
00169     }


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

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