Пример #1
0
 /**
  * @return Netresearch_OPS_Helper_Directlink
  */
 public function getDirectLinkHelper()
 {
     if (null === $this->directLinkHelper) {
         $this->directLinkHelper = MAge::helper('ops/directlink');
     }
     return $this->directLinkHelper;
 }
Пример #2
0
 protected function _prepareLayout()
 {
     $this->setChild('backButton', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('adminhtml')->__('Back'), 'onclick' => 'window.location.href=\'' . $this->getUrl('*/*/') . '\'', 'class' => 'back')));
     $this->setChild('resetButton', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('adminhtml')->__('Reset'), 'onclick' => 'window.location.reload()')));
     $this->setChild('saveButton', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('adminhtml')->__('Save Role'), 'onclick' => 'roleForm.submit();return false;', 'class' => 'save')));
     $this->setChild('deleteButton', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('adminhtml')->__('Delete Role'), 'onclick' => 'deleteConfirm(\'' . MAge::helper('core')->jsQuoteEscape(Mage::helper('adminhtml')->__('Are you sure you want to do this?')) . '\', \'' . $this->getUrl('*/*/delete', array('rid' => $this->getRequest()->getParam('rid'))) . '\')', 'class' => 'delete')));
     return parent::_prepareLayout();
 }
Пример #3
0
 /**
  * Preparing block layout
  *
  * @return Olts_Reminder_Block_Adminhtml_Group_Edit
  */
 protected function _prepareLayout()
 {
     $this->setChild('backButton', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('olts_reminder')->__('Back'), 'onclick' => 'window.location.href=\'' . $this->getUrl('*/*/groups') . '\'', 'class' => 'back')));
     $this->setChild('resetButton', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('olts_reminder')->__('Reset'), 'onclick' => 'window.location.reload()')));
     $this->setChild('saveButton', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('olts_reminder')->__('Save Group'), 'onclick' => 'group_edit_form.submit();return false;', 'class' => 'save')));
     $this->setChild('saveAndContinueButton', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('olts_reminder')->__('Save and Continue Edit'), 'onclick' => "group_edit_form.submit(\$('group_edit_form').action='" . $this->getSaveUrl(array('back' => true)) . "');return false;", 'class' => 'save')));
     $this->setChild('deleteButton', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('olts_reminder')->__('Delete Group'), 'onclick' => 'deleteConfirm(\'' . MAge::helper('core')->jsQuoteEscape(Mage::helper('olts_reminder')->__('Are you sure you want to do this?')) . '\', \'' . $this->getUrl('*/*/deleteGroup', array('gid' => $this->getRequest()->getParam('gid'))) . '\')', 'class' => 'delete')));
     return parent::_prepareLayout();
 }
Пример #4
0
 public function indexAction()
 {
     Mage::getSingleton('adminhtml/session')->addNotice(MAge::helper('payperrentals')->__('Booked inventory is inventory booked out for currently selected date.'));
     Mage::getSingleton('adminhtml/session')->addNotice(MAge::helper('payperrentals')->__('Current inventory is what is available for today\'s date.'));
     $this->_title($this->__('Reports'))->_title($this->__('Stock'));
     $this->_initAction()->_setActiveMenu('payperrentals/reports/most_rented')->_addBreadcrumb(Mage::helper('payperrentals')->__('Stock Report'), Mage::helper('payperrentals')->__('Stock Report'));
     $gridBlock = $this->getLayout()->getBlock('adminhtml_report_stock.grid');
     $filterFormBlock = $this->getLayout()->getBlock('grid.filter.form');
     $this->_initReportAction(array($gridBlock, $filterFormBlock));
     $this->renderLayout();
 }
Пример #5
0
 /**
  * @param Varien_Object $ticket
  *
  * @return string
  */
 protected function _getPopupHtml(Varien_Object $ticket)
 {
     $content = Mage::app()->getLayout()->createBlock('aw_hdu3/adminhtml_ticket_edit_popup_assignee')->setTicket($ticket)->toHtml();
     $titles = array('btnCancel' => Mage::helper('aw_hdu3')->__('Cancel'), 'btnDone' => Mage::helper('aw_hdu3')->__('Done'), 'header' => Mage::helper('aw_hdu3')->__('Manage Ticket'));
     $url = Mage::helper('adminhtml')->getUrl('helpdesk_admin/adminhtml_ticket/ajaxChangeAssignee', array('id' => $ticket->getId()));
     $currentAgentId = MAge::getSingleton('admin/session');
     $id = $ticket->getId();
     $result = "<script type='text/javascript'>";
     $result .= "var awHDU3TicketGridAssigneePopupList = awHDU3TicketGridAssigneePopupList || {};";
     $result .= "awHDU3TicketGridAssigneePopupList['{$id}'] = new AWHDU3_TICKET_POPUP(" . Zend_Json::encode($content) . "," . "function(){awHDU3TicketGrid.changeAssignee(" . Zend_Json::encode($url) . ",{$id});}" . "," . Zend_Json::encode($titles) . ");" . "var departmentsConfig = " . Mage::helper('aw_hdu3/ticket')->getDepartmentsConfigJson() . ";";
     $result .= "</script>";
     return $result;
 }
Пример #6
0
 public function testGetRequestParamsWithAdditionalParameters()
 {
     $fakePayment = Mage::getModel('sales/order_payment');
     $fakePayment->setOrder(MAge::getModel('sales/order'));
     $fakePayment->setAdditionalInformation(array('paymentId' => '4711'));
     $fakeInvoice = Mage::getModel('sales/order_invoice');
     $fakePayment->setInvoice($fakeInvoice);
     $arrInfo = array('operation' => 'capture');
     $amount = 10;
     $opsPaymentMethod = Mage::getModel('ops/payment_openInvoiceNl');
     $captureParameterModel = Mage::getModel('ops/backend_operation_capture_parameter');
     $requestParams = $captureParameterModel->getRequestParams($opsPaymentMethod, $fakePayment, $amount, $arrInfo);
     $this->assertArrayHasKey('AMOUNT', $requestParams);
     $this->assertArrayHasKey('PAYID', $requestParams);
     $this->assertArrayHasKey('OPERATION', $requestParams);
     $this->assertArrayHasKey('CURRENCY', $requestParams);
     $this->assertEquals(1000, $requestParams['AMOUNT']);
     $this->assertEquals(4711, $requestParams['PAYID']);
     $this->assertEquals('capture', $requestParams['OPERATION']);
     $this->assertEquals(Mage::app()->getStore($fakePayment->getOrder()->getStoreId())->getBaseCurrencyCode(), $requestParams['CURRENCY']);
 }
Пример #7
0
 public function printInvoiceAction()
 {
     if ($invoiceId = $this->getRequest()->getParam('id')) {
         $id = base64_decode($invoiceId);
         $id = explode(':', $id);
         if (count($id) != 2) {
             Mage::getSingleton('customer/session')->addError(Mage::helper('zab_billing')->__('Documento non disponibile'));
             $this->_redirectReferer();
             return;
         }
         $orderId = array_shift($id);
         $invoiceId = array_shift($id);
         if (!$orderId || !$invoiceId) {
             Mage::getSingleton('customer/session')->addError(Mage::helper('zab_billing')->__('Documento non disponibile'));
             $this->_redirectReferer();
             return;
         }
         $invoice = Mage::getModel('sales/order_invoice')->load($invoiceId);
         if (!$invoice->getId()) {
             Mage::getSingleton('customer/session')->addError(Mage::helper('zab_billing')->__('Documento non disponibile'));
             $this->_redirectReferer();
             return;
         }
         if ($invoice->getOrder()->getId() != $orderId) {
             Mage::getSingleton('customer/session')->addError(Mage::helper('zab_billing')->__('Documento non disponibile'));
             $this->_redirectReferer();
             return;
         }
         $pdf = Mage::getModel('sales/order_pdf_invoice')->getPdf(array($invoice));
         $this->_prepareDownloadResponse('invoice' . Mage::getSingleton('core/date')->date('Y-m-d_H-i-s') . '.pdf', $pdf->render(), 'application/pdf');
     } else {
         Mage::getSingleton('customer/session')->addError(MAge::helper('zab_billing')->__('Documento non disponibile'));
         $this->_redirectReferer();
         return;
     }
 }
Пример #8
0
 public function testExtractAdditionalParamsWithShipping()
 {
     $itemsContainer = Mage::getModel('sales/order_shipment');
     $this->assertTrue(is_array($this->openInvoiceNlModel->extractAdditionalParams($itemsContainer)));
     $this->assertEquals(0, count($this->openInvoiceNlModel->extractAdditionalParams($itemsContainer)));
     $itemsContainer = Mage::getModel('sales/order_invoice');
     $this->assertTrue(is_array($this->openInvoiceNlModel->extractAdditionalParams($itemsContainer)));
     $this->assertEquals(0, count($this->openInvoiceNlModel->extractAdditionalParams($itemsContainer)));
     $orderItem = Mage::getModel('sales/order_item');
     $orderItem->setId(1);
     $orderItem->setQtyOrdered(2);
     $item = Mage::getModel('sales/order_invoice_item');
     $item->setOrderItemId(1);
     $item->setOrderItem($orderItem);
     $item->setName('Item');
     $item->setBasePriceInclTax(19.99);
     $item->setQty(2);
     $item->setTaxPercent(19);
     $itemsContainer->addItem($item);
     $itemsContainer->setBaseShippingInclTax(10.0);
     $order = MAge::getModel('sales/order');
     $order->setShippingDescription('foo');
     $payment = Mage::getModel('sales/order_payment');
     $payment->setMethod('ops_openInvoiceNl');
     $order->setPayment($payment);
     $itemsContainer->setOrder($order);
     $result = $this->openInvoiceNlModel->extractAdditionalParams($itemsContainer);
     $this->assertTrue(is_array($result));
     $this->assertTrue(0 < count($result));
     $this->assertArrayHasKey('ITEMID1', $result);
     $this->assertEquals(1, $result['ITEMID1']);
     $this->assertArrayHasKey('ITEMNAME1', $result);
     $this->assertEquals('Item', $result['ITEMNAME1']);
     $this->assertArrayHasKey('ITEMPRICE1', $result);
     $this->assertEquals(1999, $result['ITEMPRICE1']);
     $this->assertArrayHasKey('ITEMVATCODE1', $result);
     $this->assertEquals('19%', $result['ITEMVATCODE1']);
     $this->assertArrayHasKey('TAXINCLUDED1', $result);
     $this->assertEquals(1, $result['TAXINCLUDED1']);
     $this->assertArrayHasKey('ITEMID2', $result);
     $this->assertEquals('SHIPPING', $result['ITEMID2']);
     $this->assertArrayHasKey('ITEMNAME2', $result);
     $this->assertEquals(substr($order->getShippingDescription(), 0, 30), $result['ITEMNAME2']);
     $this->assertArrayHasKey('ITEMPRICE2', $result);
     $this->assertEquals(Mage::helper('ops/data')->getAmount(10.0), $result['ITEMPRICE2']);
     $this->assertArrayHasKey('ITEMQUANT2', $result);
     $this->assertEquals(1, $result['ITEMQUANT2']);
     $this->assertArrayHasKey('ITEMVATCODE2', $result);
     $this->assertEquals(floatval($payment->getMethodInstance()->getShippingTaxRate($order)) . '%', $result['ITEMVATCODE2']);
     $this->assertArrayHasKey('TAXINCLUDED2', $result);
     $this->assertEquals(1, $result['TAXINCLUDED2']);
 }
 public function getProductList()
 {
     return MAge::helper('quickorder')->prettyQuickorder();
 }