Desistir venta
This commit is contained in:
@ -244,4 +244,18 @@ class Ventas
|
||||
} catch (EmptyResult) {}
|
||||
return $this->withJson($response, $output);
|
||||
}
|
||||
public function desistir(ServerRequestInterface $request, ResponseInterface $response, Service\Venta $ventaService, int $venta_id): ResponseInterface
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
$output = [
|
||||
'input' => $data,
|
||||
'venta_id' => $venta_id,
|
||||
'desistida' => false
|
||||
];
|
||||
try {
|
||||
$venta = $ventaService->getById($venta_id);
|
||||
$output['desistida'] = $ventaService->desistir($venta, $data);
|
||||
} catch (EmptyResult) {}
|
||||
return $this->withJson($response, $output);
|
||||
}
|
||||
}
|
||||
|
@ -108,4 +108,10 @@ class Ventas
|
||||
});
|
||||
return $view->render($response, 'ventas.escriturar', compact('venta', 'bancos'));
|
||||
}
|
||||
public function desistir(ServerRequestInterface $request, ResponseInterface $response, Service\Venta $ventaService,
|
||||
View $view, int $venta_id): ResponseInterface
|
||||
{
|
||||
$venta = $ventaService->getById($venta_id);
|
||||
return $view->render($response, 'ventas.desistir', compact('venta'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user