2 Commits

Author SHA1 Message Date
43bb7a83c8 FIX: tesoreria no cargaba datos 2024-07-25 12:52:48 -04:00
081187e3d3 Mensaje de error 2024-07-25 12:51:25 -04:00
4 changed files with 56 additions and 28 deletions

View File

@ -10,5 +10,23 @@
<i class="hammer icon"></i>
Esta parte del sitio está en construcción.
</div>
@if (isset($exception))
<div class="ui warning message">
<i class="exclamation triangle icon"></i>
<div class="content">
<div class="header">Error</div>
<p>{{$message}}</p>
</div>
</div>
@endif
@if (isset($error))
<div class="ui error message">
<i class="exclamation triangle icon"></i>
<div class="content">
<div class="header">Error</div>
<p>{{$message}}</p>
</div>
</div>
@endif
</div>
@endsection

View File

@ -2,7 +2,7 @@
@push('page_styles')
<style>
tr.bold>th {
tr.bold > th {
font-weight: bold !important;
}
</style>
@ -14,9 +14,10 @@
<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;">
<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>
Descargar en Excel <i class="file excel icon"></i>
</div>
</a>
</div>
@ -83,27 +84,31 @@
</tr>
</thead>
<tbody>
@foreach ($informes['inmobiliarias'] as $inmobiliaria_rut => $informe)
@foreach ($informes['sociedades'] as $sociedad_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>
<tr>
@if ($i === 0)
<td rowspan="{{count($informe->cuentas)}}">{{$informe->sociedad->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>
@ -146,7 +151,7 @@
@foreach ($movimientos as $ms)
@foreach ($ms as $movimiento)
<tr>
<td >{{$movimiento->cuenta->inmobiliaria->razon}}</td>
<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>
@ -165,7 +170,7 @@
</tr>
@foreach ($movimientos as $movimiento)
<tr>
<td >{{$movimiento->cuenta->inmobiliaria->razon}}</td>
<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>

View File

@ -3,14 +3,14 @@ namespace Incoviba\Controller;
use DateInterval;
use DateTimeImmutable;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Incoviba\Common\Alias\View;
use Incoviba\Common\Ideal\Controller;
use Incoviba\Common\Implement\Exception\{EmptyRedis, EmptyResult};
use Incoviba\Model;
use Incoviba\Repository;
use Incoviba\Service;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
class Contabilidad extends Controller
{

View File

@ -15,17 +15,22 @@ class Errors
public function __construct(protected LoggerInterface $logger, protected ResponseFactoryInterface $responseFactory, protected View $view) {}
public function __invoke(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$output = [];
try {
return $handler->handle($request);
} catch (Exception $exception) {
$output['message'] = $exception->getMessage();
$output['exception'] = $exception;
$this->logger->warning($exception);
} catch (Error $error) {
$output['message'] = $error->getMessage();
$output['error'] = $error;
$this->logger->error($error);
}
$response = $this->responseFactory->createResponse(500, 'Internal Server Error');
if (str_contains($request->getUri()->getPath(), '/api')) {
return $response;
}
return $this->view->render($response, 'construccion');
return $this->view->render($response, 'construccion', $output);
}
}