{% if bandera == 1 %}
    <label class="alert alert-danger col-lg-12 text-center">
        NO ES CANDIDATO PARA TITULACIÓN, AÚN ESTÁ EN UN CUATRIMESTRE O SEMESTRE MENOR A 7
        <input type="hidden" value="0" id="banderaTitulacion" name="banderaTitulacion">
    </label>
{% elseif bandera == 2 %}
    <div class="row">
        <label class="alert alert-info col-lg-12 text-center">
            SI ES CANDIDATO, PERO, SE DEBE DE DAR DE ALTA EL COSTO DE TITULACIÓN
            <input type="hidden" value="1" id="banderaTitulacion" name="banderaTitulacion">
        </label>

        <div class="col-lg-6">
            <label class="control-label">COSTO DEL TRAMITE</label>
            <input type="number" class="form-control form-control-sm text-right" id="costoTitulacion" name="costoTitulacion" placeholder="Ingresa el costo total del trámite">
        </div>
        <div class="col-lg-2 text-center">
            <label class="control-label">.</label>
            <input type="button" value="REGISTRAR" class="btn btn-sm btn-primary btn-block" onclick="registrarTitulacion()">
        </div>
    </div><!-- FIN row -->
{% else %}
    <div class="row">
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 panel">
            {% set abonado = 0 %}
            {% set restan = 0 %}
            {% if lista is defined and lista != null %}
                {% for l in lista %}
                    {% set abonado = abonado + l.monto %}
                {% endfor %}
            {% endif %}
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 alert-success text-center" style="font-size: larger;">
                CONCEPTO: TITULACIÓN
                <input type="hidden" value="{{p.idePag}}" id="ideAbonoAPagar">
            </div>
            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 alert-info text-center" style="font-size: larger;">
                TOTAL A PAGAR: ${{p.monto | number_format(2,".",",") }}
                <input type="hidden" value="{{p.monto}}" id="totalAPagarAbono">
            </div>
            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 alert-warning text-center" style="font-size: larger;">
                {% set restan = (p.monto - abonado) %}
                <strong>RESTAN: ${{ restan | number_format(2,".",",") }}</strong>
                <input type="hidden" value="{{p.monto - abonado}}" id="totalRestaAbono">
            </div>
        </div><!-- FIN col-lg-12 -->
        <div class="col-lg-12 table-responsive">
            <table class="table table-condensed table-striped">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>FECHA</th>
                        <th>MONTO</th>
                        <th></th>
                        <th>-</th>
                    </tr>
                </thead>
                <tbody>
                    {% if lista is defined and lista != null %}
                        {% set totalAbono = 0 %}
                        {% for l in lista %}
                            <tr>
                                <td>{{loop.index}}</td>
                                <td>{{l.fecMov | date('d-m-Y') }}</td>
                                <td>${{l.monto | number_format(2,".",",") }}</td>
                                <td>
                                    {% if loop.last %}
                                        <a id="btnGenerarComprobanteAbono" class="btn btn-xs btn-success" href="{{path('imprimir_pagos_bachi',{ideAlu:a.ideAlu,ideIng:l.ideIng})}}" target="_blank">IMP</a>
                                    {% else %}
                                        <a id="btnGenerarComprobanteAbono" class="btn btn-xs btn-primary" href="{{path('imprimir_pagos_bachi',{ideAlu:a.ideAlu,ideIng:l.ideIng})}}" target="_blank">IMP</a>
                                    {% endif %}
                                </td>
                                <td>{{l.numRecibo}}</td>
                            </tr>
                            {% set totalAbono = totalAbono + l.monto %}
                        {% endfor %}
                        <tr>
                            <td colspan="2">TOTAL</td>
                            <td>${{totalAbono | number_format(2,".",",")}}</td>
                        </tr>
                    {% endif %}
                </tbody>
            </table>
        </div><!-- FIN col-lg-12 -->

    </div><!-- FIN row -->
{% endif %}