diff --git a/app/Http/Livewire/ShowServicios.php b/app/Http/Livewire/ShowServicios.php index 32b972d..d2fefae 100755 --- a/app/Http/Livewire/ShowServicios.php +++ b/app/Http/Livewire/ShowServicios.php @@ -355,6 +355,7 @@ class ShowServicios extends Component } } else { $esta_error = true; + $historial->update(['estado' => 'cancelado']); $eliminar = Historial_cuenta::where('historial_id', $historial->id)->delete(); $logsGeneral = new Log_general(); $logsGeneral->user_id = Auth::user()->id; @@ -378,12 +379,14 @@ class ShowServicios extends Component $logsGeneral = new Log_general(); $logsGeneral->user_id = Auth::user()->id; - $logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha comprado el servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor; + $logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha comprado el servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor .', Nuevo saldo disponible: $'.$nuevo_saldo; $logsGeneral->save(); + $this->credenciales($historial); } else { + $historial->update(['estado' => 'cancelado']); $logsGeneral = new Log_general(); $logsGeneral->user_id = Auth::user()->id; $logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Tuvo un error con el cobro del servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor;