ventas.base

This commit is contained in:
2024-01-18 17:15:32 -03:00
parent ca83472012
commit f55e4dbd5f
11 changed files with 679 additions and 651 deletions

View File

@ -1,91 +1,88 @@
@extends('layout.base')
@extends('ventas.base')
@section('page_content')
<div class="ui container">
<h1 class="ui header">
Escritura -
{{$venta->proyecto()->descripcion}} -
<a href="{{$urls->base}}/venta/{{$venta->id}}">{{$venta->propiedad()->summary()}}</a>
</h1>
<div class="ui segment">
El departamento {{$venta->propiedad()->departamentos()[0]->descripcion}}:<br />
@php
$estacionamientos = $venta->propiedad()->estacionamientos();
@endphp
@if (count($estacionamientos) === 0)
no tiene estacionamientos
@else
tiene
{{count($estacionamientos) === 1 ? 'el' : 'los'}}
estacionamiento{{count($estacionamientos) === 1 ? '': 's'}}
{{implode(', ', array_map(function(Incoviba\Model\Venta\Unidad $unidad) {
return $unidad->descripcion;
}, $estacionamientos))}}
@endif
y
@php
$bodegas = $venta->propiedad()->bodegas();
@endphp
@if (count($bodegas) === 0)
no tiene bodegas
@else
tiene
{{count($bodegas) === 1 ? 'la' : 'las'}}
bodega{{count($bodegas) === 1 ? '' : 's'}}
{{implode(', ', array_map(function(Incoviba\Model\Venta\Unidad $unidad) {
return $unidad->descripcion;
}, $bodegas))}}
@endif
@section('venta_subtitle')
Resumen Escritura
@endsection
@section('venta_content')
<div class="ui segment">
El departamento {{$venta->propiedad()->departamentos()[0]->descripcion}}:<br />
@php
$estacionamientos = $venta->propiedad()->estacionamientos();
@endphp
@if (count($estacionamientos) === 0)
no tiene estacionamientos
@else
tiene
{{count($estacionamientos) === 1 ? 'el' : 'los'}}
estacionamiento{{count($estacionamientos) === 1 ? '': 's'}}
{{implode(', ', array_map(function(Incoviba\Model\Venta\Unidad $unidad) {
return $unidad->descripcion;
}, $estacionamientos))}}
@endif
y
@php
$bodegas = $venta->propiedad()->bodegas();
@endphp
@if (count($bodegas) === 0)
no tiene bodegas
@else
tiene
{{count($bodegas) === 1 ? 'la' : 'las'}}
bodega{{count($bodegas) === 1 ? '' : 's'}}
{{implode(', ', array_map(function(Incoviba\Model\Venta\Unidad $unidad) {
return $unidad->descripcion;
}, $bodegas))}}
@endif
<br />
<br />
<strong>PRECIO</strong>
{{$format->ufs($venta->valor)}}
<div class="ui fitted divider"></div>
<br />
@if (isset($venta->formaPago()->pie))
@php($pie = $venta->formaPago()->pie)
<strong>PIE</strong>
{{$pie->cuotas}} cuotas que suman
{{$format->pesos($pie->pagado('pesos'))}}
equivalente a
{{$format->ufs($pie->pagado())}}.
<br />
@endif
@if (isset($venta->formaPago()->escritura))
@php($escritura = $venta->formaPago()->escritura)
<strong>ESCRITURA</strong>
{{$format->pesos($escritura->pago->valor)}}
el
{{$escritura->fecha->format('d-m-Y')}}
equivalente a
{{$format->ufs($escritura->pago->valor())}}
<br />
@endif
<div class="ui fitted divider"></div>
<strong>TOTAL ANTICIPO</strong>
{{$format->ufs($venta->formaPago()->anticipo())}}
<br />
@if (isset($venta->formaPago()->bonoPie))
@php($bono = $venta->formaPago()->bonoPie)
<strong>BONO PIE</strong>
{{$format->ufs($bono->pago->valor())}}
<br />
@endif
@if (isset($venta->formaPago()->credito))
@php($credito = $venta->formaPago()->credito)
<strong>CRÉDITO</strong>
{{$format->ufs($credito->pago->valor())}}
en Banco {{$credito->pago->banco->nombre}}
<br />
@endif
<div class="ui fitted divider"></div>
<strong>TOTAL</strong>
{{$format->ufs($venta->formaPago()->total())}}
@if (($venta->formaPago()->total() - $venta->valor) !== 0)
<br />
<br />
<strong>PRECIO</strong>
{{$format->ufs($venta->valor)}}
<div class="ui fitted divider"></div>
<br />
@if (isset($venta->formaPago()->pie))
@php($pie = $venta->formaPago()->pie)
<strong>PIE</strong>
{{$pie->cuotas}} cuotas que suman
{{$format->pesos($pie->pagado('pesos'))}}
equivalente a
{{$format->ufs($pie->pagado())}}.
<br />
@endif
@if (isset($venta->formaPago()->escritura))
@php($escritura = $venta->formaPago()->escritura)
<strong>ESCRITURA</strong>
{{$format->pesos($escritura->pago->valor)}}
el
{{$escritura->fecha->format('d-m-Y')}}
equivalente a
{{$format->ufs($escritura->pago->valor())}}
<br />
@endif
<div class="ui fitted divider"></div>
<strong>TOTAL ANTICIPO</strong>
{{$format->ufs($venta->formaPago()->anticipo())}}
<br />
@if (isset($venta->formaPago()->bonoPie))
@php($bono = $venta->formaPago()->bonoPie)
<strong>BONO PIE</strong>
{{$format->ufs($bono->pago->valor())}}
<br />
@endif
@if (isset($venta->formaPago()->credito))
@php($credito = $venta->formaPago()->credito)
<strong>CRÉDITO</strong>
{{$format->ufs($credito->pago->valor())}}
en Banco {{$credito->pago->banco->nombre}}
<br />
@endif
<div class="ui fitted divider"></div>
<strong>TOTAL</strong>
{{$format->ufs($venta->formaPago()->total())}}
@if (($venta->formaPago()->total() - $venta->valor) !== 0)
<br />
<br />
Diferencia {{$format->ufs($venta->formaPago()->total() - $venta->valor)}}. ({{$format->percent(($venta->formaPago()->total() - $venta->valor) / $venta->valor * 100)}})
@endif
</div>
Diferencia {{$format->ufs($venta->formaPago()->total() - $venta->valor)}}. ({{$format->percent(($venta->formaPago()->total() - $venta->valor) / $venta->valor * 100)}})
@endif
</div>
@endsection

View File

@ -1,27 +1,22 @@
@extends('layout.base')
@extends('ventas.base')
@section('page_content')
<div class="ui container">
<h2 class="ui header">
Escritura -
{{$venta->proyecto()->descripcion}} -
<a href="{{$urls->base}}/venta/{{$venta->id}}">
{{$venta->propiedad()->summary()}}
</a>
</h2>
<form class="ui form" id="edit_form">
<div class="three wide field">
<label for="fecha">Fecha</label>
<div class="ui calendar" id="fecha">
<div class="ui left icon input">
<i class="calendar icon"></i>
<input type="text" placeholder="Fecha" />
</div>
@section('venta_subtitle')
Escritura
@endsection
@section('venta_content')
<form class="ui form" id="edit_form">
<div class="three wide field">
<label for="fecha">Fecha</label>
<div class="ui calendar" id="fecha">
<div class="ui left icon input">
<i class="calendar icon"></i>
<input type="text" placeholder="Fecha" />
</div>
</div>
<button class="ui button">Guardar</button>
</form>
</div>
</div>
<button class="ui button">Guardar</button>
</form>
@endsection
@push('page_scripts')