Controlador
This commit is contained in:
27
app/src/Controller/Ventas/Abono/Cuotas.php
Normal file
27
app/src/Controller/Ventas/Abono/Cuotas.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace Incoviba\Controller\Ventas\Abono;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Incoviba\Service;
|
||||
use Incoviba\Repository;
|
||||
use Incoviba\Common\Alias\View;
|
||||
use Incoviba\Common\Implement\Exception\EmptyResult;
|
||||
|
||||
class Cuotas
|
||||
{
|
||||
public function __invoke(ServerRequestInterface $request, ResponseInterface $response,
|
||||
Service\Venta $ventaService,
|
||||
Repository\Venta\Abono\Cuota $cuotaRepository, View $view, int $venta_id): ResponseInterface
|
||||
{
|
||||
$venta = null;
|
||||
try {
|
||||
$venta = $ventaService->getById($venta_id);
|
||||
} catch (EmptyResult $e) {}
|
||||
$cuotas = [];
|
||||
try {
|
||||
$cuotas = $cuotaRepository->fetchByVenta($venta_id);
|
||||
} catch (EmptyResult $e) {}
|
||||
return $view->render($response, 'ventas.escrituras.abono.cuotas', compact('venta', 'cuotas'));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user