@extends('ventas.base') @section('venta_subtitle') Cuotas - Pie @endsection @push('page_scripts') @endpush @section('venta_content') @if (count($asociadas) > 0)
Asociados
{!! implode(' - ', array_map(function(Incoviba\Model\Venta $venta) use ($urls) { return "base}/venta/{$venta->id}\">{$venta->propiedad()->departamentos()[0]->descripcion}"; }, $asociadas)) !!}
@if ($venta->formaPago()->pie->asociado !== null)
* Este pie no es la base para el cálculo de las cuotas
@endif
@endif
Valor
{{$format->ufs($venta->formaPago()->pie->valor)}} @if (count($asociadas) > 0) [{{$format->ufs($venta->formaPago()->pie->valor + array_reduce($asociadas, function(float $sum, Incoviba\Model\Venta $venta) { return $sum + $venta->formaPago()->pie->valor; }, 0.0))}}] @endif
Cuotas
{{$venta->formaPago()->pie->cuotas}}
@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) pago->currentEstado->tipoEstadoPago->descripcion, ['anulado', 'reemplazado'])) class="disabled" @endif > pago->currentEstado->tipoEstadoPago->descripcion === 'abonado' ? ' class="green"' : ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'depositado' ? ' class="yellow"' : ($cuota->pago->currentEstado->tipoEstadoPago->activo !== 1 ? ' class="red"' : ''))) !!}> {{ucwords($cuota->pago->currentEstado->tipoEstadoPago->descripcion)}} @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 (in_array($cuota->pago->currentEstado->tipoEstadoPago->descripcion, ['depositado', 'abonado']) and $cuota->pago->currentEstado->fecha <= $now) {{$format->ufs($cuota->pago->valor())}} @else ~{{$format->ufs($cuota->pago->valor / $uf_venta)}} @endif @if (in_array($cuota->pago->currentEstado->tipoEstadoPago->descripcion, ['abonado', 'anulado', 'reemplazado'])) {{$cuota->pago->currentEstado->fecha->format('d-m-Y')}} @elseif (!in_array($cuota->pago->currentEstado->tipoEstadoPago->descripcion, ['anulado', 'reemplazado'])) @if ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'depositado') {{$cuota->pago->currentEstado->fecha->format('d-m-Y')}} @endif
@if ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'depositado') @endif
@endif
{{$cuota->pago->currentEstado->fecha->format('Y-m-d')}} @if ($cuota->pago->currentEstado->tipoEstadoPago->descripcion !== 'anulado') @endif
TOTAL {{$format->pesos($total_pesos = array_reduce($venta->formaPago()->pie->cuotas(vigentes: true), function(int $sum, Incoviba\Model\Venta\Cuota $cuota) { return $sum + $cuota->pago->valor; }, 0))}} {{$format->ufs($total = array_reduce($venta->formaPago()->pie->cuotas(vigentes: true), 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(pagadas: true, vigentes: true), function(int $sum, Incoviba\Model\Venta\Cuota $cuota) { return $sum + $cuota->pago->valor; }, 0))}} {{$format->ufs($pagado = array_reduce($venta->formaPago()->pie->cuotas(pagadas: true, vigentes: true), function(float $sum, Incoviba\Model\Venta\Cuota $cuota) { return $sum + $cuota->pago->valor(); }, 0.0))}} {{$format->number(($total > 0) ? $pagado / $total * 100 : 0, 2)}}%
POR PAGAR {{$format->pesos($total_pesos - $pagado_pesos)}} {{$format->ufs($total - $pagado)}} {{$format->percent(($total > 0) ? ($total - $pagado) / $total * 100 : 0, 2)}}*
* Porcentaje calculado sobre el valor de la venta
@include('ventas.pies.cuotas.edit') @endsection @include('layout.head.styles.datatables') @include('layout.head.styles.datatables.buttons') @include('layout.body.scripts.datatables') @include('layout.body.scripts.datatables.buttons') @push('page_scripts') @endpush