fecha actual + 30 dias

This commit is contained in:
Felipe
2024-04-29 10:16:53 -05:00
parent 581f0e2d7d
commit 09050275c2
2 changed files with 21 additions and 11 deletions
+13 -8
View File
@@ -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);
}
}