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();