FormaPago Service

This commit is contained in:
Juan Pablo Vial
2024-03-13 14:38:44 -03:00
parent c7dd309185
commit 98953cce42
21 changed files with 261 additions and 71 deletions

View File

@ -13,7 +13,7 @@ class Login
public function form(ServerRequestInterface $request, ResponseInterface $response, View $view, Service\Login $service): ResponseInterface
{
if ($service->isIn()) {
return $response->withStatus(301)->withHeader('Location', $view->get('urls')->base);
return $response->withStatus(302)->withHeader('Location', $view->get('urls')->base);
}
return $view->render($response, 'login.form');
}

View File

@ -32,8 +32,13 @@ class Ventas
public function show(ServerRequestInterface $request, ResponseInterface $response, View $view,
Service\Venta $service, int $venta_id): ResponseInterface
{
$venta = $service->getById($venta_id);
return $view->render($response, 'ventas.show', compact('venta'));
try {
$venta = $service->getById($venta_id);
return $view->render($response, 'ventas.show', compact('venta'));
} catch (EmptyResult) {
$response = $response->withStatus(404);
return $view->render($response, 'not_found');
}
}
public function showUnidad(ServerRequestInterface $request, ResponseInterface $response, View $view,
Service\Venta $service, string $proyecto_nombre, int $unidad_descripcion): ResponseInterface