FIX: Pie cuotas valores uf

This commit is contained in:
2024-01-08 13:16:12 -03:00
parent 675b3843ea
commit bc2333bc95
4 changed files with 25 additions and 16 deletions

View File

@ -24,7 +24,8 @@ class Pago extends Model
public function valor(string $moneda = Pago::UF): float
{
return $this->valor / (($moneda === Pago::UF) ? ($this->uf > 0 ? $this->uf : 1) : 1);
$uf = $this->uf ?? ($this->uf > 0.0 ? $this->uf : 1);
return $this->valor / (($moneda === Pago::UF) ? $uf : 1);
}
public function jsonSerialize(): mixed