@extends('layout')
@section('title', 'Pagos Detallado')
@section('content')
<div class="col-sm-12 col-md-9 col-lg-10 col-xl-10">
    <h3 class="text-center titulo">Informe Detallado Pago Factura</h3>
    <div class="borde-forma">
        <form id="form" method="post" accept-charset="utf-8" action="{{ route('InformePagoDetallado') }}" target="_blank">
            <p class="parrafo-forma">
                Los campos marcados con <strong class="requerido">*</strong> son obligatorios.
            </p>
            {{ csrf_field() }}
            <input type="hidden" name="txtId" id="txtId" value="">
            <div class="form-group row">
                <label for="txtFactura" class="col-sm-12 col-form-label col-md-5 col-lg-5 col-xl-5 text-right">
                    <strong class="requerido">*</strong>Factura:
                </label>
                <div class="col-sm-12 col-md-3 col-lg-3 col-xl-3 validar">
                    <input type="text" name="txtFactura" id="txtFactura" title="Seleccione Factura" value="" class="form-control" placeholder="Factura" required="">
                    <input type="hidden" name="sltFactura" id="sltFactura" value="" required="">
                </div>
            </div>
            <div class="form-group row">
                <label for="btnGuardar" class="col-form-label col-md-5 col-lg-5 col-xl-5"></label>
                <div class="col-sm-2 col-md-1 col-lg-1 col-xl-1">
                    <button type="submit" class="btn btn-primary fa fa-save sombra"></button>
                </div>
            </div>
        </form>
    </div>
</div>
@stop
@section('script')
<script type="text/javascript" charset="utf-8" async defer>
    $("#txtFactura").autocomplete({
        source:"/municipiobarbosa-sigiep/predial/public/factura/buscar",
        minLength: 3,
        select: function(event, ui){
            $("#txtFactura").val(ui.item.value);
            $("#sltFactura").val(ui.item.id);
            var factura = ui.item.id;

            $.get("/municipiobarbosa-sigiep/predial/public/obtnerCodigoPredio",
            {
                "factura" : factura
            });           
        }
    });
</script>
@stop