Listado de Precios para Contrato Broker

This commit is contained in:
Juan Pablo Vial
2025-03-13 12:18:08 -03:00
parent 346001db8e
commit 68aebdb4fe
18 changed files with 826 additions and 14 deletions

View File

@ -45,6 +45,18 @@ class Unidad extends Ideal\Model
return $precio;
}
protected bool $sold;
public function sold(): bool
{
if (!isset($this->sold)) {
$this->sold = false;
try {
$this->sold = $this->runFactory('sold') ?? false;
} catch (EmptyResult) {}
}
return $this->sold;
}
public function jsonSerialize(): mixed
{
$output = array_merge(parent::jsonSerialize(), [
@ -59,6 +71,7 @@ class Unidad extends Ideal\Model
$output['precios'] = $this->precios;
$output['current_precio'] = $this->currentPrecio;
}
$output['sold'] = $this->sold() ?? false;
return $output;
}
}