From 4759600e1e8ac9944f5fb0bd8706be057d986f71 Mon Sep 17 00:00:00 2001 From: Felipe Date: Thu, 27 Jul 2023 14:39:36 -0500 Subject: [PATCH] fix --- app/Http/Livewire/ShowClientes.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/Http/Livewire/ShowClientes.php b/app/Http/Livewire/ShowClientes.php index 59bd732..5aaf1b6 100644 --- a/app/Http/Livewire/ShowClientes.php +++ b/app/Http/Livewire/ShowClientes.php @@ -265,7 +265,7 @@ class ShowClientes extends Component public function renovar($id) { - $historiale = Historiale::with('tarifa','cuentas')->find($id); + $historiale = Historiale::with('tarifa', 'cuentas')->find($id); if (!$historiale) { return; @@ -274,11 +274,11 @@ class ShowClientes extends Component $tarifa = $historiale->tarifa; $diasTarifa = $tarifa->dias; $valorTarifa = $tarifa->valor; - + $cuenta = $historiale->cuentas->first(); $vencimientoCuenta = Carbon::parse($cuenta->vencimiento); $nuevaFechaVencimiento = $vencimientoCuenta->addDays($diasTarifa); - + $newFechaInicio = Carbon::parse($historiale->fecha_inicio)->addDays($diasTarifa); $newFechaFinal = Carbon::parse($historiale->fecha_final)->addDays($diasTarifa); @@ -288,17 +288,14 @@ class ShowClientes extends Component $nuevoHistorial->save(); $pantallas = $cuenta->servicio->completa; - //dd($pantallas); - for ($i=1; $i <= $pantallas ; $i++) { + //dd($pantallas); + for ($i = 1; $i <= $pantallas; $i++) { $historial_cuenta = new Historial_cuenta; $historial_cuenta->historial_id = $nuevoHistorial->id; $historial_cuenta->cuenta_id = $cuenta->id; $historial_cuenta->perfil = $i; $historial_cuenta->save(); } - - - $cuenta->vencimiento = $nuevaFechaVencimiento; $cuenta->save();