feature/cierres #31

Merged
aldarien merged 462 commits from feature/cierres into develop 2025-09-11 17:05:18 -03:00
282 changed files with 852 additions and 11964 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);
}