session_start();
require "../main_Lib.php";
require "../smartyLib/Smarty.class.php";
include_once '../class/class_transaccion.php';
$smarty = new Smarty();
require_once '../phpLib/SmartyToolbox.php';
smartyTemplate($smarty, "../");
validarAcceso(AuthUser::TIPO_SECRETARIA);
$mes_selec = isset($_POST['mes_selec']) ? $_POST['mes_selec'] : null;
if (!$mes_selec) {
    $mes_selec = date("m");
}
$class_transaccion = new transaccion();
$transDiaria = array();
if (count($_POST) > 0) {
    $transaccionesDia = $class_transaccion->obtenerTransaccionMensualConsolidada($mes_selec, "boleta");
    foreach ($transaccionesDia as $dia => $transacciones) {
        $desde = null;
        $hasta = null;
        $escolaridad = $excension = $interes = $matricula = 0;
        foreach ($transacciones as $id => $transaccion) {
            if ($desde == null) {
                $desde = $transaccion["trans_num_boleta"];
            }
            $hasta = $transaccion["trans_num_boleta"];
            $interes += $transaccion["trans_interes"];
            $escolaridad += $transaccion["trans_monto"];
            $exencion += $transaccion["trans_descuento"] + $transaccion["trans_beca"];
        }
        $transDiaria[$dia]["dia"] = $dia;
        $transDiaria[$dia]["desde"] = $desde;