diff --git a/app/src/Model/Venta/Pago.php b/app/src/Model/Venta/Pago.php index 8474d11..669955d 100644 --- a/app/src/Model/Venta/Pago.php +++ b/app/src/Model/Venta/Pago.php @@ -24,8 +24,15 @@ class Pago extends Model public function valor(string $moneda = Pago::UF): float { - $uf = $this->uf ?? ($this->uf > 0.0 ? $this->uf : 1); - return $this->valor / (($moneda === Pago::UF) ? $uf : 1); + $multiplier = 1; + if ($moneda === Pago::UF) { + if ($this->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