{% extends 'base.html.twig' %}

{% block title%}
    WONDER-T-Nal Vehículos
{% endblock %}
{% block titulo %}
    GESTIÓN DE ASIGNACIONES VEHÍCULO - TRANSPORTISTA
{% endblock %}
{% block bread %}
    T-Nal Reg. Asignaciones
{% endblock %}

{% block body %}
<style>
    body {background-image: url({{ asset('recursos/imagenes/sistema/fondo_lateral.png')}});
        background-repeat: no-repeat;
        /*background-size: 200px;*/
        background-size: cover;
    }

    .col-sm-2 {
        max-width: 100%;
    }
</style>

{#{{ form_start(form) }}#}
    {{ form_start(form3, { 'attr': {'novalidate':'novalidate', 'class': 'form-material form-horizontal'} }) }}
<div class="row">
    <div class="col-sm-12">
        <div class="white-box">



                <div class="row">
                    <div style="pointer-events:none" class="form-group col-sm-4" disabled>
                        {{ form_label(form3.chasis) }}
                        {{ form_widget(form3.chasis) }}
                        <span class="text-danger">{{ form_errors(form3.chasis) }}</span>
                    </div>

                    <div style="pointer-events:none" class="form-group col-sm-4">
                        {{ form_label(form3.marca) }}
                        {{ form_widget(form3.marca) }}
                        <span class="text-danger">{{ form_errors(form3.marca) }}</span>
                    </div>

                    <div style="pointer-events:none" class="form-group col-sm-4">
                        {{ form_label(form3.modelo) }}
                        {{ form_widget(form3.modelo) }}
                        <span class="text-danger">{{ form_errors(form3.modelo) }}</span>
                    </div>
                </div>

                <div class="row">
                    <div style="pointer-events:none" class="form-group col-sm-3">
                        {{ form_label(form3.idusuario) }}
                        {{ form_widget(form3.idusuario) }}
                        <span class="text-danger">{{ form_errors(form3.idusuario) }}</span>
                    </div>
                    <div class="col-sm-1"></div>

                    <div style="pointer-events:none" class="form-group col-sm-4">
                        <strong>Banco</strong><br>
                        {% if (tTransportista) %}
                            {{ tTransportista.domicilio }}
                        {% endif %}
                    </div>

                    <div style="pointer-events:none" class="form-group col-sm-4">
                        <strong>No. de Cuenta</strong><br>
                        {% if (tTransportista) %}
                            {{ tTransportista.correo }}
                        {% endif %}
                    </div>
                </div>

                <div style="pointer-events:none" class="row">
                    <div style="pointer-events:none" class="form-group col-sm-3">
                        {{ form_label(form3.idusuario2) }}
                        {{ form_widget(form3.idusuario2) }}
                        <span class="text-danger">{{ form_errors(form3.idusuario2) }}</span>
                    </div>
                    <div class="col-md-3" style="pointer-events:none; background: white;">
                        {{ form_label(form3.montopagar) }}
                        {{ form_widget(form3.montopagar) }}
                        <span class="text-danger">{{ form_errors(form3.montopagar) }}</span>
                    </div>
                    <div class="col-md-12">
                        {{ form_label(form3.observaciones) }}
                        {{ form_widget(form3.observaciones) }}
                        <span class="text-danger">{{ form_errors(form3.observaciones) }}</span>
                    </div>
                </div>

                <div style="background: #fff59f" class="row">
                    <div class="col-md-3">
                        {{ form_label(form3.fechapago) }}
                        {{ form_widget(form3.fechapago) }}
                        <span class="text-danger">{{ form_errors(form3.fechapago) }}</span>
                    </div>
                    <div class="col-sm-1"></div>
                    <div style="pointer-events:none" class="form-group col-md-4">
                        <strong>Monto Neto a Pagar Bs.</strong><br>
                        <input name='miPago' type='text' id='miPago' value=''; >
                    </div>
                    <div class="col-md-4">
                        {{ form_label(form3.idpago) }}
                        {{ form_widget(form3.idpago) }}
{#                        <span class="text-danger">{{ form_errors(form3.idpago) }}</span>#}
                        {% if ((mimensaje1 is defined) and (mimensaje1 is not null)) %}
                            <span class="text-danger">{{ mimensaje1 }}</span>
                        {% endif %}
                    </div>


                    <div class="col-md-3">
                        {{ form_label(form3.descuento) }}
                        {{ form_widget(form3.descuento) }}
{#                        <span class="text-danger">{{ form_errors(form3.descuento) }}</span>#}
                        {% if ((mimensaje2 is defined) and (mimensaje2 is not null)) %}
                            <span class="text-danger">{{ mimensaje2 }}</span>
                        {% endif %}
                    </div>
                    <div class="col-md-9">
                        {{ form_label(form3.observaciondesc) }}
                        {{ form_widget(form3.observaciondesc) }}
{#                        <span class="text-danger">{{ form_errors(form3.observaciondesc) }}</span>#}
                        {% if ((mimensaje3 is defined) and (mimensaje3 is not null)) %}
                            <span class="text-danger">{{ mimensaje3 }}</span>
                        {% endif %}
                    </div>
                </div>


                <div class="modal-footer">
                </div>

                <a class="btn btn-inverse waves-effect waves-light" href="{{ path('tregnal_index', {'idnacional': idnacional}) }}">Cancelar</a>
                <button type="submit" class="btn btn-info waves-effect waves-light m-r-10">Guardar</button>
{#                <button type="button submit" class="btn btn-rounded  btn-success waves-effect waves-light"><i class="ti-save"></i> Grabar</button>#}


            {{ form_end(form3) }}
        </div>
    </div>
</div>


<script>
    function calculaPago() {
        // document.getElementById('miPago').value = '122';
        var descuento = document.getElementById("tregnal_pago_descuento").value;
        var costo = document.getElementById("tregnal_pago_montopagar").value;
        var neto = costo - descuento;
        $("#miPago").val(neto);
    }


    window.onload = calculaPago();

    $(document).ready(function(){
        $("#tregnal_pago_descuento").change(function(){
            calculaPago();
        });
    });

</script>

{% endblock %}