Editar valor venta
This commit is contained in:
@ -75,10 +75,10 @@ class Venta extends Ideal\Model
|
||||
if (!isset($this->valor_util)) {
|
||||
$sum = $this->valor;
|
||||
$sum -= array_reduce($this->propiedad()->estacionamientos(), function(float $sum, Venta\Unidad $unidad) {
|
||||
return $unidad->precio($this->fecha)->valor;
|
||||
return $unidad->valor ?? $unidad->precio($this->fecha)->valor;
|
||||
}, 0);
|
||||
$sum -= array_reduce($this->propiedad()->bodegas(), function(float $sum, Venta\Unidad $unidad) {
|
||||
return $unidad->precio($this->fecha)->valor;
|
||||
return $unidad->valor ?? $unidad->precio($this->fecha)->valor;
|
||||
}, 0);
|
||||
$this->valor_util = $sum;
|
||||
}
|
||||
|
Reference in New Issue
Block a user