From 09050275c2944cb5b0e544da498fd91ac64b55ec Mon Sep 17 00:00:00 2001 From: Felipe Date: Mon, 29 Apr 2024 10:16:53 -0500 Subject: [PATCH] fecha actual + 30 dias --- app/Http/Livewire/ShowPlanes.php | 21 ++++++++++++------- .../views/livewire/show-planes.blade.php | 11 +++++++--- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/Http/Livewire/ShowPlanes.php b/app/Http/Livewire/ShowPlanes.php index 5c77ed3..bb86aee 100755 --- a/app/Http/Livewire/ShowPlanes.php +++ b/app/Http/Livewire/ShowPlanes.php @@ -219,6 +219,12 @@ class ShowPlanes extends Component $this->estado = $renovarCuenta->estado; } + public function calcularFechas() + { + $this->fecha_inicial_renovar = Carbon::now()->format('Y-m-d'); + $this->fecha_final_renovar = Carbon::now()->addDays(30)->format('Y-m-d'); + } + public function getListeners() { return [ @@ -252,7 +258,7 @@ class ShowPlanes extends Component 'estado' => $this->estado, ]); - if ( $this->usuario_renovar_old !== $this->usuario_renovar) { + if ($this->usuario_renovar_old !== $this->usuario_renovar) { Log_historial::create([ 'user_id' => Auth::user()->id, 'detalle' => 'El usuario ha editado el usuario de la cuenta ' . $cuenta_renovar->correo @@ -449,7 +455,7 @@ class ShowPlanes extends Component { $this->validate([ 'nota_eliminacion' => 'required', - ],[ + ], [ 'nota_eliminacion.required' => 'La nota es obligatoria', ]); @@ -477,13 +483,13 @@ class ShowPlanes extends Component { $this->validate([ 'nota_eliminacion' => 'required', - ],[ + ], [ 'nota_eliminacion.required' => 'La nota es obligatoria', ]); $cuentas = Cuentas::whereIn('id', $this->delete_1)->get(); if ($cuentas) { - forEach ($cuentas as $cuenta) { + foreach ($cuentas as $cuenta) { Log_historial::create([ 'user_id' => Auth::user()->id, 'detalle' => 'El usuario ha eliminado la cuenta ' . $cuenta->correo . ' nota de eliminacion: ' . $this->nota_eliminacion @@ -498,7 +504,6 @@ class ShowPlanes extends Component $this->alert('success', 'Cuentas eliminadas correctamente!', [ 'position' => 'top' ]); - } /* ------------- ACTUALIZAR ------------- */ public function updateTarifas() @@ -741,9 +746,10 @@ class ShowPlanes extends Component $this->editarTarifaRol = false; } - public function seleccionarTodos(){ + public function seleccionarTodos() + { - if (count($this->delete_1)== 0) { + if (count($this->delete_1) == 0) { $this->delete_1 = array_column($this->cont['data'], 'id'); } else { $this->delete_1 = []; @@ -752,5 +758,4 @@ class ShowPlanes extends Component //dd($this->delete_1); } - } diff --git a/resources/views/livewire/show-planes.blade.php b/resources/views/livewire/show-planes.blade.php index 58cc221..b331c06 100755 --- a/resources/views/livewire/show-planes.blade.php +++ b/resources/views/livewire/show-planes.blade.php @@ -13,7 +13,7 @@ }" class="h-full w-full md:my-2">
+ wire:target="noRenovar,calcularFechas,siRenovar,ver,openRenovar,confirm_delete_cuenta,saveRenovar,createNewCuenta,createServicio,verObservacion,update,verObservacion1,update_observaciones1,eliminarCuentas,updateTarifas">
@@ -410,9 +410,14 @@ - -
+ +
+ +
+