FIX: Precio Unidad no existe
This commit is contained in:
@ -20,7 +20,7 @@ class Unidad extends Ideal\Model
|
|||||||
|
|
||||||
public function precio(DateTimeInterface $dateTime): Precio
|
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;
|
return $this->currentPrecio;
|
||||||
}
|
}
|
||||||
$precio = array_reduce(array_filter($this->precios, function(Precio $precio) use ($dateTime) {
|
$precio = array_reduce(array_filter($this->precios, function(Precio $precio) use ($dateTime) {
|
||||||
|
Reference in New Issue
Block a user