Files
oficial/app/resources/views/contabilidad/informes/tesoreria.blade.php
2024-02-23 22:37:09 -03:00

157 lines
7.1 KiB
PHP

@extends('layout.base')
@section('page_content')
<div class="ui container">
<h1 class="ui centered header">Informe de Tesorería</h1>
<h4 class="ui centered sub header">{{$fecha->format('d M Y')}}</h4>
<div class="ui grid">
<div class="three wide column">
<a href="/contabilidad/informes/xlsx/tesoreria/{{$fecha->format('Y-m-d')}}" target="_blank" style="color: inherit;">
<div class="ui inverted green center aligned segment">
Descargar en Excel <i class="file excel icon"></i>
</div>
</a>
</div>
</div>
</div>
<div class="ui grid">
<div class="four wide column">
<table class="ui collapsing simple table">
<tr>
<td>Informe anterior</td>
<td>{{$anterior->format('d/m/Y')}}</td>
</tr>
<tr>
<td>Informe actual</td>
<td>{{$fecha->format('d/m/Y')}}</td>
</tr>
</table>
</div>
<div class="column"></div>
<div class="four wide column">
<table class="ui collapsing simple table">
<tr>
<td>Valor UF</td>
<td class="right aligned">{{$format->pesos($UF->get($fecha), 2)}}</td>
</tr>
<tr>
<td>Valor Dólar</td>
<td class="right aligned">{{$format->pesos($USD->get($fecha), 2)}}</td>
</tr>
</table>
</div>
</div>
<table class="ui striped table">
<thead>
<tr>
<th>EMPRESA</th>
<th>Banco</th>
<th>Cuenta</th>
<th class="right aligned">Saldo Anterior</th>
<th class="right aligned">Saldo Actual</th>
<th class="right aligned">Diferencia</th>
<th class="right aligned">FFMM</th>
<th class="right aligned">DAP</th>
<th class="right aligned">Saldo Empresa</th>
<th class="right aligned">Total Cuentas</th>
<th class="right aligned">Total FFMM</th>
<th class="right aligned">Total DAP</th>
<th class="right aligned">Caja Total</th>
</tr>
</thead>
<tbody>
@foreach ($informes['inmobiliarias'] as $inmobiliaria_rut => $informe)
@foreach ($informe->cuentas as $i => $cuenta)
<tr>
@if ($i === 0)
<td rowspan="{{count($informe->cuentas)}}">{{$informe->inmobiliaria->razon}}</td>
@endif
<td>{{$cuenta->banco}}</td>
<td>{{$cuenta->numero}}</td>
<td class="right aligned">{{$format->pesos($cuenta->anterior)}}</td>
<td class="right aligned">{{$format->pesos($cuenta->actual)}}</td>
<td class="right aligned">{{$format->pesos($cuenta->diferencia())}}</td>
<td class="right aligned">{{$format->pesos($cuenta->ffmm)}}</td>
<td class="right aligned">{{$format->pesos($cuenta->deposito)}}</td>
<td class="right aligned">{{$format->pesos($cuenta->saldo())}}</td>
@if ($i === 0)
<td class="right aligned" rowspan="{{count($informe->cuentas)}}">{{$format->pesos($informe->total())}}</td>
<td class="right aligned" rowspan="{{count($informe->cuentas)}}">{{$format->pesos($informe->ffmm())}}</td>
<td class="right aligned" rowspan="{{count($informe->cuentas)}}">{{$format->pesos($informe->deposito())}}</td>
<td class="right aligned" rowspan="{{count($informe->cuentas)}}">{{$format->pesos($informe->caja())}}</td>
@endif
</tr>
@endforeach
@endforeach
</tbody>
<tfoot>
<tr class="bold">
<th colspan="3">TOTAL</th>
<th class="right aligned">{{$format->pesos($informes['totales']->anterior)}}</th>
<th class="right aligned">{{$format->pesos($informes['totales']->actual)}}</th>
<th class="right aligned">{{$format->pesos($informes['totales']->diferencia())}}</th>
<th class="right aligned">{{$format->pesos($informes['totales']->ffmm)}}</th>
<th class="right aligned">{{$format->pesos($informes['totales']->deposito)}}</th>
<th class="right aligned">{{$format->pesos($informes['totales']->saldo())}}</th>
<th class="right aligned">{{$format->pesos($informes['totales']->cuentas())}}</th>
<th class="right aligned">{{$format->pesos($informes['totales']->ffmms())}}</th>
<th class="right aligned">{{$format->pesos($informes['totales']->depositos())}}</th>
<th class="right aligned">{{$format->pesos($informes['totales']->caja())}}</th>
</tr>
</tfoot>
</table>
<table class="ui table">
<thead>
<tr>
<th>EMPRESA</th>
<th class="right aligned">INGRESOS</th>
<th class="right aligned">EGRESOS</th>
<th>FECHA</th>
<th>BANCO</th>
<th>DESCRIPCIÓN</th>
</tr>
</thead>
<tbody>
@foreach ($informes['movimientos'] as $tipo => $movimientos)
@if ($tipo === 'capital dap')
@if (count($movimientos['ingresos']) === 0 and count($movimientos['egresos']) === 0)
@continue
@endif
<tr class="grey">
<td colspan="6">{{strtoupper($tipo)}}</td>
</tr>
@foreach ($movimientos as $ms)
@foreach ($ms as $movimiento)
<tr>
<td >{{$movimiento->cuenta->inmobiliaria->razon}}</td>
<td class="right aligned">{{$format->pesos($movimiento->abono)}}</td>
<td class="right aligned">{{$format->pesos($movimiento->cargo)}}</td>
<td>{{$movimiento->fecha->format('d/m/Y')}}</td>
<td>{{$movimiento->cuenta->banco->nombre}}</td>
<td>{{$movimiento->glosa}}</td>
</tr>
@endforeach
@endforeach
@continue
@endif
@if (count($movimientos) === 0)
@continue
@endif
<tr class="grey">
<td colspan="6">{{strtoupper($tipo)}}</td>
</tr>
@foreach ($movimientos as $movimiento)
<tr>
<td >{{$movimiento->cuenta->inmobiliaria->razon}}</td>
<td class="right aligned">{{$format->pesos($movimiento->abono)}}</td>
<td class="red right aligned">{{$format->pesos($movimiento->cargo)}}</td>
<td>{{$movimiento->fecha->format('d/m/Y')}}</td>
<td>{{$movimiento->cuenta->banco->nombre}}</td>
<td>{{$movimiento->glosa}}</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
@endsection