24 lines
868 B
PHP
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'));
|
|
}
|
|
}
|