public function enableToGenerateBill() { return !PowerMedia_Ifirma_Model_Configuration::getInstance()->isVAT() && PowerMedia_Ifirma_Model_ApiManager::getInstance()->getIfirmaInvoiceMapper()->getInvoiceBillMapModel($this->getOrder()->getId()) === null; }
/** * * @param int $orderId * @param string $type * @return PowerMedia_Ifirma_Model_SendResult */ public function sendInvoice($orderId, $type) { if (!is_numeric($orderId) || !in_array($type, self::getSupportedActionTypes())) { return PowerMedia_Ifirma_Model_SendResult::makeInvalidResponse(PowerMedia_Ifirma_Model_SendResult::MESSAGE_INVALID_USE); } PowerMedia_Ifirma_Model_Configuration::getInstance()->setConfiguration(); if ($type === self::KEY_ACTION_INVOICE_FROM_PROFORMA) { return $this->sendInvoiceBasedOnProformaToIfirma($orderId); } return $this->sendInvoiceToIfirma($orderId, $type); }