60 lines
2.3 KiB
PHP
60 lines
2.3 KiB
PHP
@extends('layout.base')
|
|
|
|
@section('content')
|
|
<h2>Consolidación de Ventas - {{$ventas[0]->proyecto()->descripcion}} <a href="{{url('', ['p' => 'informes', 'a' => 'consolidacion', 'proyecto' => get('proyecto')])}}">Excel</a></h2>
|
|
<h3>{{strftime('%d de %B de %Y', $f->timestamp)}}</h3>
|
|
<br />
|
|
@foreach ($ventas as $venta)
|
|
<h4><a href="{{url('', ['p' => 'ventas', 'a' => 'show', 'venta' => $venta->id])}}">Departamento {{$venta->unidad()->descripcion}} ({{format('ufs', $venta->valor_uf)}} UF)</a></h4>
|
|
<?php $sum = 0; $debe = 0; $haber = 0; $ufs = 0 ?>
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Fecha</th>
|
|
<th>Glosa</th>
|
|
<th>Debe</th>
|
|
<th>Haber</th>
|
|
<th>Saldo</th>
|
|
<th>Comentario</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@if ($venta->pie != 0)
|
|
@foreach ($venta->pie()->cuotas() as $cuota)
|
|
<?php $glosa = 'Pie - Cuota ' . $cuota->numero() . ' - ' . $venta->pie()->cuotas; $pago = $cuota->pago() ?>
|
|
<?php $debe += $pago->valor(); $ufs += $pago->valor('ufs'); $sum += $pago->valor() ?>
|
|
@include('ventas.consolidacion.pago')
|
|
@endforeach
|
|
@if ($venta->pie()->reajuste != 0)
|
|
<?php $glosa = 'Reajuste'; $pago = $venta->pie()->reajuste() ?>
|
|
<?php $debe += $pago->valor(); $ufs += $pago->valor('ufs'); $sum += $pago->valor() ?>
|
|
@include('ventas.consolidacion.pago')
|
|
@endif
|
|
@endif
|
|
@if ($venta->escritura != 0)
|
|
<?php $glosa = 'Abono Escritura'; $pago = $venta->escritura()->pago() ?>
|
|
<?php $debe += $pago->valor(); $ufs += $pago->valor('ufs'); $sum += $pago->valor() ?>
|
|
@include('ventas.consolidacion.pago')
|
|
@endif
|
|
@if ($venta->credito != 0)
|
|
<?php $glosa = 'Crédito'; $pago = $venta->credito()->pago() ?>
|
|
<?php $debe += $pago->valor(); $ufs += $pago->valor('ufs'); $sum += $pago->valor() ?>
|
|
@include('ventas.consolidacion.pago')
|
|
@endif
|
|
@if ($venta->devolucion != 0)
|
|
<?php $glosa = 'Devolución'; $pago = $venta->devolucion() ?>
|
|
<?php $haber += $pago->valor(); $ufs -= $pago->valor('ufs'); $sum -= $pago->valor() ?>
|
|
@include('ventas.consolidacion.pago')
|
|
@endif
|
|
<tr>
|
|
<td></td>
|
|
<td class="text-bold">TOTAL ({{format('ufs', $ufs)}} UF)</td>
|
|
<td class="text-bold text-right">$ {{format('pesos', $debe)}}</td>
|
|
<td class="text-bold text-right">$ {{format('pesos', $haber)}}</td>
|
|
<td class="text-bold text-right">$ {{format('pesos', $sum)}}</td>
|
|
<td class="text-bold"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
@endforeach
|
|
@endsection
|