FIX: Pie cuotas valores uf
This commit is contained in:
@ -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
|
||||
|
@ -25,7 +25,7 @@ class Pie extends Model
|
||||
}
|
||||
if ($pagadas) {
|
||||
return array_filter($this->cuotasArray, function(Cuota $cuota) {
|
||||
return $cuota->pago->currentEstado->tipoEstadoPago->descripcion !== 'no pagado';
|
||||
return in_array($cuota->pago->currentEstado->tipoEstadoPago->descripcion, ['depositado', 'abonado']);
|
||||
});
|
||||
}
|
||||
return array_filter($this->cuotasArray, function(Cuota $cuota) {
|
||||
|
Reference in New Issue
Block a user