26 lines
980 B
PHP
26 lines
980 B
PHP
<?php
|
|
namespace Incoviba\Controller\Ventas;
|
|
|
|
use Incoviba\Common\Alias\View;
|
|
use Incoviba\Model;
|
|
use Incoviba\Repository;
|
|
use Incoviba\Service;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
|
|
class Pies
|
|
{
|
|
public function cuotas(ServerRequestInterface $request, ResponseInterface $response, Service\Venta\Pie $pieService,
|
|
Repository\Venta $ventaRepository, Repository\Contabilidad\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\Contabilidad\Banco $a, Model\Contabilidad\Banco $b) {
|
|
return strcmp($a->nombre, $b->nombre);
|
|
});
|
|
return $view->render($response, 'ventas.pies.cuotas', compact('pie', 'venta', 'bancos', 'ventaRepository'));
|
|
}
|
|
}
|