@extends('layout')
@section('title', 'Pagos Anteriores')
@section('style')
    <style>
        .chosen-container-single .chosen-single {
            line-height: 34px !important;
            height: 34px !important;
        }
    </style>
@stop
@section('content')
    <div class="col-sm-12 col-md-10 col-lg-10 col-xl-10">
        <h3 class="text-center titulo">Pagos Anteriores</h3>
        <div class="borde-forma">
            <form id="form-inline" method="post" accept-charset="utf-8" action="{{ route("ProcesarPagoAnterior")  }}">
                <p class="parrafo-forma">
                    Los campos marcados con <strong class="requerido">*</strong> son obligatorios.
                </p>
                {{ csrf_field() }}
                <div class="form-group row">
                    <label for="txtPredio" class="col-sm-12 col-form-label col-md-5 col-lg-5 col-xl-5 text-xl-right text-lg-right text-md-right text-sm-left">
                        <strong class="requerido">*</strong>Predio:
                    </label>
                    <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 validar">
                        <input type="text" name="txtPredio" id="txtPredio" title="Ingrese número de predio" class="form-control" placeholder="Número de Codigo Catastral" required="" style="height: 34px;" autocomplete="off">
                    </div>
                </div>
                <div class="form-group row">
                    <label for="txtFechaLiq" class="col-sm-12 col-form-label col-md-5 col-lg-5 col-xl-5text-xl-right text-lg-right text-md-right text-sm-left">
                        <strong class="requerido">*</strong>Fecha Liquidación:
                    </label>
                    <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 validar">
                        <input type="text" name="txtFechaLiq" id="txtFechaLiq" title="Ingrese fecha de liquidación" class="form-control fecha" placeholder="Fecha de Liquidación" required="" style="height: 34px;" autocomplete="off">
                    </div>
                </div>
                <div class="form-group row">
                    <label for="txtFechaPag" class="col-sm-12 col-form-label col-md-5 col-lg-5 col-xl-5 text-xl-right text-lg-right text-md-right text-sm-left">
                        <strong class="requerido">*</strong>Fecha de Pago:
                    </label>
                    <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 validar">
                        <input type="text" name="txtFechaPag" id="txtFechaPag" title="Ingrese fecha de pago" class="form-control fecha" placeholder="Fecha de Pago" required="" style="height: 34px;" autocomplete="off">
                    </div>
                </div>
                <div class="form-group row">
                    <label for="txtFechaPag" class="col-sm-12 col-form-label col-md-5 col-lg-5 col-xl-5 text-xl-right text-lg-right text-md-right text-sm-left">
                        <strong class="requerido">*</strong>Años a Facturar:
                    </label>
                    <div class="col-sm-6 col-md-2 col-lg-3 col-xl-3 validar">
                        <input type="text" name="txtAnoI" id="txtAnoI" title="Ingrese año inicial a facturar" class="form-control anno" placeholder="Año Inicial" required="" style="height: 34px;" autocomplete="off">
                    </div>
                    <div class="col-sm-6 col-md-2 col-lg-3 col-xl-3 validar">
                        <input type="text" name="txtAnoF" id="txtAnoF" title="Ingrese año final a facturar" class="form-control anno" placeholder="Año Final" required="" style="height: 34px;" autocomplete="off" value="{{ date("Y") }}">
                    </div>
                </div>
                <div class="form-group row">
                    <label for="sltBanco" class="col-sm-12 col-form-label col-md-5 col-lg-5 col-xl-5 text-xl-right text-lg-right text-md-right text-sm-left">
                        <strong class="requerido">*</strong>Banco:
                    </label>
                    <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 validar">
                        <select class="form-control select" name="sltBanco" id="sltBanco" title="Seleccione Banco" placeholder="Banco" style="height: 34px !important;">
                            <option value="">Banco</option>
                            @foreach($bancos as $row)
                                <option value='{{ $row->id_unico }}'>{{  $row->cod." ".$row->descripcion }}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
                <div class="form-group row">
                    <label for="sltBanco" class="col-sm-12 col-form-label col-md-5 col-lg-5 col-xl-5 text-xl-right text-lg-right text-md-right text-sm-left"></label>
                    <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 validar">
                        <button class="btn btn-primary sombra"><span class="fa fa-send"></span></button>
                    </div>
                </div>
            </form>
        </div>
    </div>
@stop
@section('script')
    <script>
        $("#txtPredio").autocomplete({
            source:"{{ action('PagosAnterioresController@buscarPredioCodigo')}}",
            minLength: 5,
            select: function(event, ui){
                $("#txtPredio").val(ui.item.value);
            }
        });
    </script>
@stop