Ejemplo n.º 1
0
 /**
  * Get options
  *
  * @return array
  */
 public function toOptionArray()
 {
     if ($this->options === null) {
         $this->options = [];
         /** @var \Magento\Framework\Phrase $state */
         foreach ($this->invoiceFactory->create()->getStates() as $id => $state) {
             $this->options[] = ['value' => $id, 'label' => $state->render()];
         }
     }
     return $this->options;
 }
Ejemplo n.º 2
0
 /**
  * @param \Magento\Sales\Model\Order $order
  * @return $this|bool
  */
 protected function _initInvoice($order)
 {
     $invoiceId = $this->getInvoiceId();
     if ($invoiceId) {
         $invoice = $this->invoiceFactory->create()->load($invoiceId)->setOrder($order);
         if ($invoice->getId()) {
             return $invoice;
         }
     }
     return false;
 }
Ejemplo n.º 3
0
 /**
  * @param RequestInterface $request
  * @param \Magento\Sales\Model\Order $order
  * @return $this|bool
  */
 protected function _initInvoice(RequestInterface $request, $order)
 {
     $invoiceId = $request->getParam('invoice_id');
     if ($invoiceId) {
         $invoice = $this->invoiceFactory->create()->load($invoiceId)->setOrder($order);
         if ($invoice->getId()) {
             return $invoice;
         }
     }
     return false;
 }
Ejemplo n.º 4
0
 /**
  * Return option array
  *
  * @return array
  */
 public function toOptionArray()
 {
     return $this->invoiceFactory->create()->getStates();
 }
Ejemplo n.º 5
0
 /**
  * Constructor
  *
  * @param ContextInterface $context
  * @param UiComponentFactory $uiComponentFactory
  * @param InvoiceFactory $invoiceFactory
  * @param array $components
  * @param array $data
  */
 public function __construct(ContextInterface $context, UiComponentFactory $uiComponentFactory, InvoiceFactory $invoiceFactory, array $components = [], array $data = [])
 {
     $this->states = $invoiceFactory->create()->getStates();
     parent::__construct($context, $uiComponentFactory, $components, $data);
 }