Example #1
0
 public function __construct()
 {
     $this->_objectId = 'invoice_id';
     $this->_controller = 'sales_order_invoice';
     $this->_mode = 'view';
     $this->_session = Mage::getSingleton('admin/session');
     parent::__construct();
     $this->_removeButton('save');
     $this->_removeButton('reset');
     $this->_removeButton('delete');
     if ($this->_isAllowedAction('cancel') && $this->getInvoice()->canCancel()) {
         $this->_addButton('cancel', array('label' => Mage::helper('sales')->__('Cancel'), 'class' => 'delete', 'onclick' => 'setLocation(\'' . $this->getCancelUrl() . '\')'));
     }
     if ($this->_isAllowedAction('emails')) {
         $this->addButton('send_notification', array('label' => Mage::helper('sales')->__('Send Email'), 'onclick' => 'confirmSetLocation(\'' . Mage::helper('sales')->__('Are you sure you want to send Invoice email to customer?') . '\', \'' . $this->getEmailUrl() . '\')'));
     }
     $orderPayment = $this->getInvoice()->getOrder()->getPayment();
     if ($this->_isAllowedAction('creditmemo') && $this->getInvoice()->getOrder()->canCreditmemo()) {
         if ($orderPayment->canRefundPartialPerInvoice() && $this->getInvoice()->canRefund() && $orderPayment->getAmountPaid() > $orderPayment->getAmountRefunded() || $orderPayment->canRefund() && !$this->getInvoice()->getIsUsedForRefund()) {
             $this->_addButton('capture', array('label' => Mage::helper('sales')->__('Credit Memo'), 'class' => 'go', 'onclick' => 'setLocation(\'' . $this->getCreditMemoUrl() . '\')'));
         }
     }
     if ($this->_isAllowedAction('capture') && $this->getInvoice()->canCapture()) {
         $this->_addButton('capture', array('label' => Mage::helper('sales')->__('Capture'), 'class' => 'save', 'onclick' => 'setLocation(\'' . $this->getCaptureUrl() . '\')'));
     }
     if ($this->getInvoice()->canVoid()) {
         $this->_addButton('void', array('label' => Mage::helper('sales')->__('Void'), 'class' => 'save', 'onclick' => 'setLocation(\'' . $this->getVoidUrl() . '\')'));
     }
     if ($this->getInvoice()->getId()) {
         $this->_addButton('print', array('label' => Mage::helper('sales')->__('Print'), 'class' => 'save', 'onclick' => 'setLocation(\'' . $this->getPrintUrl() . '\')'));
     }
     $this->_addButton('print_with_receipt', array('label' => Mage::helper('sales')->__('Print with Receipt'), 'class' => 'save', 'onclick' => 'setLocation(\'' . $this->getPrintWithReceiptUrl() . '\')'));
     $this->_addButton('add_receipt', array('label' => Mage::helper('sales')->__('Increment Receipt Number'), 'class' => 'save', 'onclick' => 'setLocation(\'' . $this->getAddReceiptUrl() . '\')'));
 }
Example #2
0
 public function __construct()
 {
     parent::__construct();
     $enable = Mage::helper('pdfinvoiceplus')->checkEnable();
     $active = Mage::helper('pdfinvoiceplus')->checkStoreTemplate();
     if ($enable == 1 && $active == 1) {
         $this->_addButton('printpdf', array('label' => Mage::helper('pdfinvoiceplus')->__('Print Custom PDF File'), 'class' => 'save', 'onclick' => $this->getPrintPdfLink()));
     }
 }
Example #3
0
 public function __construct()
 {
     parent::__construct();
     $this->_removeButton('void');
     $orderPayment = $this->getInvoice()->getOrder()->getPayment();
     if ($this->_isAllowedAction('creditmemo')) {
         if ($orderPayment->canRefundPartialPerInvoice() && $this->getInvoice()->canRefund() && $orderPayment->getAmountPaid() > $orderPayment->getAmountRefunded() || $orderPayment->canRefund() && !$this->getInvoice()->getIsUsedForRefund()) {
             $this->_addButton('capture', array('label' => Mage::helper('sales')->__('Credit Memo'), 'class' => 'go', 'onclick' => 'setLocation(\'' . $this->getCreditMemoUrl() . '\')'));
         }
     }
 }
Example #4
0
 public function __construct()
 {
     parent::__construct();
     Mage::dispatchEvent('adminhtml_sales_order_invoice_view_construct', array('block' => $this, 'invoice' => $this->getInvoice()));
 }
Example #5
0
 public function __construct()
 {
     parent::__construct();
     $this->_addButton('printea', array('label' => Mage::helper('pdfgenerator')->__('EaDesign Print PDF'), 'class' => 'saveea', 'onclick' => $this->getThePdfSituation()));
 }