Mejoras en Facturacion
This commit is contained in:
@ -140,4 +140,19 @@ class Proyectos
|
||||
}
|
||||
return $this->withJson($response, $output);
|
||||
}
|
||||
public function terreno(ServerRequestInterface $request, ResponseInterface $response, Repository\Proyecto $proyectoRepository, int $proyecto_id): ResponseInterface
|
||||
{
|
||||
$body = $request->getParsedBody();
|
||||
$output = [
|
||||
'input' => $body,
|
||||
'proyecto_id' => $proyecto_id,
|
||||
'edited' => false
|
||||
];
|
||||
try {
|
||||
$proyecto = $proyectoRepository->fetchById($proyecto_id);
|
||||
$proyectoRepository->editTerreno($proyecto, $body);
|
||||
$output['edited'] = true;
|
||||
} catch (EmptyResult) {}
|
||||
return $this->withJson($response, $output);
|
||||
}
|
||||
}
|
||||
|
@ -83,4 +83,19 @@ class Unidades
|
||||
}
|
||||
return $this->withJson($response, $output);
|
||||
}
|
||||
public function prorrateo(ServerRequestInterface $request, ResponseInterface $response, Repository\Venta\Unidad $unidadRepository, int $unidad_id): ResponseInterface
|
||||
{
|
||||
$body = $request->getParsedBody();
|
||||
$output = [
|
||||
'unidad_id' => $unidad_id,
|
||||
'input' => $body,
|
||||
'edited' => false
|
||||
];
|
||||
try {
|
||||
$unidad = $unidadRepository->fetchById($unidad_id);
|
||||
$unidadRepository->editProrrateo($unidad, $body);
|
||||
$output['edited'] = true;
|
||||
} catch (EmptyResult) {}
|
||||
return $this->withJson($response, $output);
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class Proyectos
|
||||
{
|
||||
$redisKey = "proyecto:{$proyecto_id}";
|
||||
try {
|
||||
$proyecto = $proyectoService->getById($proyectoRepository->load((array) $this->fetchRedis($redisService, $redisKey)));
|
||||
$proyecto = $proyectoService->getById($this->fetchRedis($redisService, $redisKey)->id);
|
||||
} catch (EmptyRedis) {
|
||||
$proyecto = $proyectoService->getById($proyecto_id);
|
||||
$this->saveRedis($redisService, $redisKey, $proyecto);
|
||||
|
Reference in New Issue
Block a user