Exemplo n.º 1
0
        if ($editar['tipo'] == "alerta") {
            $tpl->ALERTA = $editar['msg'];
        } elseif ($editar['tipo'] == "aviso") {
            $tpl->AVISO = $editar['msg'];
        }
    }
}
/***************************************
	MOSTRAR OU UMA NOTA OU TODAS NO PERIODO
	***************************************/
$mes_ref = isset($_GET['mes']) && $_GET['mes'] >= 1 && $_GET['mes'] <= 12 ? $_GET['mes'] : Date('n');
$ano_ref = isset($_GET['ano']) && $_GET['ano'] >= 2012 && $_GET['ano'] <= Date('Y') ? $_GET['ano'] : Date('Y');
if (isset($_GET['chave']) && $_GET['chave'] > 0) {
    $notaid = (int) $_GET['chave'];
    $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;
Exemplo n.º 2
0
 }
 $tpl->CONSTOTAL = tratarValor($mesConsTotal);
 $tpl->PAGOTOTAL = tratarValor($mesPagoTotal, true);
 $mediaUC = count($eachMes) > 0 ? $mesPagoTotal / count($eachMes) : 1;
 $tpl->MEDIA = tratarValor($mediaUC, true);
 $tpl->AUMENTO = getPorcentagem(end($eachMes)['valor'] * 100 / $mediaUC - 100, true);
 /*********************************
 		      MOSTRAR HISTÓRICO GERAL
 		 *********************************/
 $cumulativo = 0;
 $cons_soma = 0;
 if (count($uc->getAllNotas(false)) >= 1) {
     foreach ($uc->getAllNotas(false) as $notaRes) {
         $nota = new Nota($notaRes['id']);
         if (!$nota->isEmpenho()) {
             $tpl->NFMESANO = $nota->get('data_ref');
             $tpl->NFNUMERO = $nota->get('numero');
             $nota->get('nome') != "" ? $nota->get('numero') . " - " . $nota->get('nome') : $nota->get('numero');
             $tpl->NFNOME = $nota->get('nome') != "" ? "- " . $nota->get('nome') : "";
             $tpl->NFDATA = setDateDiaMesAno($nota->get('emissao'));
             $tpl->NFCONS = tratarValor($nota->get('consumo'));
             $tpl->NFPAGO = tratarValor($nota->get('valor'), true);
             $tpl->NFPROV = $nota->get('provisoria');
             $tpl->NFLANCPOR = $nota->get('usuario')->get('login');
             $tpl->NFSAIDA = setDateDiaMesAno($nota->get('saida'));
             $tpl->NFPAGODATA = setDateDiaMesAno($nota->get('pagoem'));
             $cumulativo += $nota->get('valor');
             $tpl->NFCUMULATIVO = tratarValor($cumulativo, true);
             $cons_soma += $nota->get('consumo');
         }
         $tpl->BLOCK('EACH_FINANCEIRO');