feature/cierres #30

Merged
aldarien merged 460 commits from feature/cierres into develop 2025-09-11 15:16:17 -03:00
381 changed files with 1389 additions and 16408 deletions
Showing only changes of commit 1c40f18624 - Show all commits

View File

@ -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