feature/cierres #30

Merged
aldarien merged 460 commits from feature/cierres into develop 2025-09-11 15:16:17 -03:00
230 changed files with 683 additions and 8179 deletions
Showing only changes of commit e9b2fe9963 - Show all commits

View File

@ -76,9 +76,15 @@ class Invoice extends AbstractEndPoint
if ($uf === 0.0) {
throw new InvalidResult("No hay UF para la fecha: {$dateString}", 422);
}
$valor = $data['amount'] / $uf;
$valor = $data['amount'];
if ($valor > 1000) {
$valor = $data['amount'] / $uf;
}
if (abs($valor - $invoice->cuota->pago->valor()) >= 0.0001) {
throw new InvalidResult("Valor en UF no coincide: {$data['amount']}", 422);
throw new InvalidResult("Valor en UF no coincide: {$data['amount']}, {$valor} <=> {$invoice->cuota->pago->valor()}", 422);
}
if ($invoice->cuota->pago->isPagado()) {
return true;
}
return $this->pagoService->depositar($invoice->cuota->pago, $date);
}