Facturacion

This commit is contained in:
Juan Pablo Vial
2024-04-19 23:19:35 -04:00
parent 9388dc17fc
commit d2511901ec
7 changed files with 126 additions and 43 deletions

View File

@ -31,8 +31,11 @@ class Terreno extends Ideal\Service
try {
return $this->getValorContable($proyecto, $lastDecember);
} catch (Implement\Exception\EmptyResponse) {}
if ($proyecto->terreno->fecha === null) {
return null;
}
if ($proyecto->terreno->fecha->getTimestamp() > 0) {
return $this->getValorReajustado($proyecto, $lastDecember);
return $this->getValorReajustado($proyecto);
}
$terreno = $proyecto->terreno;
} catch (Implement\Exception\EmptyResult) {}

View File

@ -46,6 +46,10 @@ class Venta extends Service
$ventas = $this->ventaRepository->fetchActivaByProyecto($proyecto_id);
return array_map([$this, 'process'], $ventas);
}
public function getIdsByProyecto(int $proyecto_id): array
{
return $this->ventaRepository->fetchIdsByProyecto($proyecto_id);
}
public function getByProyectoAndUnidad(string $proyecto_nombre, int $unidad_descripcion): Model\Venta
{
$venta = $this->ventaRepository->fetchByProyectoAndUnidad($proyecto_nombre, $unidad_descripcion);