/** * Exclui Nota da DMS [Json] */ public function emissaoManualListaNotasExcluirAction() { $aRetornoJson['status'] = FALSE; $iIdDmsNota = $this->getRequest()->getParam('id_dms_nota', NULL); if (!$iIdDmsNota) { $aRetornoJson['error'] = $this->translate->_('Identificador inválido!'); } else { try { $oDmsNota = Contribuinte_Model_DmsNota::getById($iIdDmsNota); $oDmsNota->destroy(); $aRetornoJson['status'] = TRUE; $aRetornoJson['success'] = $this->translate->_('Documento excluído com sucesso!'); } catch (Exception $oErro) { $aRetornoJson['error'] = sprintf($this->translate->_('Erro ao excluir o documento: %s'), $oErro->getMessage()); } } echo $this->getHelper('json')->sendJson($aRetornoJson); }