@extends('layout.base')

@section('content')
<div class="page-heading">
  <h3>Subsidio - {{$venta->proyecto()->descripcion}} - {{$venta->unidad()->descripcion}}</h3>
</div>
<br />
<form method="post" class="form-horizontal" action="{{nUrl('subsidios', 'do_edit', ['venta' => $venta->id])}}">
  <div class="form-group">
    <div class="col-md-2">Fecha</div>
    <?php $f = \Carbon\Carbon::parse($venta->subsidio()->pago()->fecha, config('app.timezone')); ?>
    @include('form.fecha')
  </div>
  <div class="row">
    <div class="col-md-offset-2 col-md-3 text-center"><b>$</b></div>
    <div class="col-md-3 text-center"><b>UF</b></div>
  </div>
  <div class="form-group">
    <div class="col-md-2">Subsidio</div>
    <div class="col-md-3"><input type="text" name="subsidio" class="form-control" value="{{round($venta->subsidio()->subsidio()->valor(), 0)}}" /></div>
    <div class="col-md-3"><input type="text" name="subsidio_uf" class="form-control" value="{{round($venta->subsidio()->subsidio()->valor('ufs'), 2)}}" /></div>
  </div>
  <div class="form-group">
    <div class="col-md-2">Ahorro</div>
    <div class="col-md-3"><input type="text" name="ahorro" class="form-control" value="{{round($venta->subsidio()->pago()->valor(), 0)}}" /></div>
    <div class="col-md-3"><input type="text" name="ahorro_uf" class="form-control" value="{{round($venta->subsidio()->pago()->valor('ufs'), 2)}}" /></div>
  </div>
  <div class="form-group">
    <div class="col-md-offset-2 col-md-2"><button type="submit" class="form-control">Editar</button></div>
  </div>
</form>
@endsection
