$nota = new Nota($notaid);
    $permissao = $nota->get('contrato')->get('permissao');
    if ($_SESSION['nivel'] == 1 || $_SESSION['nivel'] == $permissao) {
        $tpl->NOTANUM = $nota->get('numero');
        $tpl->UO = $nota->get('uc')->get('uo')->getSigla();
        $tpl->UC = $nota->get('uc')->get('rgi') . " - [ " . $nota->get('uc')->getNome() . " ]";
        $tpl->DATA_REF = $nota->get('data_ref');
        $tpl->EMPRESA = $nota->get('uc')->get('empresa')->getNome();
        $tpl->EMISSAO = setDateDiaMesAno($nota->get('emissao'));
        $tpl->VENCTO = setDateDiaMesAno($nota->get('vencto'));
        $tpl->SAIDA = setDateDiaMesAno($nota->get('saida'));
        $tpl->PROV = $nota->get('provisoria');
        $tpl->CONSUMO = tratarValor($nota->get('consumo'));
        $tpl->VALOR = tratarValor($nota->get('valor'), true);
        $tpl->USUARIO = $nota->get('usuario')->get('login');
        $tpl->OBS = $nota->getObs();
        $tpl->NID = $notaid;
        $tpl->block('FORM_BODY');
    }
    // SE TIVER NA PERMISSÃO CORRETA
} else {
    /************************** 
    		 MOSTRAR MESES PARA ESCOLHA
    		**************************/
    for ($i = 1; $i <= 12; $i++) {
        $tpl->MESLISTNUM = $i;
        $tpl->MESLIST = getMesNome($i) . "/" . $ano_ref;
        $tpl->block('EACH_MESLIST');
    }
    $sql_cont = $_SESSION['nivel'] != 1 ? "SELECT id FROM daee_contratos WHERE permissao={$nivel}" : "SELECT id FROM daee_contratos";
    $query_cont = mysql_query($sql_cont);