Files
oficial/app/src/Controller/Ventas/Pies.php
Juan Pablo Vial 0cd357b6cb 2023-09-12
2023-09-13 18:51:46 -03:00

24 lines
868 B
PHP

<?php
namespace Incoviba\Controller\Ventas;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Incoviba\Common\Alias\View;
use Incoviba\Service;
use Incoviba\Repository;
use Incoviba\Model;
class Pies
{
public function cuotas(ServerRequestInterface $request, ResponseInterface $response, Service\Venta\Pie $pieService, Repository\Venta $ventaRepository, Repository\Banco $bancoRepository, View $view, int $pie_id): ResponseInterface
{
$pie = $pieService->getById($pie_id);
$venta = $ventaRepository->fetchByPie($pie_id);
$bancos = $bancoRepository->fetchAll();
usort($bancos, function(Model\Banco $a, Model\Banco $b) {
return strcmp($a->nombre, $b->nombre);
});
return $view->render($response, 'ventas.pies.cuotas', compact('pie', 'venta', 'bancos'));
}
}