FIX: Precio Unidad no existe en venta y facturacion
This commit is contained in:
@ -18,7 +18,7 @@ class Unidad extends Ideal\Model
|
||||
public array $precios = [];
|
||||
public ?Precio $currentPrecio = null;
|
||||
|
||||
public function precio(DateTimeInterface $dateTime): Precio
|
||||
public function precio(DateTimeInterface $dateTime): ?Precio
|
||||
{
|
||||
if ($this->currentPrecio !== null and $dateTime > $this->currentPrecio->current->fecha) {
|
||||
return $this->currentPrecio;
|
||||
@ -41,9 +41,6 @@ class Unidad extends Ideal\Model
|
||||
return $min->current->fecha < $precio->current->fecha ? $min : $precio;
|
||||
});
|
||||
}
|
||||
if ($precio === null) {
|
||||
throw new EmptyResult('SELECT * FROM precio WHERE unidad = ? AND fecha = ?');
|
||||
}
|
||||
|
||||
return $precio;
|
||||
}
|
||||
|
Reference in New Issue
Block a user