Ejemplo n.º 1
0
 public function enableToGenerateBill()
 {
     return !PowerMedia_Ifirma_Model_Configuration::getInstance()->isVAT() && PowerMedia_Ifirma_Model_ApiManager::getInstance()->getIfirmaInvoiceMapper()->getInvoiceBillMapModel($this->getOrder()->getId()) === null;
 }
Ejemplo n.º 2
0
 /**
  * 
  * @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);
 }