diff --git a/app/Http/Livewire/ShowTarifas.php b/app/Http/Livewire/ShowTarifas.php index 8157bf7..16dbf7c 100644 --- a/app/Http/Livewire/ShowTarifas.php +++ b/app/Http/Livewire/ShowTarifas.php @@ -134,11 +134,14 @@ class ShowTarifas extends Component 'rol_id.required' => 'El campo rol es obligatorio', ]); - if ($this->precio < $this->valorBase) { - $this->alert('error', 'El precio no puede ser menor al costo del plan', [ - 'position' => 'top' - ]); - return; + + if (auth()->user()->rol->nombre !== 'super') { + if ($this->precio < $this->valorBase) { + $this->alert('error', 'El precio no puede ser menor al costo del plan', [ + 'position' => 'top' + ]); + return; + } } Tarifas::create([ @@ -186,11 +189,13 @@ class ShowTarifas extends Component 'rol_id.required' => 'El campo rol es obligatorio', ]); - if ($this->precio < $this->valorBase) { - $this->alert('error', 'El precio no puede ser menor al costo del plan', [ - 'position' => 'top' - ]); - return; + if (auth()->user()->rol->nombre !== 'super') { + if ($this->precio < $this->valorBase) { + $this->alert('error', 'El precio no puede ser menor al costo del plan', [ + 'position' => 'top' + ]); + return; + } } TarifaPromo::create([ @@ -283,11 +288,13 @@ class ShowTarifas extends Component 'rol_id.required' => 'El campo rol es obligatorio', ]); - if ($this->precio < $this->valorBase) { - $this->alert('error', 'El precio no puede ser menor al valor base', [ - 'position' => 'top' - ]); - return; + if (auth()->user()->rol->nombre !== 'super') { + if ($this->precio < $this->valorBase) { + $this->alert('error', 'El precio no puede ser menor al valor base', [ + 'position' => 'top' + ]); + return; + } } $tarifa->update([ @@ -326,11 +333,13 @@ class ShowTarifas extends Component 'rol_id.required' => 'El campo rol es obligatorio', ]); - if ($this->precio < $this->valorBase) { - $this->alert('error', 'El precio no puede ser menor al valor base', [ - 'position' => 'top' - ]); - return; + if (auth()->user()->rol->nombre !== 'super') { + if ($this->precio < $this->valorBase) { + $this->alert('error', 'El precio no puede ser menor al valor base', [ + 'position' => 'top' + ]); + return; + } } $tarifa->update([ diff --git a/app/Http/Livewire/ShowUsuarios.php b/app/Http/Livewire/ShowUsuarios.php index 18536c8..ffa6ca5 100755 --- a/app/Http/Livewire/ShowUsuarios.php +++ b/app/Http/Livewire/ShowUsuarios.php @@ -132,7 +132,7 @@ class ShowUsuarios extends Component } $consulta_usuarios = $consulta_usuarios - ->with('rol', 'saldo','subvendedor_relacion') + ->with('rol', 'saldo', 'subvendedor_relacion') ->orderBy('id', 'DESC') ->withCount('historiales_venta') ->paginate($this->entradas); @@ -575,11 +575,13 @@ class ShowUsuarios extends Component ->exists(); - if ($this->precioTarifasGestion < $this->valorBase) { - $this->alert('error', 'El precio no puede ser menor al costo del plan', [ - 'position' => 'top' - ]); - return; + if (auth()->user()->rol->nombre !== 'super') { + if ($this->precioTarifasGestion < $this->valorBase) { + $this->alert('error', 'El precio no puede ser menor al costo del plan', [ + 'position' => 'top' + ]); + return; + } } if ($consulta_existe) {