Implemented repository mapper, and venta show

This commit is contained in:
Juan Pablo Vial
2023-08-08 23:53:49 -04:00
parent ef30ae67d2
commit 59825259b6
111 changed files with 2766 additions and 612 deletions

View File

@ -0,0 +1,7 @@
<tr>
<td><strong>Anticipo</strong></td>
<td></td>
<td class="right aligned"><strong>{{$format->ufs($anticipo['uf'])}}</strong></td>
<td class="right aligned"><strong>{{$format->pesos($anticipo['pesos'])}}</strong></td>
<td colspan="2"></td>
</tr>

View File

@ -0,0 +1,22 @@
<tr>
<td>
Bono Pie
@if ($bonoPie !== null)
<a href="{{$urls->base}}/venta/{{$venta->id}}/bono_pie">
<i class="edit button"></i>
</a>
@else
<a href="{{$urls->base}}/venta/{{$venta->id}}/bono_pie/add">
<i class="add icon"></i>
</a>
@endif
</td>
@if ($bonoPie !== null)
<td></td>
<td class="right aligned">{{$format->ufs($bonoPie->pago->valor())}}</td>
<td class="right aligned">{{$format->pesos($bonoPie->pago->valor)}}</td>
<td colspan="2"></td>
@else
<td colspan="5"></td>
@endif
</tr>

View File

@ -0,0 +1,40 @@
<tr>
<td>
Crédito
@if ($credito !== null)
<a href="{{$urls->base}}/venta/{{$venta->id}}/credito">
<i class="edit icon"></i>
</a>
@else
<a href="{{$urls->base}}/venta/{{$venta->id}}/credito/add">
<i class="plus icon"></i>
</a>
@endif
</td>
@if ($credito !== null)
<td></td>
<td class="right aligned">
{{$format->ufs($credito->pago->valor())}}
</td>
<td class="right aligned">
{{$format->pesos($credito->pago->valor)}}
</td>
<td id="credito_pago" class="{{$credito->pago->currentEstado->tipoEstadoPago->descripcion === 'no pagado' ? 'warning' : ($credito->pago->currentEstado->tipoEstado->descripcion === 'depositado' ? 'positive' : '')}}">
<span class="text">{{$credito->pago->currentEstado->fecha->format('d-m-Y')}}</span>
@if ($credito->pago->currentEstado->tipoEstadoPago->descripcion === 'no pagado')
<a href="javascript: depositar({row_id: '#credito_pago', pago_id: {{$credito->pago->id}}});" title="Depositar">
<i class="dollar sign icon"></i>
</a>
@elseif($credito->pago->currentEstado->tipoEstadoPago->descripcion === 'depositado')
<a href="javascript: abonar({row_id: '#credito_pago', pago_id: {{$credito->pago->id}}});" title="Abonar">
<i class="piggy bank icon"></i>
</a>
@endif
</td>
<td>
Banco: {{$credito->pago->banco?->nombre}}
</td>
@else
<td colspan="5"></td>
@endif
</tr>

View File

@ -0,0 +1,34 @@
<tr>
<td>
Escritura
@if ($escritura !== null)
<a href="{{$urls->base}}/venta/{{$venta->id}}/escritura">
<i class="edit icon"></i>
</a>
@else
<a href="{{$urls->base}}/venta/{{$venta->id}}/escritura/add">
<i class="plus icon"></i>
</a>
@endif
</td>
@if ($escritura !== null)
<td></td>
<td class="right aligned">{{$format->ufs($escritura->pago->valor())}}</td>
<td class="right aligned">{{$format->pesos($escritura->pago->valor)}}</td>
<td id="escritura_pago" class="{{$escritura->pago->currentEstado->tipoEstadoPago->descripcion === 'no pagado' ? 'warning' : ($escritura->pago->currentEstado->tipoEstadoPago->descripcion === 'depositado' ? 'positive' : '')}}">
<span class="text">{{$escritura->pago->currentEstado->fecha->format('d-m-Y')}}</span>
@if ($escritura->pago->currentEstado->tipoEstadoPago->descripcion === 'no pagado')
<a href="javascript: depositar({row_id: '#escritura_pago', pago_id: {{$escritura->pago->id}}});" title="Depositar">
<i class="dollar sign icon"></i>
</a>
@elseif ($escritura->pago->currentEstado->tipoEstadoPago->descripcion === 'depositado')
<a href="javascript: abonar({row_id: '#escritura_pago', pago_id: {{$escritura->pago->id}}});" title="Abonar">
<i clasS="piggy bank icon"></i>
</a>
@endif
</td>
<td></td>
@else
<td colspan="5"></td>
@endif
</tr>

View File

@ -0,0 +1,31 @@
@if ($pie !== null)
<tr>
<td>
Pie
<a href="{{$urls->base}}/venta/{{$venta->id}}/pie">
<i class="edit icon"></i>
</a>
</td>
<td></td>
<td class="right aligned">{{$format->ufs($pie->valor)}}</td>
<td class="right aligned">{{$format->pesos($pie->valor * $pie->uf)}}</td>
<td class="right aligned">Cuotas</td>
<td>
<a href="{{$urls->base}}/venta/{{$venta->id}}/pie/cuotas">
{{count($pie->cuotas(true))}}/{{$pie->cuotas}}
</a>
@if (count($pie->cuotas()) < $pie->cuotas)
<a href="{{$urls->base}}/ventas/pie/{{$pie->id}}/cuotas/add">
<i class="plus icon"></i>
</a>
@endif
</td>
</tr>
<tr>
<td>Pagado</td>
<td></td>
<td class="right aligned">{{$format->ufs($pie->pagado())}}</td>
<td class="right aligned">{{$format->pesos($pie->pagado('pesos'))}}</td>
<td colspan="2"></td>
</tr>
@endif

View File

@ -0,0 +1,32 @@
<tr>
<td
@if ($subsidio !== null)
rowspan="2"
@endif
>
Subsidio
@if ($subsidio !== null)
<a href="{{$urls->base}}/venta/{{$venta->id}}/subsidio">
<i class="edit icon"></i>
</a>
@else
<a href="{{$urls->base}}/venta/{{$venta->id}}/subsidio/add">
<i class="plus icon"></i>
</a>
@endif
</td>
@if ($subsidio !== null)
<td>Ahorro</td>
<td class="right aligned">{{$format->ufs($subsidio->ahorro->valor())}}</td>
<td class="right aligned">{{$format->pesos($subsidio->ahorro->valor)}}</td>
<td colspan="2"></td>
</tr>
<tr>
<td>Subsidio</td>
<td class="right aligned">{{$format->ufs($subsidio->ahorro->valor())}}</td>
<td class="right aligned">{{$format->pesos($subsidio->ahorro->valor)}}</td>
<td colspan="2"></td>
@else
<td colspan="5"></td>
@endif
</tr>

View File

@ -0,0 +1,28 @@
<tr class="{{$venta->saldo() < 0 ? 'positive' : ($venta->saldo() > 0 ? 'error' : '')}}">
<td>
<strong>
Total
</strong>
</td>
<td></td>
<td class="right aligned">
<strong>
{{$format->ufs($formaPago->total())}}
</strong>
</td>
<td class="right aligned">
<strong>
{{$format->pesos($formaPago->total('pesos'))}}
</strong>
</td>
<td class="right aligned" >
@if ($venta->saldo() / $venta->valor > 0.01)
<strong>
&Delta;
{{$format->ufs($venta->saldo())}}
({{$format->number($venta->saldo() / $venta->valor * 100, 2)}} %)
</strong>
@endif
</td>
<td></td>
</tr>