public function doDiagnosticoEligibility($enterprise) { if ($enterprise['HeadOfficeStatus'] == '1') { return $this->setDiagnosticoEligibility($enterprise->getId(), 1); } $to = Zend_Registry::get('configDb')->addr->eligibilityGestorEmail; $toEnterprise = $enterprise->getEmailDefault(); $enterpriseName = $enterprise->getSocialName(); $enterpriseCnpj = Vtx_Util_Formatting::maskFormat($enterprise->getCnpj(), '##.###.###/####-##'); $this->createElegibilityNotification('manager', $to, $enterpriseName, $enterpriseCnpj); if ($toEnterprise != null && $toEnterprise != '') { $this->createElegibilityNotification('enterprise', $toEnterprise, $enterpriseName, $enterpriseCnpj); } return $this->setDiagnosticoEligibility($enterprise->getId(), 0); }
protected function getDataTableFieldsets() { // override for Report_Devolutive_CandidateDataPage $president = $this->getPresident(); $addressPresident = $this->getAddressPresident(); $bornDate = strtotime($president['BornDate']); $bornDate = date('d/m/Y', $bornDate); $cpf = Vtx_Util_Formatting::maskFormat($president['Cpf'], '###.###.###-##'); $position = $this->getPosition(); $educationLevel = $this->getEducationLevel(); $cep = Vtx_Util_Formatting::maskFormat($addressPresident['Cep'], '#####-###'); $state = $this->getState(); $city = $this->getCity(); $neighborhood = $this->getNeighborhood(); return array(array('Name' => $president['Name'], 'BirthDate' => $bornDate, 'Cpf' => $cpf), array('Position' => $position, 'EducationLevel' => $educationLevel, 'Email' => $president['Email']), array('Cellphone' => $president['Cellphone'], 'Phone' => $president['Phone'], 'Cep' => $cep), array('StreetNameFull' => $addressPresident['StreetNameFull'], 'StreetNumber' => $addressPresident['StreetNumber'], 'StreetCompletion' => $addressPresident['StreetCompletion']), array('Neighborhood' => $neighborhood, 'City' => $city, 'State' => $state)); }
protected function getDataTableFieldsets() { // override for Report_Devolutive_CandidateDataPage $enterprise = $this->getEnterprise(); $addressEnterprise = $this->getAddressEnterprise(); $cnpj = Vtx_Util_Formatting::maskFormat($enterprise['Cnpj'], '##.###.###/####-##'); $creationDate = strtotime($enterprise['CreationDate']); $creationDate = date('d/m/Y', $creationDate); $annualRevenue = $this->getAnnualRevenue(); $categorySector = $this->getCategorySector(); $cep = Vtx_Util_Formatting::maskFormat($addressEnterprise['Cep'], '#####-###'); $state = $this->getState(); $city = $this->getCity(); $neighborhood = $this->getNeighborhood(); $categoryAward = $this->getCategoryAward(); return array(array('SocialName' => $enterprise['SocialName'], 'FantasyName' => $enterprise['FantasyName'], 'Cnpj' => $cnpj), array('CreationDate' => $creationDate, 'EmailDefault' => $enterprise['EmailDefault'], 'Cnae' => $enterprise['Cnae']), array('Phone' => $enterprise['Phone'], 'Site' => $enterprise['Site'], 'EmployeesQuantity' => $enterprise['EmployeesQuantity']), array('AnnualRevenue' => $annualRevenue, 'CategorySector' => $categorySector, 'Cep' => $cep), array('StreetNameFull' => $addressEnterprise['StreetNameFull'], 'StreetNumber' => $addressEnterprise['StreetNumber'], 'StreetCompletion' => $addressEnterprise['StreetCompletion']), array('Neighborhood' => $neighborhood, 'City' => $city, 'State' => $state), array('CategoryAward' => $categoryAward)); }
/** * * @param type $userId * @return type */ public function getEnterpriseData($userId) { $User = new Model_User(); $President = new Model_President(); $Enterprise = new Model_Enterprise(); $UserLocality = new Model_UserLocality(); $AddressEnterprise = new Model_AddressEnterprise(); //$userId = 81; $userRow = $User->getUserById($userId); $userLocalityRow = $UserLocality->getUserLocalityByUserId($userRow->getId()); $enterpriseRow = $Enterprise->getEnterpriseById($userLocalityRow->getEnterpriseId()); $presidentRow = $President->getPresidentByEnterpriseId($enterpriseRow->getId()); $addressEnterpriseRow = $AddressEnterprise->getAddressEnterpriseByEnterpriseId($enterpriseRow->getId()); $arrAnnualRevenue = Vtx_Util_Array::annualRevenue(); $neighborhood = $addressEnterpriseRow->findParentNeighborhood(); $arrEnterprise = array('Registro OCB' => $enterpriseRow->getOcbRegister() != '' ? $enterpriseRow->getOcbRegister() : '', 'Razão Social' => $enterpriseRow->getSocialName() != '' ? $enterpriseRow->getSocialName() : '', 'E-mail' => $enterpriseRow->getEmailDefault() != '' ? $enterpriseRow->getEmailDefault() : '', 'Nome Fantasia' => $enterpriseRow->getFantasyName() != '' ? $enterpriseRow->getFantasyName() : '', 'Ramo de Atividade' => $enterpriseRow->getMetierId() ? DbTable_Metier::getInstance()->getById($enterpriseRow->getMetierId())->getDescription() : '', 'Atividade Econômica(CNAE)' => $enterpriseRow->getCnae() != '' ? $enterpriseRow->getCnae() : '', 'CPF/CNPJ' => $enterpriseRow->getCnpj() != '' ? Vtx_Util_Formatting::maskFormat($enterpriseRow->getCnpj(), '##.###.###/####-##') : '', 'Porte da Empresa' => $enterpriseRow->getAnnualRevenue() != '' && isset($arrAnnualRevenue[$enterpriseRow->getAnnualRevenue()]) ? $arrAnnualRevenue[$enterpriseRow->getAnnualRevenue()] : '', 'Número de Colaboradores' => $enterpriseRow->getEmployeesQuantity() != '' ? $enterpriseRow->getEmployeesQuantity() : '', 'Data de Abertura' => $enterpriseRow->getCreationDate() != '' ? Vtx_Util_Date::format_dma($enterpriseRow->getCreationDate()) : '', 'Endereço' => is_object($addressEnterpriseRow) ? $addressEnterpriseRow->getStreetNameFull() : '', 'Número' => is_object($addressEnterpriseRow) ? $addressEnterpriseRow->getStreetNumber() : '', 'Complemento' => is_object($addressEnterpriseRow) ? $addressEnterpriseRow->getStreetCompletion() : '', 'Bairro' => $neighborhood ? $addressEnterpriseRow->findParentNeighborhood()->getName() : '', 'Cidade/Estado' => is_object($addressEnterpriseRow) ? DbTable_City::getInstance()->getById($addressEnterpriseRow->getCityId())->getName() . "/" . DbTable_State::getInstance()->getById($addressEnterpriseRow->getStateId())->getUf() : '', 'CEP' => is_object($addressEnterpriseRow) ? Vtx_Util_Formatting::maskFormat($addressEnterpriseRow->getCep(), '#####-###') : ''); $arrContact = array('Nome' => is_object($presidentRow) ? $presidentRow->getName() : '', 'Cargo' => is_object($presidentRow) ? 'Presidente' : '', 'Telefone' => is_object($presidentRow) ? $presidentRow->getPhone() : '', 'E-mail' => is_object($presidentRow) ? $presidentRow->getEmail() : '', 'Cpf' => Vtx_Util_Formatting::maskFormat($presidentRow->getCpf(), '###.###.###-##')); $arrIssues = array('0' => array('Q' => '1. É uma Matriz?', 'R' => $enterpriseRow->getHeadOfficeStatus() == '1' ? 'Sim' : 'Não'), '1' => array('Q' => '2. É uma Singular?', 'R' => $enterpriseRow->getSingularStatus() == '1' ? 'Sim' : 'Não'), '2' => array('Q' => '3. A empresa está vinculada a alguma Central?', 'R' => $enterpriseRow->getCentralName() != '' ? $enterpriseRow->getCentralName() : 'Não'), '3' => array('Q' => '4. A empresa está vinculada a alguma Federação?', 'R' => $enterpriseRow->getFederationName() != '' ? $enterpriseRow->getFederationName() : 'Não'), '4' => array('Q' => '5. A empresa está vinculada a alguma Confederação?', 'R' => $enterpriseRow->getConfederationName() != '' ? $enterpriseRow->getConfederationName() : 'Não')); return array($arrEnterprise, $arrContact, $arrIssues); }
protected function validData($reportData) { $userRoleDescription = strtolower(Zend_Auth::getInstance()->getIdentity()->getRoleLongDescription()); $validationRequired = !in_array($userRoleDescription, array('gestor', 'digitador'), true); if ($validationRequired) { $titulo = $reportData['title']; // str_replace(, "\n", ''); $texto = str_replace("\n", ' ', $reportData['report']); // preg_replace(array('~[:;!?]|[.,](?![0-9])|\'s~', '~\s+~'), array('', ' '), $reportData['report']); // $palavras = trim($titulo) . ' ' . trim($texto); $characters = mb_strlen($titulo, "UTF-8") + mb_strlen($texto, "UTF-8"); $words = Vtx_Util_Formatting::contadorPalavras($titulo) + Vtx_Util_Formatting::contadorPalavras($texto); //$characters = $words; //$words = count(explode(' ', trim($palavras))); //var_dump($palavras,$words,$characters); /* var_dump($words); die; um dois; três qu4tró% (çinço) çeis sete 39 / * * O Relato deverá ter de 60 linhas a 120 linhas, de 500 a 1200 palavras e de 3.000 a 7.140 caracteres, contando o Título. */ if ($characters < 2900 or $words < 480 or $words > 1300) { return array('status' => false, 'messageError' => 'O Relato deverá ter mais de 3.000 caracteres e ter de 500 a 1200 palavras, contando o Título.'); } if ($characters > 7240 or $words < 480 or $words > 1300) { return array('status' => false, 'messageError' => 'O Relato deverá ter menos de 7.140 caracteres e ter de 500 a 1200 palavras, contando o Título.'); } } return array('status' => true); }
/** * faz calculo da pontuacao para tabela Radar */ public function dadosTabelaPontuacao() { $arrCriteria = $this->getArrCriteria(); $arrPunctuation = $this->getArrPunctuation(); $arrRadarData = $this->getArrRadarData(); $arrTabulation = $this->getArrTabulation(); $pontuacaoMaxima = Vtx_Util_Array::pontuacaoMaximaCriteriosGestao(); #('15,0', '9,0', '9,0', '6,0', '6,0','9,0','16,0','30,0' ); $objPontuacao = new stdClass(); //Lideranca $objPontuacao->Lideranca = new stdClass(); $objPontuacao->Lideranca->nome = $arrCriteria[1]; $objPontuacao->Lideranca->pontuacaoMaxima = $pontuacaoMaxima[1]; $objPontuacao->Lideranca->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[1]); $objPontuacao->Lideranca->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[1]); //Estrategias e Planos $objPontuacao->Estrategias = new stdClass(); $objPontuacao->Estrategias->nome = $arrCriteria[2]; $objPontuacao->Estrategias->pontuacaoMaxima = $pontuacaoMaxima[2]; $objPontuacao->Estrategias->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[2]); $objPontuacao->Estrategias->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[2]); //Clientes $objPontuacao->Clientes = new stdClass(); $objPontuacao->Clientes->nome = $arrCriteria[3]; $objPontuacao->Clientes->pontuacaoMaxima = $pontuacaoMaxima[3]; $objPontuacao->Clientes->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[3]); $objPontuacao->Clientes->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[3]); //Sociedade $objPontuacao->Sociedade = new stdClass(); $objPontuacao->Sociedade->nome = $arrCriteria[4]; $objPontuacao->Sociedade->pontuacaoMaxima = $pontuacaoMaxima[4]; $objPontuacao->Sociedade->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[4]); $objPontuacao->Sociedade->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[4]); //Informações e Conhecimento $objPontuacao->Informacoes = new stdClass(); $objPontuacao->Informacoes->nome = $arrCriteria[5]; $objPontuacao->Informacoes->pontuacaoMaxima = $pontuacaoMaxima[5]; $objPontuacao->Informacoes->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[5]); $objPontuacao->Informacoes->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[5]); //Pessoas $objPontuacao->Pessoas = new stdClass(); $objPontuacao->Pessoas->nome = $arrCriteria[6]; $objPontuacao->Pessoas->pontuacaoMaxima = $pontuacaoMaxima[6]; $objPontuacao->Pessoas->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[6]); $objPontuacao->Pessoas->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[6]); //Processos $objPontuacao->Processos = new stdClass(); $objPontuacao->Processos->nome = $arrCriteria[7]; $objPontuacao->Processos->pontuacaoMaxima = $pontuacaoMaxima[7]; $objPontuacao->Processos->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[7]); $objPontuacao->Processos->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[7]); //Resultados $objPontuacao->Resultados = new stdClass(); $objPontuacao->Resultados->nome = $arrCriteria[8]; $objPontuacao->Resultados->pontuacaoMaxima = $pontuacaoMaxima[8]; $objPontuacao->Resultados->pontuacaoObtida = Vtx_Util_Formatting::roundAndDouble($arrPunctuation[8]); $objPontuacao->Resultados->porcentagem = Vtx_Util_Formatting::roundAndDouble($arrRadarData[8]); return $objPontuacao; }
public function getFormattedCnpj() { return Vtx_Util_Formatting::maskFormat($this->getCnpj(), '##.###.###/####-##'); }
public function updateAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $dbTablePresident = new DbTable_President(); $createUser = $dbTablePresident->migrateUser(); $objArray = $createUser->toArray(); $obj = array(); foreach ($objArray as $newUser) { $obj = array(); $senha = !empty($newUser['Password']) ? $newUser['Password'] : md5('1234'); $nome = !empty($newUser['Name']) ? $newUser['Name'] : "psmn"; $email = !empty($newUser['Email']) ? $newUser['Email'] : "null"; $obj['cpf'] = Vtx_Util_Formatting::maskFormat($newUser['Cpf'], '###.###.###-##'); $obj['first_name'] = $nome; $obj['surname'] = $newUser['NickName']; $obj['email'] = $email; $obj['enterprise_id'] = $newUser['EnterpriseId']; $obj['keypass'] = $senha; $createUserMigrate = $this->userModel->createUserMigrate($obj); if (!$createUserMigrate['status']) { echo '<pre>'; print_r($obj); echo $createUserMigrate['messageError']; return; } /* */ echo $newUser['EnterpriseId'] . '<br />'; } }
/** * funcao que faz a geracao e recuperacao do Protocolo da devolutiva * * @author esilva * * @param type $objView * @param type $objDevolutive * @param type $objUser * @param type $questionnaire_id * @param type $user_id * @param type $programaId * @param type $permissionEvaluationOfResponse * */ public function geracaoDoProtocolo($objView, $objDevolutive, $objExecution, $objUser, $questionnaire_id, $user_id, $loggedUserId, $programaId, $permissionEvaluationOfResponse) { $this->loggedUserId = $loggedUserId; $this->view = $objView; $this->Execution = $objExecution; $this->Devolutive = $objDevolutive; $this->modelUser = $objUser; $this->modelProtocolo = $this; /////////////////////////// // CODIGO NOVO para protocolo devolutiva /////////////////////////// $geraProtocolo = false; if ($permissionEvaluationOfResponse) { $existsArchive = $this->Execution->getEvaluationPath($questionnaire_id, $user_id, $programaId); } else { $existsArchive = $this->Execution->getDevolutivePath($questionnaire_id, $user_id, $programaId); } //valida se deve gerar um protocolo if (!$existsArchive) { $geraProtocolo = true; //gerando protocolo para devolutiva $protocoloDevolutiva = $this->modelProtocolo->insertProtocolo($user_id, $this->loggedUserId, $programaId); //este eh o numero de protocolo da devolutiva $this->Devolutive->setProtocoloIdDevolutiva($protocoloDevolutiva['lastId']); $this->Devolutive->setProtocoloCreateAt($protocoloDevolutiva['createAt']); //este é a string protocolo que é printado na devolutiva $protocolo = Vtx_Util_Formatting::protocoloPSMN($this->Devolutive->getProtocoloIdDevolutiva(), $this->Devolutive->getProtocoloCreateAt()); //pega o usuario logado que gerou a devolutiva, podendo ser o usuario, gestor ou admin $user = $this->modelUser->getUserById($this->loggedUserId); //JSON $this->view->protocoloId = $this->Devolutive->getProtocoloIdDevolutiva(); $this->view->protocolo = $this->Devolutive->getProtocolo(); $this->view->protocoloCreateAt = $this->Devolutive->getProtocoloCreateAt(); $this->view->userLogadoGerouDevolutiva = $user->getFirstName(); $geraProtocolo = true; $this->Devolutive->setProtocolo($protocolo); } else { //caso seja uma devolutiva pdf ja gerada //recupera informacoes da devolutiva gerada na tabela ProtocoloDevolutiva //$objProtocoloDevolutiva = $this->modelProtocolo->getDbtable()->getProtocoloByUserId($userId, $programaId); $objProtocoloDevolutiva = $this->modelProtocolo->getDbtable()->getProtocoloByDevolutivePath($existsArchive); if (is_object($objProtocoloDevolutiva)) { $user = $this->modelUser->getUserById($objProtocoloDevolutiva->getUserIdLogado()); //JSON $this->view->protocoloId = $objProtocoloDevolutiva->getId(); $this->view->protocolo = Vtx_Util_Formatting::protocoloPSMN($objProtocoloDevolutiva->getId(), $objProtocoloDevolutiva->getCreateAt()); $this->view->protocoloCreateAt = Vtx_Util_Date::format_date_devolutive($objProtocoloDevolutiva->getCreateAt()); $this->view->userLogadoGerouDevolutiva = $user->getFirstName(); $geraProtocolo = true; } else { $this->view->protocoloId = ""; $this->view->protocolo = ""; $this->view->protocoloCreateAt = ""; $this->view->userLogadoGerouDevolutiva = ""; } } ///////////////////////////////// //fim codigo protocolo devolutiva ///////////////////////////////// return $geraProtocolo; }
/** * dados da empresa * * @param type $userId * @return type */ public function getEnterpriseData($userId) { $User = new Model_User(); //$President = new Model_President(); $Enterprise = new Model_Enterprise(); $UserLocality = new Model_UserLocality(); $AddressEnterprise = new Model_AddressEnterprise(); $Position = new Model_Position(); $userRow = $User->getUserById($userId); $userLocalityRow = $UserLocality->getUserLocalityByUserId($userRow->getId()); $enterpriseRow = $Enterprise->getEnterpriseById($userLocalityRow->getEnterpriseId()); //var_dump('EnterpriseId: ',$enterpriseRow->getId()); //$presidentRow = $President->getPresidentByEnterpriseId($enterpriseRow->getId()); $addressEnterpriseRow = $AddressEnterprise->getAddressEnterpriseByEnterpriseId($enterpriseRow->getId()); $arrAnnualRevenue = Vtx_Util_Array::annualRevenue(); $arrCategoria = Vtx_Util_Array::categoriaMpe(); $idCategoria = $enterpriseRow->getCategoriaId(); $nomeCategoria = ""; if (is_int($idCategoria)) { $nomeCategoria = $arrCategoria[$idCategoria]; } $arrTipoEmpresa = Vtx_Util_Array::tipoEmpresaMPE(); $idTipoEmpresa = $enterpriseRow->getEnterpriseTypeId(); $tipoEmpresa = ""; if (is_int($idTipoEmpresa)) { $tipoEmpresa = $arrTipoEmpresa[$idTipoEmpresa]; } // var_dump('addressEnterpriseRow: ',$addressEnterpriseRow); // exit; $neighborhood = $addressEnterpriseRow->findParentNeighborhood(); //var_dump('neighborhood: ',$neighborhood); $idUf = $addressEnterpriseRow->getStateId(); $idCidade = $addressEnterpriseRow->getCityId(); //var_dump($idCidade); //var_dump($idUf); if (is_int($idUf)) { $uf = DbTable_State::getInstance()->getById($idUf)->getUf(); } else { $uf = ""; } if (is_int($idCidade)) { $cidade = DbTable_City::getInstance()->getById($idCidade)->getName(); } else { $cidade = ""; } $cidadeEstado = $cidade . "/" . $uf; //var_dump ($cidadeEstado); exit; //var_dump($cidadeEstado); //exit; $cnpj = $enterpriseRow->getCnpj(); if (is_string($cnpj)) { $cpfCnpj = $cnpj; } else { $cpfCnpj = ""; } //$cnpjMask = Vtx_Util_Formatting::maskFormat($getcnpj,'##.###.###/####-##'); //$cnpj = null; //var_dump($cnpj); //exit; $arrEnterprise = array('Razão Social' => $enterpriseRow->getSocialName() != '' ? $enterpriseRow->getSocialName() : '', 'E-mail' => $enterpriseRow->getEmailDefault() != '' ? $enterpriseRow->getEmailDefault() : '', 'Nome Fantasia' => $enterpriseRow->getFantasyName() != '' ? $enterpriseRow->getFantasyName() : '', 'Atividade Econômica(CNAE)' => $enterpriseRow->getCnae() != '' ? $enterpriseRow->getCnae() : '', 'CPF/CNPJ' => $cpfCnpj, 'Faturamento Anual' => $enterpriseRow->getAnnualRevenue() != '' && isset($arrAnnualRevenue[$enterpriseRow->getAnnualRevenue()]) ? $arrAnnualRevenue[$enterpriseRow->getAnnualRevenue()] : '', 'Número de Colaboradores' => $enterpriseRow->getEmployeesQuantity() != '' ? $enterpriseRow->getEmployeesQuantity() : '0', 'Data de Abertura' => $enterpriseRow->getCreationDate() != '' ? Vtx_Util_Date::format_dma($enterpriseRow->getCreationDate()) : '', 'Endereço' => is_object($addressEnterpriseRow) ? $addressEnterpriseRow->getStreetNameFull() : '', 'Número' => is_object($addressEnterpriseRow) ? $addressEnterpriseRow->getStreetNumber() : '', 'Complemento' => is_object($addressEnterpriseRow) ? $addressEnterpriseRow->getStreetCompletion() : '', 'Bairro' => $neighborhood ? $addressEnterpriseRow->findParentNeighborhood()->getName() : '', 'Cidade/Estado' => $cidadeEstado, 'CEP' => is_object($addressEnterpriseRow) ? Vtx_Util_Formatting::maskFormat($addressEnterpriseRow->getCep(), '#####-###') : '', 'Categoria' => $nomeCategoria, 'Tipo Empresa' => $tipoEmpresa); $idPosition = $userRow->getPositionId(); $cargo = ""; if (is_int($idPosition)) { $posicao = $Position->getPosition($idPosition); $cargo = $posicao ? $posicao->getDescription() : ''; } $arrContact = array('Nome' => is_object($userRow) ? $userRow->getNomeCompleto() : '', 'Cargo' => is_object($userRow) ? $cargo : '', 'Telefone' => is_object($userRow) ? $userRow->getTelefone() : '', 'Celular' => is_object($userRow) ? $userRow->getCelular() : '', 'E-mail' => is_object($userRow) ? $userRow->getEmail() : ''); $arrIssues = array(); return array($arrEnterprise, $arrContact, $arrIssues); }
/** * * media da porcentagem obtida */ private function calcularMediaPorcentagemObtida() { //$somaPorcentagem = array_sum($this->getArrPorcentagemObtida()); //$mediaPorcentagem = ($somaPorcentagem / $this->getQtdLinhasTabelaPontuacao()); //return Vtx_Util_Formatting::roundAndDouble($mediaPorcentagem); return Vtx_Util_Formatting::roundAndDouble($this->calcularTotalPontuacaoObtida()); }
public function updateEnterprise($enterpriseRowData, $data) { $data['status'] = isset($data['status']) ? $data['status'] : $enterpriseRowData->getStatus(); $data = $this->_filterInputEnterprise($data)->getUnescaped(); $verifyCnpj = DbTable_Enterprise::getInstance()->fetchRow(array('Cnpj = ?' => $data['cnpj'], 'IdKey != ?' => $enterpriseRowData->getIdKey())); if ($verifyCnpj and !empty($data['cnpj'])) { return array('status' => false, 'messageError' => 'CNPJ (' . $data['cnpj'] . ') já em uso.'); } $enterpriseRowData->setCategoryAwardId(isset($data['category_award_id']) ? $data['category_award_id'] : $enterpriseRowData->getCategoryAwardId())->setCategorySectorId(isset($data['category_sector_id']) ? $data['category_sector_id'] : $enterpriseRowData->getCategorySectorId())->setSocialName(isset($data['social_name']) ? $data['social_name'] : $enterpriseRowData->getSocialName())->setFantasyName(isset($data['fantasy_name']) ? $data['fantasy_name'] : $enterpriseRowData->getFantasyName())->setStatus(isset($data['status']) ? $data['status'] : $enterpriseRowData->getStatus())->setCnpj(isset($data['cnpj']) ? $data['cnpj'] : $enterpriseRowData->getCnpj())->setStateRegistration(isset($data['state_registration']) ? $data['state_registration'] : $enterpriseRowData->getStateRegistration())->setDap(isset($data['dap']) ? $data['dap'] : $enterpriseRowData->getDap())->setRegisterMinistryFisher(isset($data['register_ministry_fisher']) ? $data['register_ministry_fisher'] : $enterpriseRowData->getRegisterMinistryFisher())->setCreationDate(isset($data['creation_date']) ? Vtx_Util_Date::format_iso($data['creation_date']) : $enterpriseRowData->getCreationDate())->setEmployeesQuantity(isset($data['employees_quantity']) ? $data['employees_quantity'] : $enterpriseRowData->getEmployeesQuantity())->setAnnualRevenue(isset($data['annual_revenue']) ? Vtx_Util_Formatting::realToDecimal($data['annual_revenue']) : $enterpriseRowData->getAnnualRevenue())->setCnae(isset($data['cnae']) ? $data['cnae'] : $enterpriseRowData->getCnae())->setEmailDefault(isset($data['email_default']) ? $data['email_default'] : $enterpriseRowData->getEmailDefault())->setPhone(isset($data['phone']) ? $data['phone'] : $enterpriseRowData->getPhone())->setSite(isset($data['site']) ? $data['site'] : $enterpriseRowData->getSite())->setCompanyHistory(isset($data['company_history']) ? $data['company_history'] : $enterpriseRowData->getCompanyHistory())->setNirf(isset($data['nirf']) ? $data['nirf'] : $enterpriseRowData->getNirf())->setHasntEmail(isset($data['hasnt_email']) ? $data['hasnt_email'] : 0)->setFarmSize(isset($data['farm_size']) ? $data['farm_size'] : $enterpriseRowData->getFarmSize()); $enterpriseRowData->save(); return array('status' => true, 'row' => $enterpriseRowData); }