@extends('layouts.app')

@section('content')
<div class="container">
    <div class="col-md-8 offset-md-2">
        <h1>Veredicto del Reporte</h1>
        <hr>
        @if(isset($report))
            {!! Form::model($report,['method'=>'put','id'=>'frm']) !!}
        @else
            {!! Form::open(['id'=>'frm']) !!}
        @endif
        <div class="form-group row required">
            {!! Form::label("veredict","Veredicto",["class"=>"col-form-label col-md-3 col-lg-2"]) !!}
            <div class="col-md-8">
                {!! Form::text("veredict",null,["class"=>"form-control".($errors->has('report')?" is-invalid":""),"autofocus",'placeholder'=>'Veredicto final']) !!}
                <span id="error-name" class="invalid-feedback"></span>
            </div>
        </div>
        <div class="form-group row">
            {!! Form::label("contract_status","Acción sobre el contrato",["class"=>"col-form-label col-md-3 col-lg-2"]) !!}
            <div class="col-md-8">
                {!! Form::select("contract_status", [
                    ''  => '— Sin cambio de estatus —',
                    '8' => 'Devuelto al cliente (reembolso Stripe)',
                    '9' => 'Disputa terminada (pagar al proveedor)',
                ], null, ["class"=>"form-control"]) !!}
                <small class="text-muted">
                    "Devuelto al cliente" emite el reembolso en Stripe automáticamente.
                    "Disputa terminada" aparece en la sección de Pagos.
                </small>
            </div>
        </div>
        @if ($errors->any())
            <div class="alert alert-danger">
                <ul>
                    @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
        @endif
        <div class="form-group row">
            <div class="col-md-3 col-lg-2"></div>
            <div class="col-md-4">
                <a href="{{url('reports')}}" class="btn btn-danger btn-xs">
                    Atrás</a>
                {!! Form::button("Guardar",["type" => "submit","class"=>"btn btn-primary btn-xs"])!!}
            </div>
        </div>
        {!! Form::close() !!}
    </div>
</div>
@endsection
