FIX:Unavailable value for tipocambio crashed the loading of values

This commit is contained in:
2022-01-07 00:23:52 -03:00
parent c1eeba04a2
commit d7dfc2d221
3 changed files with 14 additions and 5 deletions

View File

@ -26,7 +26,7 @@ class Moneda extends Model {
$cambio = $this->factory->find(TipoCambio::class)
->where([['desde_id', $this->id], ['hasta_id', 1], ['fecha', $fecha->format('Y-m-d H:i:s')]])
->one();
if (!$cambio) {
if ($cambio === null) {
$cambio = $this->factory->find(TipoCambio::class)
->where([['hasta_id', $this->id], ['desde_id', 1], ['fecha', $fecha->format('Y-m-d H:i:s')]])
->one();