From 94906eea8cd81877783c29dba768b3611da9967a Mon Sep 17 00:00:00 2001 From: Aldarien Date: Wed, 13 Dec 2023 13:03:43 -0300 Subject: [PATCH] FIX: Precio Unidad no existe --- app/src/Model/Venta/Unidad.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/Model/Venta/Unidad.php b/app/src/Model/Venta/Unidad.php index 176e299..461880b 100644 --- a/app/src/Model/Venta/Unidad.php +++ b/app/src/Model/Venta/Unidad.php @@ -20,7 +20,7 @@ class Unidad extends Ideal\Model public function precio(DateTimeInterface $dateTime): Precio { - if ($dateTime > $this->currentPrecio->current->fecha) { + if ($this->currentPrecio !== null and $dateTime > $this->currentPrecio->current->fecha) { return $this->currentPrecio; } $precio = array_reduce(array_filter($this->precios, function(Precio $precio) use ($dateTime) {