From 6c25c5f6d5bee23d2fd2d31b1c86eb2234a153ce Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Fri, 18 Jul 2025 16:20:23 -0400 Subject: [PATCH] FIX: Venta no se actualizaba --- app/resources/views/ventas/desistida.blade.php | 6 +++--- app/src/Controller/Ventas.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/resources/views/ventas/desistida.blade.php b/app/resources/views/ventas/desistida.blade.php index 252d33f..9f5f7be 100644 --- a/app/resources/views/ventas/desistida.blade.php +++ b/app/resources/views/ventas/desistida.blade.php @@ -61,8 +61,8 @@ return } const body = new FormData() - const fecha = date - fecha.setDate(date.getDate() - 1) + const fecha = new Date(date.getTime()) + fecha.setDate(fecha.getDate() - 1) body.set('fecha', fecha.toISOString()) $('#loading-spinner-fecha').show() APIClient.fetch(url, {method: 'post', body}).then(response => { @@ -70,7 +70,7 @@ if (!response) { return } - old = date + old = new Date(date.getTime()) alertResponse('Fecha cambiada correctamente.') }) } diff --git a/app/src/Controller/Ventas.php b/app/src/Controller/Ventas.php index 225afa1..37f7282 100644 --- a/app/src/Controller/Ventas.php +++ b/app/src/Controller/Ventas.php @@ -160,7 +160,7 @@ class Ventas ]; try { $pago = $pagoService->add($pagoData); - $ventaService->edit($venta, ['resciliacion' => $pago->id]); + $venta = $ventaService->edit($venta, ['resciliacion' => $pago->id]); } catch (Create | Update) {} } return $view->render($response, 'ventas.desistida', compact('venta'));