Compare commits
5 Commits
a8325c3310
...
8be085222a
Author | SHA1 | Date | |
---|---|---|---|
8be085222a | |||
d1e4314b35 | |||
7d04b406ab | |||
972e57b6f1 | |||
5f63bdbf4a |
14
app/resources/views/not_allowed.blade.php
Normal file
14
app/resources/views/not_allowed.blade.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
@extends('layout.base')
|
||||||
|
|
||||||
|
@section('page_title')
|
||||||
|
405 - Método No Permitido
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('page_content')
|
||||||
|
<div class="ui container">
|
||||||
|
<div class="ui message">
|
||||||
|
<i class="exclamation triangle icon"></i>
|
||||||
|
No se ha encontrado la página solicitada para el método solicitado.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
@ -785,7 +785,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
$('#fecha_venta_calendar').calendar(calendar_date_options)
|
const cdo = structuredClone(calendar_date_options)
|
||||||
|
cdo['maxDate'] = new Date()
|
||||||
|
$('#fecha_venta_calendar').calendar(cdo)
|
||||||
new Propietario({id: '#propietario', id_tipo: 'persona_propietario', id_cantidad: 'cantidad_propietario'})
|
new Propietario({id: '#propietario', id_tipo: 'persona_propietario', id_cantidad: 'cantidad_propietario'})
|
||||||
new Proyecto({unidades_id: '#unidades', proyecto_id: '#proyecto'})
|
new Proyecto({unidades_id: '#unidades', proyecto_id: '#proyecto'})
|
||||||
|
|
||||||
|
@ -61,6 +61,9 @@
|
|||||||
<tbody>@php
|
<tbody>@php
|
||||||
$now = new DateTimeImmutable();
|
$now = new DateTimeImmutable();
|
||||||
$uf_venta = $venta->uf === 0.0 ? $UF->get($venta->currentEstado()->fecha) : $venta->uf;
|
$uf_venta = $venta->uf === 0.0 ? $UF->get($venta->currentEstado()->fecha) : $venta->uf;
|
||||||
|
if ($uf_venta === 0.0) {
|
||||||
|
$uf_venta = $UF->get();
|
||||||
|
}
|
||||||
@endphp
|
@endphp
|
||||||
@foreach ($venta->formaPago()->pie->cuotas() as $cuota)
|
@foreach ($venta->formaPago()->pie->cuotas() as $cuota)
|
||||||
<tr data-pago="{{$cuota->pago->id}}"
|
<tr data-pago="{{$cuota->pago->id}}"
|
||||||
|
@ -5,18 +5,25 @@ use Psr\Http\Message\ResponseFactoryInterface;
|
|||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
use Psr\Http\Server\RequestHandlerInterface;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
use Slim\Exception\HttpMethodNotAllowedException;
|
use Slim\Exception\HttpMethodNotAllowedException;
|
||||||
|
use Incoviba\Common\Alias\View;
|
||||||
|
|
||||||
class NotAllowed
|
class NotAllowed
|
||||||
{
|
{
|
||||||
public function __construct(protected ResponseFactoryInterface $responseFactory) {}
|
public function __construct(protected LoggerInterface $logger, protected ResponseFactoryInterface $responseFactory,
|
||||||
|
protected View $view) {}
|
||||||
|
|
||||||
public function __invoke(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
public function __invoke(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return $handler->handle($request);
|
return $handler->handle($request);
|
||||||
} catch (HttpMethodNotAllowedException) {
|
} catch (HttpMethodNotAllowedException) {
|
||||||
return $this->responseFactory->createResponse(405, 'Method Not Allowed');
|
$response = $this->responseFactory->createResponse(405, 'Method Not Allowed');
|
||||||
|
if (str_contains($request->getUri()->getPath(), '/api')) {
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
return $this->view->render($response, 'not_allowed');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,17 +8,21 @@ use Psr\Http\Server\RequestHandlerInterface;
|
|||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Slim\Exception\HttpNotFoundException;
|
use Slim\Exception\HttpNotFoundException;
|
||||||
use Incoviba\Common\Alias\View;
|
use Incoviba\Common\Alias\View;
|
||||||
|
use Incoviba\Common\Implement\Exception\{EmptyRedis,EmptyResult};
|
||||||
|
use Incoviba\Exception\ServiceAction\{Create, Delete, Read, Update};
|
||||||
|
|
||||||
class NotFound
|
class NotFound
|
||||||
{
|
{
|
||||||
public function __construct(protected LoggerInterface $logger, protected ResponseFactoryInterface $responseFactory, protected View $view) {}
|
public function __construct(protected LoggerInterface $logger, protected ResponseFactoryInterface $responseFactory,
|
||||||
|
protected View $view) {}
|
||||||
public function __invoke(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
public function __invoke(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return $handler->handle($request);
|
return $handler->handle($request);
|
||||||
} catch (HttpNotFoundException $exception) {
|
} catch (HttpNotFoundException |
|
||||||
|
EmptyRedis | EmptyResult | Read | Create | Update | Delete $exception) {
|
||||||
$this->logger->notice($exception);
|
$this->logger->notice($exception);
|
||||||
$response = $this->responseFactory->createResponse(404);
|
$response = $this->responseFactory->createResponse(404, 'Not Found');
|
||||||
if (str_contains($request->getUri()->getPath(), '/api')) {
|
if (str_contains($request->getUri()->getPath(), '/api')) {
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
@ -33,11 +33,12 @@ class Money
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function getUF(DateTimeInterface $dateTime): float
|
public function getUF(?DateTimeInterface $dateTime = null): float
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return $this->getProvider('uf')->get(MiIndicador::UF, $dateTime);
|
return $this->getProvider('uf')->get(MiIndicador::UF, $dateTime);
|
||||||
} catch (EmptyResponse) {
|
} catch (EmptyResponse $exception) {
|
||||||
|
$this->logger->debug($exception);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,9 +18,12 @@ class MiIndicador implements Provider
|
|||||||
/**
|
/**
|
||||||
* @throws EmptyResponse
|
* @throws EmptyResponse
|
||||||
*/
|
*/
|
||||||
public function get(string $money_symbol, DateTimeInterface $dateTime): float
|
public function get(string $money_symbol, ?DateTimeInterface $dateTime = null): float
|
||||||
{
|
{
|
||||||
$request_uri = "{$money_symbol}/{$dateTime->format('d-m-Y')}";
|
$request_uri = "{$money_symbol}";
|
||||||
|
if ($dateTime !== null) {
|
||||||
|
$request_uri = "{$money_symbol}/{$dateTime->format('d-m-Y')}";
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
$response = $this->client->get($request_uri);
|
$response = $this->client->get($request_uri);
|
||||||
} catch (GuzzleException) {
|
} catch (GuzzleException) {
|
||||||
|
@ -76,7 +76,6 @@ class UF
|
|||||||
$uf = $this->get($date);
|
$uf = $this->get($date);
|
||||||
return $input * (($from === 'uf') ? $uf : 1/$uf);
|
return $input * (($from === 'uf') ? $uf : 1/$uf);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected array $redisUFs;
|
protected array $redisUFs;
|
||||||
public function getRedisUFs(): array
|
public function getRedisUFs(): array
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user