<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace CmBundle\Controller;

use FPDF;

date_default_timezone_set('America/Mexico_City');

/**
 * Description of PHP
 *
 * @author grupo2m
 */
class PDFMercadotecnia extends FPDF {

    // Cabecera de página
    function Header() {
        
    }

    // Pie de página
    function Footer() {
        
    }

    function recibo($data, $pago, $ban) {// EN EFECTIVO
        $this->SetFont('Arial', 'B', 12);
        //$this->SetTopMargin(0);
        $this->SetLeftMargin(2);
        //$this->Image('images/Imagen11.png', 5, 10, 15);
        if ($data->getCveRazSoz() != null) {
            $this->MultiCell(0, 5, utf8_decode($data->getCveRazSoz()->getRazonSocial()), 0, "C", FALSE);
        } else {
            $this->MultiCell(0, 5, utf8_decode(""), 0, "C", FALSE);
        }
        $this->Ln();
        $this->SetFont('Arial', '', 12);
        if ($data->getCveRazSoz() != null) {
            $this->Cell(0, 5, $data->getCveRazSoz()->getRfc(), 0, 0, "C", FALSE);
        } else {
            $this->Cell(0, 5, "", 0, 0, "L", FALSE);
        }
        $this->Ln();
        $this->SetFont('Arial', 'I', 9);
        if ($data->getCveRazSoz() != null) {
            $this->MultiCell(0, 5, utf8_decode($data->getCveRazSoz()->getDomFis()), 0, "C", FALSE);
        } else {
            $this->MultiCell(0, 5, utf8_decode(""), 0, "C", FALSE);
        }
        $this->Ln();
        $this->SetFont('', '', 14);
        $this->Cell(20, 5, "No.: ", "TBL", 0, "C", FALSE);
        if ($data->getCveRazSoz() != null) {
            $this->Cell(20, 5, $pago->getNumRecibo(), "TBR", 0, "R", FALSE);
        } else {
            $this->Cell(20, 5, $pago->getNumRecibo(), "TBR", 0, "R", FALSE);
        }

        $this->Ln();
        $this->SetFont('', '', 14);
        $this->Cell(30, 5, "", 0, 0, "R", FALSE);
        $this->Cell(0, 5, "$ " . number_format($data->getTotal(), 2, ".", ","), "B", 0, "R", FALSE);
        $this->Ln();
        $this->Ln();
        $this->SetFont('', '', 12);
        $this->Cell(25, 5, "Recibimos de: ", 0, 0, "C", FALSE);
        $this->Cell(0, 5, utf8_decode($data->getCveAlu()->getApePat() . " " . $data->getCveAlu()->getApeMat()), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode($data->getCveAlu()->getNomAlu()), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode("(" . $pago->getNomMes() . " " . $pago->getFecIni()->format('Y') . ")"), "B", 0, "C", FALSE);
        //$this->Cell(0, 5, utf8_decode("(" . $this->num2letras($data->getTotal(),false ) . ")"), "B", 0, "C", FALSE);
        $this->Ln();
        if ($data->getCveAlu()->getTipoAlumno() == 1) {
            $this->Cell(25, 5, utf8_decode("Bachillerato: "), 0, 0, "C", FALSE);
        } elseif ($data->getCveAlu()->getTipoAlumno() == 2) {
            $this->Cell(25, 5, utf8_decode("B. Tecnologico: "), 0, 0, "C", FALSE);
        } elseif ($data->getCveAlu()->getTipoAlumno() == 3) {
            $this->Cell(25, 5, utf8_decode("Licenciatura: "), 0, 0, "C", FALSE);
        } elseif ($data->getCveAlu()->getTipoAlumno() == 4) {
            $this->Cell(25, 5, utf8_decode("Maestria: "), 0, 0, "C", FALSE);
        }
        $this->Ln();
        $this->Cell(0, 5, utf8_decode($data->getCveAlu()->getCveLic()->getNomLic()), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(30, 5, utf8_decode("Por concepto de: "), 0, 0, "C", FALSE);
        $this->Ln();
        $this->SetFont('', 'B', 12);
        if ($ban == 1) {
            if ($data->getCveAlu()->getReinscripcion() == 0) {
                $this->Cell(0, 5, utf8_decode("INSCRIPCION"), "B", 0, "C", FALSE);
            } else {
                $this->Cell(0, 5, utf8_decode("REINSCRIPCION"), "B", 0, "C", FALSE);
            }
        } elseif ($ban == 2) {
            if ($data->getCveAlu()->getModalidad() == "SEMESTRAL") {
                $this->Cell(0, 5, utf8_decode("PAGO SEMESTRAL"), "B", 0, "C", FALSE);
            } else {
                $this->Cell(0, 5, utf8_decode("PAGO CUATRIMESTRAL"), "B", 0, "C", FALSE);
            }
        } else {
            $this->Cell(0, 5, utf8_decode("MENSUALIDAD"), "B", 0, "C", FALSE);
        }
        $this->SetFont('', '', 11);
        $this->Ln();
        $this->Ln();
        $mesesIngles = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
        $mesesMexico = array('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre');
        $mes = str_replace($mesesIngles, $mesesMexico, date('F'));

        $this->Cell(0, 5, utf8_decode("Tol. Méx., a " . date('d') . " de " . $mes . " de " . date('Y')), 0, 0, "C", FALSE);
        $this->Ln();
        $this->Ln();
        $this->Cell(0, 5, utf8_decode(""), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode("FIRMA"), 0, 0, "C", FALSE);
    }

    function reciboAbono($data) {// EN EFECTIVO
        $this->SetFont('Arial', 'B', 12);
        //$this->SetTopMargin(0);
        $this->SetLeftMargin(2);
        //$this->Image('images/Imagen11.png', 5, 10, 15);
        if ($data->getCveRazSoz() != null) {
            $this->MultiCell(0, 5, utf8_decode($data->getCveRazSoz()->getRazonSocial()), 0, "C", FALSE);
        } else {
            $this->MultiCell(0, 5, utf8_decode(""), 0, "C", FALSE);
        }
        $this->Ln();
        $this->SetFont('Arial', '', 12);
        if ($data->getCveRazSoz() != null) {
            $this->Cell(0, 5, $data->getCveRazSoz()->getRfc(), 0, 0, "C", FALSE);
        } else {
            $this->Cell(0, 5, "", 0, 0, "L", FALSE);
        }
        $this->Ln();
        $this->SetFont('Arial', 'I', 9);
        if ($data->getCveRazSoz() != null) {
            $this->MultiCell(0, 5, utf8_decode($data->getCveRazSoz()->getDomFis()), 0, "C", FALSE);
        } else {
            $this->MultiCell(0, 5, utf8_decode(""), 0, "C", FALSE);
        }
        $this->Ln();
        $this->SetFont('', '', 14);
        $this->Cell(20, 5, "No.: ", "TBL", 0, "C", FALSE);
        if ($data->getCveRazSoz() != null) {
            $this->Cell(20, 5, $data->getNumRecibo(), "TBR", 0, "R", FALSE);
        } else {
            $this->Cell(20, 5, $data->getNumRecibo(), "TBR", 0, "R", FALSE);
        }

        $this->Ln();
        $this->SetFont('', '', 14);
        $this->Cell(30, 5, "", 0, 0, "R", FALSE);
        $this->Cell(0, 5, "$ " . number_format($data->getTotal(), 2, ".", ","), "B", 0, "R", FALSE);
        $this->Ln();
        $this->Ln();
        $this->SetFont('', '', 12);
        $this->Cell(25, 5, "Recibimos de: ", 0, 0, "C", FALSE);
        $this->Cell(0, 5, utf8_decode($data->getCveAlu()->getApePat() . " " . $data->getCveAlu()->getApeMat()), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode($data->getCveAlu()->getNomAlu()), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode("( CANTIDAD EN LETRA)"), "B", 0, "C", FALSE);
        //$this->Cell(0, 5, utf8_decode("(" . $this->num2letras($data->getTotal(),false ) . ")"), "B", 0, "C", FALSE);
        $this->Ln();
        if ($data->getCveAlu()->getTipoAlumno() == 1) {
            $this->Cell(25, 5, utf8_decode("Bachillerato: "), 0, 0, "C", FALSE);
        } elseif ($data->getCveAlu()->getTipoAlumno() == 2) {
            $this->Cell(25, 5, utf8_decode("B. Tecnologico: "), 0, 0, "C", FALSE);
        } elseif ($data->getCveAlu()->getTipoAlumno() == 3) {
            $this->Cell(25, 5, utf8_decode("Licenciatura: "), 0, 0, "C", FALSE);
        } elseif ($data->getCveAlu()->getTipoAlumno() == 4) {
            $this->Cell(25, 5, utf8_decode("Maestria: "), 0, 0, "C", FALSE);
        }
        $this->Ln();
        $this->Cell(0, 5, utf8_decode($data->getCveAlu()->getCveLic()->getNomLic()), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(30, 5, utf8_decode("Por concepto de: "), 0, 0, "C", FALSE);
        $this->Ln();
        $this->SetFont('', 'B', 12);
        
        $this->Cell(0, 5, utf8_decode($data->getDescripcion()), "B", 0, "C", FALSE);
        
        $this->SetFont('', '', 11);
        $this->Ln();
        $this->Ln();
        $mesesIngles = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
        $mesesMexico = array('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre');
        $mes = str_replace($mesesIngles, $mesesMexico, date('F'));

        $this->Cell(0, 5, utf8_decode("Tol. Méx., a " . date('d') . " de " . $mes . " de " . date('Y')), 0, 0, "C", FALSE);
        $this->Ln();
        $this->Ln();
        $this->Cell(0, 5, utf8_decode(""), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode("FIRMA"), 0, 0, "C", FALSE);
    }

    function reciboDos($data, $pago, $ban) {
        $this->Image('images/Imagen11.png', 10, 10, 15);
        $this->Image('images/sep.png', 122, 12, 20);
        $this->Image('images/rfc.png', 121, 33, 23);
        $this->SetFont('', 'B', "");
        $this->Cell(20, 5, "", 0, 0, "C", FALSE);
        $this->Cell(80, 5, "TEC MEXIQUENSE", 0, 0, "C", FALSE);
        $this->Cell(35, 5, "", 0, 0, "C", FALSE);
        $this->Cell(0, 5, "RECIBO", "LRT", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(20, 5, "", 0, 0, "C", FALSE);
        $this->Cell(80, 5, "CAMPUS LICENCIATURAS", 0, 0, "C", FALSE);
        $this->Cell(35, 5, "", 0, 0, "C", FALSE);
        $this->Cell(0, 5, "DE PAGO:     " . $data->getIdeIng(), "LRB", 0, "L", FALSE);
        $this->Ln();
        $this->SetFont('Arial', 'I', 8);
        $this->Cell(20, 5, "", 0, 0, "C", FALSE);
        $this->Cell(80, 5, "R.F.C. CMU-040503-5E4", 0, 0, "C", FALSE);
        $this->Ln();
        $this->SetFont('Arial', 'I', 6);
        $this->Cell(20, 5, "", 0, 0, "C", FALSE);
        $this->Cell(80, 5, utf8_decode("JOSE MARÍA MORELOS #102, esquina con Lerdo de Tejada,San Miguel Zinacantepec, México, Méx."), 0, 0, "C", FALSE);
        $this->Cell(35, 5, "", 0, 0, "C", FALSE);
        $this->SetFont('Arial', '', 8);
        $this->Cell(0, 5, "EXPEDIDO EN TOLUCA, MEX., A", 1, 0, "L", FALSE);
        $this->Ln();
        $this->Cell(110, 5, "", "LRT", 0, "C", FALSE);
        $this->SetFont('Arial', '', 10);
        $this->Cell(25, 5, "", 0, 0, "C", FALSE);
        $this->Cell(0, 5, "", "LR", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(25, 5, "Recibimos de:", "L", 0, "L", FALSE);
        $this->Cell(85, 5, utf8_decode($data->getCveAlu()->getApePat() . " " . $data->getCveAlu()->getApeMat() . " " . $data->getCveAlu()->getNomAlu()), "R", 0, "C", FALSE);
        $this->Cell(25, 5, "", 0, 0, "C", FALSE);
        $this->Cell(0, 5, "", "LR", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(25, 5, "Domicilio:", "L", 0, "L", FALSE);
        $this->Cell(85, 5, utf8_decode(""), "R", 0, "C", FALSE);
        $this->Cell(25, 5, "", 0, 0, "C", FALSE);
        $this->Cell(0, 5, "LIQUIDACION", 1, 0, "C", FALSE);
        $this->Ln();
        $this->Cell(110, 5, "", "LR", 0, "C", FALSE);
        $this->Cell(25, 5, "", 0, 0, "C", FALSE);
        $this->Cell(0, 5, "", "LR", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(30, 5, "Por concepto de:", "L", 0, "L", FALSE);
        if ($ban == 1) {
            if ($data->getCveAlu()->getReinscripcion() == 0) {
                $this->Cell(80, 5, utf8_decode("INSCRIPCION: " . $pago->getNomMes()), "R", 0, "C", FALSE);
            } else {
                $this->Cell(80, 5, utf8_decode("REINSCRIPCION: " . $pago->getNomMes()), "R", 0, "C", FALSE);
            }
        } else {
            $this->Cell(80, 5, utf8_decode("MENSUALIDAD: " . $pago->getNomMes()), "R", 0, "C", FALSE);
        }
        $this->Cell(25, 5, "", 0, 0, "C", FALSE);
        $this->Cell(0, 5, "TOTAL: $ " . $data->getTotal(), "LR", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(110, 5, "", "LR", 0, "C", FALSE);
        $this->Cell(25, 5, "", 0, 0, "C", FALSE);
        $this->Cell(0, 5, "", "LRB", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(45, 5, "CANTIDAD CON LETRA:", "L", 0, "L", FALSE);
        $this->Cell(65, 5, utf8_decode(""), "R", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(110, 5, "", "LR", 0, "C", FALSE);
        $this->Cell(25, 5, "", 0, 0, "C", FALSE);
        $this->Cell(0, 5, "", "LRT", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(110, 5, "", "LRB", 0, "C", FALSE);
        $this->Cell(25, 5, "", 0, 0, "C", FALSE);
        $this->Cell(0, 5, "", "LR", 0, "L", FALSE);
        $this->Ln(4);
        $this->Cell(110, 5, "", 0, 0, "C", FALSE);
        $this->Cell(25, 5, "", 0, 0, "C", FALSE);
        $this->Cell(0, 5, "Firma del Cajero", 1, 0, "C", FALSE);
    }

    function reciboOtros($data, $rs) {
        $this->SetFont('Arial', '', 14);
        //$this->SetTopMargin(0);
        $this->SetLeftMargin(2);

        $mesesIngles = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
        $mesesMexico = array('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre');

        //$this->Image('images/Imagen11.png', 10, 10, 15);
        $this->SetFont('', 'B', 12);
        $this->MultiCell(0, 5, utf8_decode($rs->getRazonSocial()), 0, "C", FALSE);
        $this->Ln();
        $this->SetFont('', '', 12);
        $this->Cell(0, 5, $rs->getRfc(), 0, 0, "C", FALSE);
        $this->SetFont('Arial', 'I', 8);
        $this->Ln();
        $this->MultiCell(0, 5, utf8_decode($rs->getDomFis()), 0, "C", FALSE);
        $this->Ln();
        $this->SetFont('', '', 14);
        $this->Cell(20, 5, "No.: ", "TBL", 0, "C", FALSE);
        $this->Cell(20, 5, $data->getNumeroRecibo(), "TBR", 0, "R", FALSE);
        $this->Ln();
        $this->Ln();
        $this->SetFont('', '', 14);
        $this->Cell(30, 5, "", 0, 0, "R", FALSE);
        $this->Cell(0, 5, "$ " . number_format($data->getMonto(), 2, ".", ","), "B", 0, "R", FALSE);
        $this->Ln();
        $this->SetFont('', '', 12);
        $this->Cell(30, 5, "Recibimos de: ", 0, 0, "C", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode($data->getCveAlu()->getApePat() . " " . $data->getCveAlu()->getApeMat()), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode($data->getCveAlu()->getNomAlu()), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode("(" . $data->getCveTra()->getDesTra() . ")"), "B", 0, "C", FALSE);
        $this->Ln();
        if ($data->getCveAlu()->getTipoAlumno() == 1) {
            $this->Cell(25, 5, utf8_decode("Bachillerato: "), 0, 0, "C", FALSE);
        } elseif ($data->getCveAlu()->getTipoAlumno() == 2) {
            $this->Cell(25, 5, utf8_decode("B. Tecnologico: "), 0, 0, "C", FALSE);
        } elseif ($data->getCveAlu()->getTipoAlumno() == 3) {
            $this->Cell(25, 5, utf8_decode("Licenciatura: "), 0, 0, "C", FALSE);
        } elseif ($data->getCveAlu()->getTipoAlumno() == 4) {
            $this->Cell(25, 5, utf8_decode("Maestria: "), 0, 0, "C", FALSE);
        }
        $this->Ln();
        $this->Cell(0, 5, utf8_decode($data->getCveAlu()->getCveLic()->getNomLic()), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(31, 5, utf8_decode("Por concepto de: "), 0, 0, "C", FALSE);
        $this->SetFont('', 'B', 12);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode($data->getCveTra()->getDesTra()), 0, 0, "C", FALSE);
        $this->SetFont('', '', 10);
        $this->Ln(8);

        $mes = str_replace($mesesIngles, $mesesMexico, date('F'));

        $this->Cell(0, 5, utf8_decode("Tol. Méx., a " . date('d') . " de " . $mes . " de " . date('Y')), 0, 0, "R", FALSE);
        $this->Ln();
        $this->Ln();
        $this->Cell(0, 5, utf8_decode(""), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode("FIRMA"), 0, 0, "C", FALSE);
    }

    function reciboExtra($e, $rs) {
        $this->SetLeftMargin(2);

        $mesesIngles = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
        $mesesMexico = array('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre');

        //$this->Image('images/Imagen11.png', 10, 10, 15);
        $this->SetFont('', 'B', 12);
        $this->MultiCell(0, 5, utf8_decode($rs->getRazonSocial()), 0, "C", FALSE);
        $this->Ln(1);
        $this->SetFont('', '', 12);
        $this->Cell(0, 5, $rs->getRfc(), 0, 0, "C", FALSE);
        $this->SetFont('Arial', 'I', 8);
        $this->Ln();
        $this->SetFont('Arial', '', 12);
        $this->Cell(0, 5, "Calificacion:_________________", 0, 0, "R", FALSE);
        $this->Ln();
        $this->Cell(0, 5, "Examen: ", 0, 0, "C", FALSE);
        $this->Ln();
        $this->SetFont('Arial', '', 10);
        $this->Cell(0, 5, "Extra I(  )    Extra II(  )   Titulo(  )   Otro(  )", 0, 0, "C", FALSE);
        $this->Ln();
        $this->Ln();
        $this->SetFont('', '', 12);
        $this->Cell(20, 5, "Alumno: ", 0, 0, "L", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode($e->getCveAlu()->getNomAlu() . " " . $e->getCveAlu()->getApePat() . " " . $e->getCveAlu()->getApeMat()), "B", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(20, 5, "Profesor: ", 0, 0, "L", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode($e->getProfesor()), "B", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(20, 5, "MATERIA: ", 0, 0, "L", FALSE);
        $this->Ln();
        $this->Cell(0, 5, utf8_decode($e->getMateria()), "B", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(20, 5, "del Sem.: ", 0, 0, "L", FALSE);
        $this->Cell(15, 5, utf8_decode($e->getSemestre()), "B", 0, "C", FALSE);
        $this->Cell(15, 5, "Grupo: ", 0, 0, "L", FALSE);
        $this->Cell(0, 5, utf8_decode($e->getGrupo()), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(25, 5, "PERIODO: ", 0, 0, "L", FALSE);
        $this->Cell(0, 5, utf8_decode($e->getPeriodo()), "B", 0, "C", FALSE);
        $this->Ln();
        $this->Cell(15, 5, "Turno: ", 0, 0, "L", FALSE);
        $this->Cell(30, 5, utf8_decode($e->getTurno()), "B", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(25, 5, "Sem. Actual: ", 0, 0, "L", FALSE);
        $this->Cell(15, 5, utf8_decode($e->getSemActual()), "B", 0, "L", FALSE);
        $this->Ln();
        $this->SetFont('Arial', '', 10);
        $this->Cell(25, 5, "Especialidad: ", 0, 0, "L", FALSE);
        $this->SetFont('Arial', '', 12);
        $this->Cell(0, 5, utf8_decode($e->getEspecialidad()), "B", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(20, 5, "Fecha: ", 0, 0, "C", FALSE);
        $this->Cell(0, 5, utf8_decode($e->getFecMov()->format('d-m-Y')), "B", 0, "L", FALSE);
        $this->Ln();
        $this->Cell(20, 5, "Costo: ", 0, 0, "C", FALSE);
        $this->Cell(0, 5, "$ " . utf8_decode(number_format($e->getCosto(), 2, ".", ",")), "B", 0, "L", FALSE);
        $this->Ln();
        $this->Ln();
        $mes = str_replace($mesesIngles, $mesesMexico, date('F'));

        $this->SetFont('Arial', '', 12);
        $this->Cell(30, 5, utf8_decode("No.: " . $e->getIdeExa()), 1, 0, "L", FALSE);
        //$this->Cell(0, 5, utf8_decode("Tol. Méx., a " . date('d') . " de " . $mes . " de " . date('Y')), 0, 0, "R", FALSE);
        $this->Ln(13);
        $this->Cell(5, 5, utf8_decode(""), 0, 0, "C", FALSE);
        $this->Cell(30, 5, utf8_decode(""), "B", 0, "C", FALSE);
        $this->Cell(10, 5, utf8_decode(""), 0, 0, "C", FALSE);
        $this->Cell(30, 5, utf8_decode(""), "B", 0, "C", FALSE);
        $this->Ln();
        $this->SetFont('Arial', '', 10);
        $this->Cell(5, 5, utf8_decode(""), 0, 0, "C", FALSE);
        $this->Cell(30, 5, utf8_decode("FIRMA DEL PROFESOR"), 0, 0, "C", FALSE);
        $this->Cell(10, 5, utf8_decode(""), 0, 0, "C", FALSE);
        $this->Cell(30, 5, utf8_decode("RECIBIO"), 0, 0, "C", FALSE);
        $this->Cell(5, 5, utf8_decode(""), 0, 0, "C", FALSE);
    }

    /*
     * function recibo($data,$pago,$ban) {
      $this->SetFont('Arial', '', 14);
      $this->SetLeftMargin(2);
      $this->Image('images/Imagen11.png', 10, 10, 15);
      $this->SetFont('', 'B', "");
      $this->Cell(20, 5, "", 0, 0, "C", FALSE);
      $this->Cell(0, 5, "GRUPO COLEGIO", 0, 0, "C", FALSE);
      $this->Ln();
      $this->Cell(20, 5, "", 0, 0, "C", FALSE);
      $this->Cell(0, 5, "MEXIQUENSE", 0, 0, "C", FALSE);
      $this->Ln();
      $this->Cell(20, 5, "", 0, 0, "C", FALSE);
      $this->Cell(0, 5, "CAMPUS LICENCIATURAS", 0, 0, "C", FALSE);
      $this->Ln();
      $this->Ln();
      $this->SetFont('Arial', 'I', 8);
      $this->Cell(0, 5, "Carr. a San Felipe Tlalmimilolpan No. 409 Km. 2.5", 0, 0, "C", FALSE);
      $this->Ln();
      $this->Cell(0, 5, "TEL: 318-71-92 y 318-71-93 Toluca, Mex.", 0, 0, "C", FALSE);
      $this->Ln();
      $this->Ln();
      $this->SetFont('', '', 10);
      $this->Cell(20, 5, "No.: ", 0, 0, "C", FALSE);
      $this->Cell(20, 5, $data->getIdeIng(), 0, 0, "L", FALSE);
      $this->Ln();
      $this->Ln();
      $this->SetFont('', '', 12);
      $this->Cell(60, 5, "", 0, 0, "R", FALSE);
      $this->Cell(0, 5, "$ ".$data->getTotal(), "B", 0, "R", FALSE);
      $this->Ln();
      $this->Ln();
      $this->SetFont('', '', 10);
      $this->Cell(20, 5, "Recibimos de: ", 0, 0, "C", FALSE);
      $this->Cell(0, 5, utf8_decode($data->getCveAlu()->getApePat() . " " . $data->getCveAlu()->getApeMat()), "B", 0, "C", FALSE);
      $this->Ln();
      $this->Cell(0, 5, utf8_decode($data->getCveAlu()->getNomAlu()), "B", 0, "C", FALSE);
      $this->Ln();
      $this->Cell(0, 5, utf8_decode("(".$pago->getNomMes()." ".$pago->getFecIni()->format('Y').")"), "B", 0, "C", FALSE);
      $this->Ln();
      $this->Cell(20, 5, utf8_decode("Licenciatura: "), 0, 0, "C", FALSE);
      $this->Cell(0, 5, utf8_decode($data->getCveAlu()->getCveLic()->getNomLic()), "B", 0, "C", FALSE);
      $this->Ln();
      $this->Cell(25, 5, utf8_decode("Por concepto de: "), 0, 0, "C", FALSE);
      $this->SetFont('', 'B', 12);
      if($ban == 1){
      if($data->getCveAlu()->getReinscripcion() == 0){
      $this->Cell(0, 5, utf8_decode("INSCRIPCION"), 0, 0, "C", FALSE);
      }else{
      $this->Cell(0, 5, utf8_decode("REINSCRIPCION"), 0, 0, "C", FALSE);
      }

      }else{
      $this->Cell(0, 5, utf8_decode("MENSUALIDAD"), 0, 0, "C", FALSE);
      }
      $this->SetFont('', '', 10);
      $this->Ln();
      $this->Cell(0, 5, utf8_decode(""), "B", 0, "C", FALSE);
      $this->Ln();
      $this->Ln();
      $mesesIngles = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
      $mesesMexico = array('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre');
      $mes = str_replace($mesesIngles, $mesesMexico, date('F'));

      $this->Cell(0, 5, utf8_decode("Tol. Méx., a ".date('d')." de ".$mes." de ".date('Y')), 0, 0, "R", FALSE);
      $this->Ln();
      $this->Ln();
      $this->Cell(5, 5, utf8_decode(""), 0, 0, "C", FALSE);
      $this->Cell(30, 5, utf8_decode(""), "B", 0, "C", FALSE);
      $this->Cell(10, 5, utf8_decode(""), 0, 0, "C", FALSE);
      $this->Cell(30, 5, utf8_decode(""), "B", 0, "C", FALSE);
      $this->Cell(5, 5, utf8_decode(""), 0, 0, "C", FALSE);
      $this->Ln();
      $this->Cell(5, 5, utf8_decode(""), 0, 0, "C", FALSE);
      $this->Cell(30, 5, utf8_decode("Vo.Bo."), 0, 0, "C", FALSE);
      $this->Cell(10, 5, utf8_decode(""), 0, 0, "C", FALSE);
      $this->Cell(30, 5, utf8_decode("FIRMA"), 0, 0, "C", FALSE);
      $this->Cell(5, 5, utf8_decode(""), 0, 0, "C", FALSE);
      $this->Ln();
      $this->Cell(5, 5, utf8_decode(""), 0, 0, "C", FALSE);
      $this->Cell(30, 5, utf8_decode("DIRECTOR"), 0, 0, "C", FALSE);

      }
     */

    /* ! 
      @function num2letras ()
      @abstract Dado un n?mero lo devuelve escrito.
      @param $num number - N?mero a convertir.
      @param $fem bool - Forma femenina (true) o no (false).
      @param $dec bool - Con decimales (true) o no (false).
      @result string - Devuelve el n?mero escrito en letra.

     */

    function num2letras($num, $fem = false, $dec = true) {
        $matuni[2] = "dos";
        $matuni[3] = "tres";
        $matuni[4] = "cuatro";
        $matuni[5] = "cinco";
        $matuni[6] = "seis";
        $matuni[7] = "siete";
        $matuni[8] = "ocho";
        $matuni[9] = "nueve";
        $matuni[10] = "diez";
        $matuni[11] = "once";
        $matuni[12] = "doce";
        $matuni[13] = "trece";
        $matuni[14] = "catorce";
        $matuni[15] = "quince";
        $matuni[16] = "dieciseis";
        $matuni[17] = "diecisiete";
        $matuni[18] = "dieciocho";
        $matuni[19] = "diecinueve";
        $matuni[20] = "veinte";
        $matunisub[2] = "dos";
        $matunisub[3] = "tres";
        $matunisub[4] = "cuatro";
        $matunisub[5] = "quin";
        $matunisub[6] = "seis";
        $matunisub[7] = "sete";
        $matunisub[8] = "ocho";
        $matunisub[9] = "nove";

        $matdec[2] = "veint";
        $matdec[3] = "treinta";
        $matdec[4] = "cuarenta";
        $matdec[5] = "cincuenta";
        $matdec[6] = "sesenta";
        $matdec[7] = "setenta";
        $matdec[8] = "ochenta";
        $matdec[9] = "noventa";
        $matsub[3] = 'mill';
        $matsub[5] = 'bill';
        $matsub[7] = 'mill';
        $matsub[9] = 'trill';
        $matsub[11] = 'mill';
        $matsub[13] = 'bill';
        $matsub[15] = 'mill';
        $matmil[4] = 'millones';
        $matmil[6] = 'billones';
        $matmil[7] = 'de billones';
        $matmil[8] = 'millones de billones';
        $matmil[10] = 'trillones';
        $matmil[11] = 'de trillones';
        $matmil[12] = 'millones de trillones';
        $matmil[13] = 'de trillones';
        $matmil[14] = 'billones de trillones';
        $matmil[15] = 'de billones de trillones';
        $matmil[16] = 'millones de billones de trillones';

        //Zi hack
        $float = explode('.', $num);
        $num = $float[0];

        $num = trim((string) @$num);
        if ($num[0] == '-') {
            $neg = 'menos ';
            $num = substr($num, 1);
        } else
            $neg = '';
        while ($num[0] == '0')
            $num = substr($num, 1);
        if ($num[0] < '1' or $num[0] > 9)
            $num = '0' . $num;
        $zeros = true;
        $punt = false;
        $ent = '';
        $fra = '';
        for ($c = 0; $c < strlen($num); $c++) {
            $n = $num[$c];
            if (!(strpos(".,'''", $n) === false)) {
                if ($punt)
                    break;
                else {
                    $punt = true;
                    continue;
                }
            } elseif (!(strpos('0123456789', $n) === false)) {
                if ($punt) {
                    if ($n != '0')
                        $zeros = false;
                    $fra .= $n;
                } else
                    $ent .= $n;
            } else
                break;
        }
        $ent = '     ' . $ent;
        if ($dec and $fra and ! $zeros) {
            $fin = ' coma';
            for ($n = 0; $n < strlen($fra); $n++) {
                if (($s = $fra[$n]) == '0')
                    $fin .= ' cero';
                elseif ($s == '1')
                    $fin .= $fem ? ' una' : ' un';
                else
                    $fin .= ' ' . $matuni[$s];
            }
        } else
            $fin = '';
        if ((int) $ent === 0)
            return 'Cero ' . $fin;
        $tex = '';
        $sub = 0;
        $mils = 0;
        $neutro = false;
        while (($num = substr($ent, -3)) != '   ') {
            $ent = substr($ent, 0, -3);
            if (++$sub < 3 and $fem) {
                $matuni[1] = 'una';
                $subcent = 'as';
            } else {
                $matuni[1] = $neutro ? 'un' : 'uno';
                $subcent = 'os';
            }
            $t = '';
            $n2 = substr($num, 1);
            if ($n2 == '00') {
                
            } elseif ($n2 < 21)
                $t = ' ' . $matuni[(int) $n2];
            elseif ($n2 < 30) {
                $n3 = $num[2];
                if ($n3 != 0)
                    $t = 'i' . $matuni[$n3];
                $n2 = $num[1];
                $t = ' ' . $matdec[$n2] . $t;
            }else {
                $n3 = $num[2];
                if ($n3 != 0)
                    $t = ' y ' . $matuni[$n3];
                $n2 = $num[1];
                $t = ' ' . $matdec[$n2] . $t;
            }
            $n = $num[0];
            if ($n == 1) {
                $t = ' ciento' . $t;
            } elseif ($n == 5) {
                $t = ' ' . $matunisub[$n] . 'ient' . $subcent . $t;
            } elseif ($n != 0) {
                $t = ' ' . $matunisub[$n] . 'cient' . $subcent . $t;
            }
            if ($sub == 1) {
                
            } elseif (!isset($matsub[$sub])) {
                if ($num == 1) {
                    $t = ' mil';
                } elseif ($num > 1) {
                    $t .= ' mil';
                }
            } elseif ($num == 1) {
                $t .= ' ' . $matsub[$sub] . '?n';
            } elseif ($num > 1) {
                $t .= ' ' . $matsub[$sub] . 'ones';
            }
            if ($num == '000')
                $mils ++;
            elseif ($mils != 0) {
                if (isset($matmil[$sub]))
                    $t .= ' ' . $matmil[$sub];
                $mils = 0;
            }
            $neutro = true;
            $tex = $t . $tex;
        }
        $tex = $neg . substr($tex, 1) . $fin;
        //Zi hack --> return ucfirst($tex);
        $end_num = ucfirst($tex) . ' pesos ' . $float[1] . '/100 M.N.';
        return $end_num;
    }

}
