@extends('template.layout')
@section('styles')
    <link href="{{asset('css/icheck/skins/all.css')}}" rel="stylesheet" type="text/css"/>
    <style>
        .select2-selection.select2-selection--single{
            height: 34px !important;
            /*width: 209px !important;*/
        }
    </style>
@endsection
@section('content')
    <h1 class="page-title">
        Tesorería
    </h1>
    <div class="portlet light bordered">
        <div class="portlet-title">
            <h1 class="page-title">
                Gestión de Caja
            </h1>
        </div>
        <div class="portlet-body">
            <div id="caja" class="">
                <div class="tabbable-custom nav-justified">
                    <ul class="nav nav-tabs nav-justified">
                        <li class="active">
                            <a href="#tab_1_1_1" data-toggle="tab"> Configuración de Caja </a>
                        </li>
                    </ul>
                    {{ Form::open(array('id' => 'form-validation','route' => 'aperturar.caja', 'class'=>'form-horizontal')) }}
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab_1_1_1">
                            <div class="row">
                                <div class="col-md-offset-3 col-md-6">
                                    <div class="col-md-12">
                                        <div class="col-md-6">
                                            <h4><i class="glyphicon glyphicon-barcode"></i> Serie</h4>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="input-group">
                                                <select class="form-control select2" id="series_select" value="" >
                                                    @foreach($series as $serie)
                                                        <option value="{{$serie->id}}-{{$serie->correlativo}}">{{$serie->serie}}</option>
                                                    @endforeach
                                                </select>
                                                <span class="input-group-btn btn-right">
                                                    <button class="btn blue-madison agregar" type="button" onclick="agregarSerie()">Agregar</button>
                                                </span>
                                            </div>
                                        </div>
                                        {!! Form::hidden('Pserie', null, array('id' => 'Pserie')) !!}
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-offset-3 col-md-6">
                                    <div class="col-md-12">
                                        <div class="col-md-6">
                                            <h4><i class="glyphicon glyphicon-cog"></i> Correlativo</h4>
                                        </div>
                                        <div class="col-md-6">
                                            {!! Form::text('Pcorrelativo', null, array('placeholder' => '','class' => 'form-control input', 'id' => 'ccorrelativo', 'required' => 'required', 'maxlength' => '4','readonly' => 'readonly')) !!}
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-offset-3 col-md-6">
                                    <div class="col-md-12">
                                        <div class="col-md-6">
                                            <h4><i class="glyphicon glyphicon-usd"></i> Monto Inicial</h4>
                                        </div>
                                        <div class="col-md-6">
                                            {!! Form::number('minicial', 0, array('placeholder' => '','step' => '0.01','class' => 'form-control input', 'id' => 'minicial', 'required' => 'required','min' => '0','max' => '99999' ,'maxlength' => '6','onkeypress' => 'return isNumberKey(event)','onpaste' => 'return false')) !!}
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-offset-3 col-md-6">
                                    <div class="col-md-12" style="margin-top: 5%; !important; ">
                                        <button style="width: 100%" id="btn-pay" type="submit" class="btn blue-madison">
                                            Aperturar Caja
                                        </button>
                                    </div>
                                </div>
                            </div>
                            <br/>
                        </div>
                    </div>
                    {!! Form::close() !!}
                </div>
            </div>
        </div>
    </div>
    <div id="Modal" class=""></div>
@endsection
@section('scripts')
    <script>
        var url_serie = "{{ url('tesoreria/caja/registrarserie') }}";
    </script>
    <script src="{{asset('css/icheck/icheck.min.js')}}" type="text/javascript"></script>
    <script src="{{asset('js/Tesoreria/GestionCaja.js')}}"></script>
@endsection