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