feature/cuotas-abono-escritura #1

Merged
aldarien merged 15 commits from feature/cuotas-abono-escritura into develop 2024-11-28 19:24:49 -03:00
19 changed files with 280 additions and 2115 deletions
Showing only changes of commit 1d268f9a94 - Show all commits

View 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'));
}
}