33 lines
1.6 KiB
PHP
33 lines
1.6 KiB
PHP
<?php
|
|
namespace Incoviba\Controller;
|
|
|
|
use Psr\Http\Message\ResponseInterface;
|
|
use Psr\Http\Message\ServerRequestInterface;
|
|
use Incoviba\Repository;
|
|
use Incoviba\Common\Alias\View;
|
|
|
|
class CentrosCostos
|
|
{
|
|
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, View $view,
|
|
Repository\CentroCosto $centroCostoRepository,
|
|
Repository\TipoCentro $tipoCentroRepository,
|
|
Repository\CategoriaCentro $categoriaCentroRepository,
|
|
Repository\TipoCuenta $tipoCuentaRepository): ResponseInterface
|
|
{
|
|
$centrosCostos = $centroCostoRepository->fetchAll();
|
|
$tiposCentros = $tipoCentroRepository->fetchAll();
|
|
$categorias = $categoriaCentroRepository->fetchAll('descripcion');
|
|
$tiposCuentas = $tipoCuentaRepository->fetchAll();
|
|
return $view->render($response, 'contabilidad.centros_costos', compact('centrosCostos',
|
|
'tiposCentros', 'categorias', 'tiposCuentas'));
|
|
}
|
|
public function asignar(ServerRequestInterface $request, ResponseInterface $response, View $view,
|
|
Repository\CentroCosto $centroCostoRepository,
|
|
Repository\Inmobiliaria $inmobiliariaRepository): ResponseInterface
|
|
{
|
|
$centrosCostos = $centroCostoRepository->fetchAll();
|
|
$inmobiliarias = $inmobiliariaRepository->fetchAllActive('razon');
|
|
return $view->render($response, 'contabilidad.centros_costos.asignar', compact('centrosCostos', 'inmobiliarias'));
|
|
}
|
|
}
|