@extends('layout.base') @section('page_content')

{{$venta->proyecto()->descripcion}}
{{$venta->propiedad()->summary()}}

Cuotas - Pie

@php $now = new DateTimeImmutable(); $uf_venta = $venta->uf === 0.0 ? $UF->get($venta->currentEstado()->fecha) : $venta->uf; @endphp @foreach ($venta->formaPago()->pie->cuotas() as $cuota) @endforeach
# Fecha Fecha ISO Banco Identificador Valor Valor UF Estado Fecha Estado Fecha Estado ISO
{{$cuota->numero}} {{$cuota->pago->fecha->format('d-m-Y')}} {{$cuota->pago->fecha->format('Y-m-d')}} {{$cuota->pago->banco->nombre}} {{$cuota->pago->identificador}} {{$format->pesos($cuota->pago->valor)}} @if ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'abonado' and $cuota->pago->currentEstado->fecha <= $now) {{$format->ufs($cuota->pago->valor())}} @endif pago->currentEstado->tipoEstadoPago->descripcion === 'abonado') class="green" @elseif ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'depositado') class="yellow" @elseif ($cuota->pago->currentEstado->tipoEstadoPago->activo !== 1) class="red" @endif >{{ucwords($cuota->pago->currentEstado->tipoEstadoPago->descripcion)}} @if ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'abonado') {{$cuota->pago->currentEstado->fecha->format('d-m-Y')}} @else
@if ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'depositado') @endif
@endif
{{$cuota->pago->currentEstado->fecha->format('Y-m-d')}}
TOTAL {{$format->pesos($total_pesos = array_reduce($venta->formaPago()->pie->cuotas(), function(float $sum, Incoviba\Model\Venta\Cuota $cuota) { return $sum + $cuota->pago->valor; }, 0))}} {{$format->ufs($total = array_reduce($venta->formaPago()->pie->cuotas(), function(float $sum, Incoviba\Model\Venta\Cuota $cuota) use ($now, $uf_venta) { return $sum + (($cuota->pago->fecha > $now or $cuota->pago->uf === null) ? $cuota->pago->valor / $uf_venta : $cuota->pago->valor()); }, 0.0))}}
TOTAL PAGADO {{$format->pesos($pagado_pesos = array_reduce($venta->formaPago()->pie->cuotas(true), function(int $sum, Incoviba\Model\Venta\Cuota $cuota) { return $sum + $cuota->pago->valor; }, 0))}} {{$format->ufs($pagado = array_reduce($venta->formaPago()->pie->cuotas(true), function(float $sum, Incoviba\Model\Venta\Cuota $cuota) { return $sum + $cuota->pago->valor(); }, 0.0))}} {{$format->number($pagado / $total * 100, 2)}}%
POR PAGAR {{$format->pesos($total_pesos - $pagado_pesos)}} {{$format->ufs($total - $pagado)}} {{$format->number(($total - $pagado) / $total * 100, 2)}}%
@endsection @include('layout.body.scripts.datatables') @push('page_scripts') @endpush