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,12 +1,14 @@
<?php
namespace Incoviba\Service\Venta;
use Incoviba\Service\Valor;
use Error;
use Incoviba\Exception\ServiceAction\Read;
use Psr\Log\LoggerInterface;
use Incoviba\Common\Implement;
use Incoviba\Common\Ideal;
use Incoviba\Model;
use Incoviba\Repository;
use Incoviba\Service\Valor;
class FormaPago extends Ideal\Service
{
@ -28,22 +30,22 @@ class FormaPago extends Ideal\Service
$formaPago = new Model\Venta\FormaPago();
try {
$formaPago->pie = $this->pieService->getByVenta($venta_id);
} catch (Implement\Exception\EmptyResult) {}
} catch (Read) {}
try {
$formaPago->bonoPie = $this->bonoPieService->getByVenta($venta_id);
} catch (Implement\Exception\EmptyResult) {}
} catch (Read) {}
try {
$formaPago->credito = $this->creditoService->getByVenta($venta_id);
} catch (Implement\Exception\EmptyResult) {}
} catch (Read) {}
try {
$formaPago->escritura = $this->escrituraRepository->fetchByVenta($venta_id);
} catch (Implement\Exception\EmptyResult) {}
try {
$formaPago->subsidio = $this->subsidioService->getByVenta($venta_id);
} catch (Implement\Exception\EmptyResult) {}
} catch (Read) {}
try {
$formaPago->devolucion = $this->pagoService->getDevolucionByVenta($venta_id);
} catch (Implement\Exception\EmptyResult) {}
} catch (Read) {}
try {
$formaPago->cuotasAbono = $this->cuotaRepository->fetchByVenta($venta_id);
} catch (Implement\Exception\EmptyResult) {}
@ -66,7 +68,7 @@ class FormaPago extends Ideal\Service
$method = 'add' . str_replace(' ', '', ucwords(str_replace('_', ' ', $name)));
$obj = $this->{$method}($data);
$forma_pago->{$name} = $obj;
} catch (\Error $error) {
} catch (Error $error) {
$this->logger->critical($error);
}
}