From 64896c0a2cda0147a99e37b1b9c38f6af30eef71 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 30 Apr 2024 22:33:32 -0500 Subject: [PATCH] Update ShowServicios.php --- app/Http/Livewire/ShowServicios.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Livewire/ShowServicios.php b/app/Http/Livewire/ShowServicios.php index b8006b0..4b7555f 100755 --- a/app/Http/Livewire/ShowServicios.php +++ b/app/Http/Livewire/ShowServicios.php @@ -232,7 +232,7 @@ class ShowServicios extends Component return; } - if (auth()->user()->saldo->valor < $this->valor_tarjetaPlan * $this->cantidad_tarjetaPlan) { + if (auth()->user()->saldo->valor < $this->valor_tarjetaPlan * $this->cantidad_tarjetaPlan) { $this->alert('error', 'Saldo insuficiente', [ 'position' => 'top' ]); @@ -325,7 +325,7 @@ class ShowServicios extends Component } for ($h = 0; $h < (int) $cantidad_necesaria; $h++) { - if (!empty($cuenta)) { + if (!empty($cuenta) && isset($cuenta[$h])) { $cuentasMostar = ''; @@ -344,6 +344,7 @@ class ShowServicios extends Component } } } else { + $eliminar = Historial_cuenta::where('historial_id', $historial->id)->delete(); $logsGeneral = new Log_general(); $logsGeneral->user_id = Auth::user()->id; $logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Tuvo error de "No hay cuentas disponibles" Comprando el servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor;