diff --git a/app/src/Model/Venta/FormaPago.php b/app/src/Model/Venta/FormaPago.php index ee06f0d..4ec882b 100644 --- a/app/src/Model/Venta/FormaPago.php +++ b/app/src/Model/Venta/FormaPago.php @@ -11,6 +11,7 @@ class FormaPago implements JsonSerializable public ?Subsidio $subsidio = null; public ?Credito $credito = null; public ?Pago $devolucion = null; + public ?array $cuotasAbono = null; public function anticipo(string $moneda = Pago::UF): float { @@ -72,7 +73,8 @@ class FormaPago implements JsonSerializable 'bono_pie' => $this->bonoPie ?? null, 'subsidio' => $this->subsidio ?? null, 'credito' => $this->credito ?? null, - 'devolucion' => $this->devolucion ?? null + 'devolucion' => $this->devolucion ?? null, + 'cuotas_abono' => $this->cuotasAbono ?? [] ]; } } diff --git a/app/src/Service/Venta/FormaPago.php b/app/src/Service/Venta/FormaPago.php index 440ac96..105fe18 100644 --- a/app/src/Service/Venta/FormaPago.php +++ b/app/src/Service/Venta/FormaPago.php @@ -16,6 +16,7 @@ class FormaPago extends Ideal\Service protected Credito $creditoService, protected Repository\Venta\Escritura $escrituraRepository, protected Subsidio $subsidioService, + protected Repository\Venta\Abono\Cuota $cuotaRepository, protected Pago $pagoService, protected Valor $valorService) { @@ -43,6 +44,9 @@ class FormaPago extends Ideal\Service try { $formaPago->devolucion = $this->pagoService->getDevolucionByVenta($venta_id); } catch (Implement\Exception\EmptyResult) {} + try { + $formaPago->cuotasAbono = $this->cuotaRepository->fetchByVenta($venta_id); + } catch (Implement\Exception\EmptyResult) {} return $formaPago; }