This commit is contained in:
Juan Pablo Vial
2025-03-03 14:57:22 -03:00
parent d165440483
commit 8f16f33a1e
56 changed files with 749 additions and 105 deletions

View File

@ -1,6 +1,7 @@
<?php
namespace Incoviba\Service\Contabilidad;
use PDOException;
use DateTimeImmutable;
use DateTimeInterface;
use Incoviba\Common\Define\Cartola\Banco;
@ -273,12 +274,12 @@ class Cartola extends Service
$data['abono'] ?? 0,
$data['saldo']
);
} catch (Exception\EmptyResult $exception) {
} catch (Exception\EmptyResult) {
$data['cuenta_id'] = $cuenta->id;
$movimiento = $this->movimientoRepository->create($data);
try {
return $this->movimientoRepository->save($movimiento);
} catch (\PDOException $exception) {
} catch (PDOException $exception) {
$this->logger->critical(var_export($data,true));
throw $exception;
}

View File

@ -9,7 +9,7 @@ trait isExcel
* @throws PhpSpreadsheet\Exception
* @throws PhpSpreadsheet\Calculation\Exception
*/
protected function findTitlesRow(PhpSpreadsheet\Worksheet\RowIterator &$rowIterator, string $firstTitle, int $columnOffset = 1, bool $caseInsensitive = false): ?PhpSpreadsheet\Worksheet\Row
protected function findTitlesRow(PhpSpreadsheet\Worksheet\RowIterator $rowIterator, string $firstTitle, int $columnOffset = 1, bool $caseInsensitive = false): ?PhpSpreadsheet\Worksheet\Row
{
if ($caseInsensitive) {
$firstTitle = strtolower($firstTitle);
@ -100,11 +100,6 @@ trait isExcel
if ($columnOffset > 1) {
$cellIterator->seek($columnOffset);
}
foreach ($exitValues as $exitValue) {
if ($cellIterator->current()->getCalculatedValue() === $exitValue) {
return true;
}
}
return false;
return in_array($cellIterator->current()->getCalculatedValue(), $exitValues, true);
}
}

View File

@ -1,8 +1,9 @@
<?php
namespace Incoviba\Service\Contabilidad\Cartola;
use Incoviba\Common\Ideal\Cartola\Banco;
use InvalidArgumentException;
use Psr\Http\Message\UploadedFileInterface;
use Incoviba\Common\Ideal\Cartola\Banco;
trait withSubBancos
{

View File

@ -15,8 +15,8 @@ class Semanal extends Ideal\Service
protected Repository\Contabilidad\Deposito $depositoRepository,
protected Service\Contabilidad\Cartola $cartolaService,
protected Service\Contabilidad\Movimiento $movimientoService,
protected Service\Contabilidad\Informe\Tesoreria\Excel $excelService,
protected Service\Contabilidad\Informe\Tesoreria\PDF $pdfService)
protected Service\Contabilidad\Informe\Tesoreria\Input\Excel $excelService,
protected Service\Contabilidad\Informe\Tesoreria\Output\PDF $pdfService)
{
parent::__construct($logger);
}
@ -31,6 +31,6 @@ class Semanal extends Ideal\Service
}
return $this->anterior;
}
public function build(DateTimeInterface $fecha): array
{}
/*public function build(DateTimeInterface $fecha): array
{}*/
}

View File

@ -65,7 +65,7 @@ class SaldosContables extends Ideal\Service
'saldo' => $this->getSaldo($dataMovimiento)
];
try {
$movimiento = $this->movimientoRepository->fetchByCuentaAndFechaAndCargoAndAbonoAndSaldo($cuenta->id, $dataMovimiento->fecha, $data['cargo'], $data['abono'], $data['saldo']);
$movimiento = $this->movimientoRepository->fetchByCuentaAndFechaAndGlosaAndCargoAndAbonoAndSaldo($cuenta->id, $dataMovimiento->fecha, $data['glosa'], $data['cargo'], $data['abono'], $data['saldo']);
} catch (Implement\Exception\EmptyResult) {
$movimiento = $this->movimientoRepository->create($data);
$movimiento = $this->movimientoRepository->save($movimiento);

View File

@ -5,6 +5,7 @@ use DateInterval;
use DateTimeInterface;
use Incoviba\Common\Ideal;
use Incoviba\Common\Implement;
use Incoviba\Exception\ServiceAction\Read;
use Incoviba\Model;
use Incoviba\Repository;
use Incoviba\Service;
@ -94,7 +95,7 @@ class Output extends Ideal\Service
$dataInmobiliaria->sociedad = $inmobiliaria;
try {
$cuentas = $this->cuentaService->getAllActiveByInmobiliaria($inmobiliaria->rut);
} catch (Implement\Exception\EmptyResult) {
} catch (Read) {
return $dataInmobiliaria;
}
foreach ($cuentas as $cuenta) {

View File

@ -17,7 +17,7 @@ class Movimientos
const INGRESOS = 'ingresos';
const EGRESOS = 'egresos';
public function addDap(string $tipo, array $movimientos)
public function addDap(string $tipo, array $movimientos): self
{
foreach ($movimientos as $movimiento) {
$this->dap->{$tipo} []= $movimiento;
@ -66,11 +66,7 @@ class Movimientos
$date = $movimiento->fecha;
}
if ($movimiento->fecha !== $date) {
if ($movimiento->cuenta->inmobiliaria->rut === $sociedad_rut) {
$temp []= $movimiento;
}
$date = $movimiento->fecha;
continue;
}
if ($movimiento->cuenta->inmobiliaria->rut === $sociedad_rut) {
$temp []= $movimiento;