uf === null or $this->uf === 0.0) { return 0; } $uf = $this->uf; $multiplier = 1 / $uf; } return $this->valor * $multiplier; } public function estado(?string $tipoEstado = null): ?EstadoPago { if (!isset($this->estados)) { return null; } if ($tipoEstado === null) { return $this->currentEstado; } foreach ($this->estados as $estado) { if ($estado->tipoEstado->descripcion === $tipoEstado) { return $estado; } } return null; } public function jsonSerialize(): mixed { return array_merge(parent::jsonSerialize(), [ 'valor' => $this->valor, 'valor_uf' => $this->valor(), 'banco' => $this->banco ?? '', 'tipo_pago' => $this->tipoPago ?? '', 'identificador' => $this->identificador ?? '', 'fecha' => $this->fecha->format('Y-m-d H:i:s') ?? '', 'uf' => $this->uf ?? 1, 'pagador' => $this->pagador ?? '', 'asociado' => $this->asociado ?? '' ]); } }