2 Commits

Author SHA1 Message Date
1e2bd617fa FIX: Fecha comparación para terreno 2024-11-20 12:19:04 -03:00
62e7001fba FIX: Problemas de curl 2024-11-20 11:51:06 -03:00
2 changed files with 2 additions and 13 deletions

View File

@ -69,18 +69,7 @@ return [
$container->get(Psr\Log\LoggerInterface::class), $container->get(Psr\Log\LoggerInterface::class),
$container->get(Incoviba\Repository\Contabilidad\Nubox::class), $container->get(Incoviba\Repository\Contabilidad\Nubox::class),
$container->get(Incoviba\Service\Redis::class), $container->get(Incoviba\Service\Redis::class),
new GuzzleHttp\Client([ new GuzzleHttp\Client(),
'defaults' => [
'config' => [
'curl' => [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false
]
]
]
]),
$container->get(Psr\Http\Message\RequestFactoryInterface::class), $container->get(Psr\Http\Message\RequestFactoryInterface::class),
$container->get('nubox')->get('url')); $container->get('nubox')->get('url'));
}, },

View File

@ -33,7 +33,7 @@ class Terreno extends Ideal\Service
try { try {
$proyecto = $this->proyectoRepository->fetchById($proyecto_id); $proyecto = $this->proyectoRepository->fetchById($proyecto_id);
$today = new DateTimeImmutable(); $today = new DateTimeImmutable();
$lastDecember = (new DateTimeImmutable($today->format('Y-01-01'))); $lastDecember = (new DateTimeImmutable($today->format('Y-01-01')))->sub(new DateInterval('P1M'));
if ($proyecto->terreno->fecha >= $lastDecember) { if ($proyecto->terreno->fecha >= $lastDecember) {
return $proyecto->terreno; return $proyecto->terreno;
} }