Files
oficial/app/src/Controller/Ventas/Pies.php
Juan Pablo Vial db36549699 Agregar Pie
2025-03-26 16:41:54 -03:00

34 lines
1.4 KiB
PHP

<?php
namespace Incoviba\Controller\Ventas;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Incoviba\Common\Alias\View;
use Incoviba\Exception\ServiceAction\Read;
use Incoviba\Repository;
use Incoviba\Service;
class Pies
{
public function cuotas(ServerRequestInterface $request, ResponseInterface $response, Service\Venta\Pie $pieService,
Repository\Venta $ventaRepository, Repository\Contabilidad\Banco $bancoRepository,
Repository\Venta\TipoEstadoPago $tipoEstadoPagoRepository,
View $view, int $pie_id): ResponseInterface
{
$pie = $pieService->getById($pie_id);
$venta = $ventaRepository->fetchByPie($pie_id);
$bancos = $bancoRepository->fetchAll('nombre');
$estados = $tipoEstadoPagoRepository->fetchAll('descripcion');
return $view->render($response, 'ventas.pies.cuotas', compact('pie', 'venta', 'bancos', 'estados', 'ventaRepository'));
}
public function add(ServerRequestInterface $request, ResponseInterface $response, Service\Venta $ventaService,
View $view, int $venta_id): ResponseInterface
{
$venta = null;
try {
$venta = $ventaService->getById($venta_id);
} catch (Read) {}
return $view->render($response, 'ventas.pies.add', compact('venta'));
}
}