28 lines
938 B
PHP
28 lines
938 B
PHP
<?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'));
|
|
}
|
|
}
|