@extends('layout.base')

@section('content')
  <div class="row page-heading">
    <h3>Pagar&eacute; <a href="{{nUrl('pageres', 'show', ['pagare' => $pagare->id])}}">{{$pagare->id}}</a></h3>
  </div>
  <br />
  <form class="form-horizontal" method="post" action="{{nUrl('pagares', 'do_edit', ['pagare' => $pagare->id])}}">
    <div class="form-group">
      <div class="col-md-3">Estado Pago</div>
      <div class="col-md-1"><input type="text" name="estado_pago" value="{{$pagare->estado_pago}}" class="form-control" /></div>
    </div>
    <div class="form-group">
      <div class="col-md-3">N&uacute;mero</div>
      <div class="col-md-3"><input type="text" name="numero" value="{{$pagare->id}}" class="form-control" /></div>
    </div>
    <div class="form-group">
      <div class="col-md-3">Moneda</div>
      <div class="col-md-2">
        <select name="moneda" class="form-control">
          <option value="UF"
            @if (strtolower($pagare->moneda()->descripcion) == 'uf')
              selected="selected"
            @endif
          >UF</option>
          <option value="Pesos"
            @if (strtolower($pagare->moneda()->descripcion) == 'pesos')
              selected="selected"
            @endif
          >Pesos</option>
        </select>
      </div>
    </div>
    <div class="form-group">
      <div class="col-md-3">Capital</div>
      <div class="col-md-3"><input type="text" name="capital" value="{{$pagare->capital}}" class="form-control" /></div>
    </div>
    <div class="form-group">
      <div class="col-md-3">Tasa [%]</div>
      <div class="col-md-1"><input type="text" name="tasa" value="{{$pagare->tasa}}" class="form-control" /></div>
    </div>
    <div class="form-group">
      <div class="col-md-3">Fecha Otorgado</div>
      <?php $f = $pagare->fechaBanco(); $id = '_banco' ?>
      @include('form.fecha')
    </div>
    <div class="form-group">
      <div class="col-md-3">Duraci&oacute;n</div>
      <div class="col-md-1"><input type="text" name="duracion" class="form-control" value="{{$pagare->duracion}}" /></div>
    </div>
    <div class="form-group">
      <div class="col-md-3">Fecha Abonado</div>
      <?php $f = $pagare->fecha(); unset($id) ?>
      @include('form.fecha')
    </div>
    <div class="form-group">
      <div class="col-md-3">Monto Abonado [$]</div>
      <div class="col-md-3"><input type="text" name="abonado" class="form-control" value="{{$pagare->abonado}}" /></div>
    </div>
    <div class="form-group">
      <div class="col-md-offset-1 col-md-2">
        <button class="form-control">Editar</button>
      </div>
    </div>
  </form>
@endsection
