Facturacion

This commit is contained in:
Juan Pablo Vial
2024-04-15 20:13:15 -04:00
parent 8e4b5eaaf8
commit a33dd341cd
8 changed files with 259 additions and 6 deletions

View File

@ -8,14 +8,18 @@ use Incoviba\Service;
class Facturacion
{
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, View $view, Service\Proyecto $proyectoService): ResponseInterface
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, View $view,
Service\Proyecto $proyectoService): ResponseInterface
{
$proyectos = $proyectoService->getEscriturando();
return $view->render($response, 'ventas.facturacion', compact('proyectos'));
}
public function show(ServerRequestInterface $request, ResponseInterface $response, View $view, Service\Venta $ventaService, int $venta_id): ResponseInterface
public function show(ServerRequestInterface $request, ResponseInterface $response, View $view,
Service\Venta $ventaService, Service\Proyecto\Terreno $terrenoService,
int $venta_id): ResponseInterface
{
$venta = $ventaService->getById($venta_id);
return $view->render($response, 'ventas.facturacion.show', compact('venta'));
$terreno = $terrenoService->valor($venta->proyecto()->id);
return $view->render($response, 'ventas.facturacion.show', compact('venta', 'terreno'));
}
}