/** * Busca o contribuinte pelo CNPJ/CPF */ public function getContribuinteCnpjAction() { $aRetorno = NULL; $iCnpj = DBSeller_Helper_Number_Format::getNumbers($this->_getParam('term')); $aDados = Contribuinte_Model_Contribuinte::getInscricaoMunicipalByCpjCnpj($iCnpj); $oContribuinte = Contribuinte_Model_Contribuinte::preencherInstanciaContribuinte($aDados[0]); $aRetorno = array('razao_social' => $oContribuinte->getRazaoSocial(), 'login' => $oContribuinte->getCgcCpf(), 'nome' => $oContribuinte->getRazaoSocial(), 'email' => $oContribuinte->getEmail(), 'telefone' => DBSeller_Helper_Number_Format::maskPhoneNumber($oContribuinte->getTelefone())); if (is_array($aDados) && count($aDados) > 1) { foreach ($aDados as $oDadosContribuinte) { $iInscricao = Contribuinte_Model_Contribuinte::preencherInstanciaContribuinte($oDadosContribuinte)->getInscricaoMunicipal(); $aRetorno['inscricoes'][$iInscricao] = $iInscricao; } } echo $this->getHelper('json')->sendJson($aRetorno); }