feature/cierres #25

Open
aldarien wants to merge 446 commits from feature/cierres into develop
367 changed files with 1366 additions and 15347 deletions
Showing only changes of commit 9be20ab1cd - Show all commits

View File

@ -217,11 +217,15 @@ class Pago
return $uf; return $uf;
} }
if ($uf !== 0.0) { if ($uf !== 0.0) {
try {
$this->pagoRepository->edit($pago, ['uf' => $uf]); $this->pagoRepository->edit($pago, ['uf' => $uf]);
} catch (EmptyResult) {}
return $uf; return $uf;
} }
} elseif ($pago->uf === 0.0) { } elseif ($pago->uf === 0.0) {
try {
$this->pagoRepository->edit($pago, ['uf' => null]); $this->pagoRepository->edit($pago, ['uf' => null]);
} catch (EmptyResult) {}
return null; return null;
} }
return $pago->uf; return $pago->uf;

View File

@ -77,6 +77,12 @@ class Pie
if (isset($pie->asociado)) { if (isset($pie->asociado)) {
$pie->asociado = $this->getById($pie->asociado->id); $pie->asociado = $this->getById($pie->asociado->id);
} }
if (($pie->uf === null or $pie->uf === 0.0) and $pie->fecha <= new DateTimeImmutable()) {
$pie->uf = $this->ufService->get($pie->fecha);
try {
$this->pieRepository->edit($pie, ['uf' => $pie->uf]);
} catch (EmptyResult) {}
}
return $pie; return $pie;
} }
} }