Cleanup por recomendaciones

This commit is contained in:
Juan Pablo Vial
2025-03-03 16:37:40 -03:00
parent 928d2e57be
commit 095a65a643
12 changed files with 24 additions and 13 deletions

View File

@ -58,6 +58,12 @@ class Credito extends Ideal\Repository
->where('pago = ?');
return $this->fetchOne($query, [$pago_id]);
}
/**
* @param int $venta_id
* @return Model\Venta\Credito
* @throws Implement\Exception\EmptyResult
*/
public function fetchByVenta(int $venta_id): Model\Venta\Credito
{
$query = $this->connection->getQueryBuilder()

View File

@ -114,6 +114,12 @@ WHERE venta_id = ?";
->where('valor = ? OR ROUND(valor/uf, 3) = ?');
return $this->fetchMany($query, [$value, $value]);
}
/**
* @param int $venta_id
* @return Model\Venta\Pago
* @throws Implement\Exception\EmptyResult
*/
public function fetchDevolucionByVenta(int $venta_id): Model\Venta\Pago
{
$query = $this->connection->getQueryBuilder()

View File

@ -83,6 +83,12 @@ class Pie extends Ideal\Repository
->where('reajuste = ?');
return $this->fetchOne($query, [$reajuste_id]);
}
/**
* @param int $venta_id
* @return Model\Venta\Pie
* @throws Implement\Exception\EmptyResult
*/
public function fetchByVenta(int $venta_id): Model\Venta\Pie
{
$query = $this->connection->getQueryBuilder()

View File

@ -14,7 +14,7 @@ class Mes extends Banco
}
try {
$reader = PhpSpreadsheet\IOFactory::createReader('Xlsx');
} catch (PhpSpreadsheet\Reader\Exception $exception) {
} catch (PhpSpreadsheet\Reader\Exception) {
return false;
}
$xlsx = $reader->load($filename);

View File

@ -1,7 +1,6 @@
<?php
namespace Incoviba\Service\Contabilidad\Informe\Tesoreria\Input\Excel;
use stdClass;
use PhpOffice\PhpSpreadsheet;
class DAPyFFMM extends Sheet

View File

@ -2,7 +2,6 @@
namespace Incoviba\Service;
use Incoviba\Common\Implement\Exception\EmptyResult;
use Incoviba\Common\Implement\Exception\EmptyResponse;
use Incoviba\Model;
use Incoviba\Repository;

View File

@ -3,7 +3,6 @@ namespace Incoviba\Service;
use Exception;
use DateTimeImmutable;
use DateInterval;
use DateMalformedStringException;
use Psr\Log\LoggerInterface;
use Incoviba\Common\Ideal\Service;

View File

@ -1,7 +1,6 @@
<?php
namespace Incoviba\Service\Venta;
use Exception;
use DateTimeInterface;
use DateTimeImmutable;
use DateMalformedStringException;

View File

@ -2,7 +2,6 @@
namespace Incoviba\Service\Venta;
use Incoviba\Common\Implement\Exception\EmptyResult;
use Incoviba\Common\Implement\Repository\Factory;
use Incoviba\Exception\ServiceAction\Read;
use Incoviba\Repository;
use Incoviba\Model;

View File

@ -1,10 +1,8 @@
<?php
namespace Incoviba\Service\Venta;
use Incoviba\Common\Implement\Exception\EmptyResult;
use Incoviba\Exception\ServiceAction\Read;
use Incoviba\Repository;
use Incoviba\Service;
use Incoviba\Model;
class PropiedadUnidad

View File

@ -2,6 +2,7 @@
namespace Incoviba\Service\Venta;
use DateTimeImmutable;
use DateMalformedStringException;
use Incoviba\Common\Implement\Exception\EmptyResult;
use Incoviba\Exception\ServiceAction\Read;
use Incoviba\Repository;
@ -34,12 +35,12 @@ class Subsidio
}
}
/**
* @throws Exception
*/
public function add(array $data): Model\Venta\Subsidio
{
$fecha = new DateTimeImmutable($data['fecha']);
$fecha = new DateTimeImmutable();
try {
$fecha = new DateTimeImmutable($data['fecha']);
} catch (DateMalformedStringException) {}
$uf = $data['uf'] ?? $this->moneyService->getUF($fecha);
$tipoPago = $this->tipoPagoRepository->fetchByDescripcion('vale vista');
$ahorro = $this->pagoService->add(['fecha' => $fecha->format('Y-m-d'), 'valor' => $this->valorService->clean($data['ahorro']) * $uf, 'uf' => $uf, 'tipo' => $tipoPago->id]);

View File

@ -5,7 +5,6 @@ use Incoviba\Exception\ServiceAction\Read;
use PDOException;
use Incoviba\Common\Implement\Exception\EmptyResult;
use Incoviba\Repository;
use Incoviba\Service;
use Incoviba\Model;
class Unidad