Update show-usuarios.blade.php

This commit is contained in:
lizandrogd
2025-07-07 16:22:54 -05:00
parent 5a73ef6662
commit fbe14cab91
+359 -355
View File
@@ -27,22 +27,22 @@
</div> </div>
<div class="flex gap-4"> <div class="flex gap-4">
@if (auth()->user()->subvendedor || auth()->user()->rol->nombre === 'administrador' || auth()->user()->rol->nombre === 'editor' || auth()->user()->rol->nombre === 'super') @if (auth()->user()->subvendedor || auth()->user()->rol->nombre === 'administrador' || auth()->user()->rol->nombre === 'editor' || auth()->user()->rol->nombre === 'super')
<a x-on:click="add = !add" class="justify-center flex px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-3 md:mb-0">Añadir <a x-on:click="add = !add" class="justify-center flex px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-3 md:mb-0">Añadir
usuario usuario
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve" class="w-[0.87rem] ml-2"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve" class="w-[0.87rem] ml-2">
<path d="M480,224H288V32c0-17.673-14.327-32-32-32s-32,14.327-32,32v192H32c-17.673,0-32,14.327-32,32s14.327,32,32,32h192v192 c0,17.673,14.327,32,32,32s32-14.327,32-32V288h192c17.673,0,32-14.327,32-32S497.673,224,480,224z" fill="#ffffff" /> <path d="M480,224H288V32c0-17.673-14.327-32-32-32s-32,14.327-32,32v192H32c-17.673,0-32,14.327-32,32s14.327,32,32,32h192v192 c0,17.673,14.327,32,32,32s32-14.327,32-32V288h192c17.673,0,32-14.327,32-32S497.673,224,480,224z" fill="#ffffff" />
</svg> </svg>
</a> </a>
@endif @endif
@if (auth()->user()->rol->nombre === 'super' || auth()->user()->rol->nombre === 'administrador') @if (auth()->user()->rol->nombre === 'super' || auth()->user()->rol->nombre === 'administrador')
<a x-on:click="modTarifas = true" class="justify-center flex px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8]">Mod. <a x-on:click="modTarifas = true" class="justify-center flex px-4 py-2 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8]">Mod.
tarifas promos tarifas promos
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" class="w-4 ml-2" x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" class="w-4 ml-2" x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve">
<polygon points="14.604 5.687 0 20.29 0 24 3.71 24 18.313 9.396 14.604 5.687" fill="#ffffff" data-original="#000000" /> <polygon points="14.604 5.687 0 20.29 0 24 3.71 24 18.313 9.396 14.604 5.687" fill="#ffffff" data-original="#000000" />
<path d="M23.232.768a2.624,2.624,0,0,0-3.71,0l-3.5,3.505,3.709,3.709,3.5-3.5A2.624,2.624,0,0,0,23.232.768Z" fill="#ffffff" data-original="#000000" /> <path d="M23.232.768a2.624,2.624,0,0,0-3.71,0l-3.5,3.505,3.709,3.709,3.5-3.5A2.624,2.624,0,0,0,23.232.768Z" fill="#ffffff" data-original="#000000" />
</svg> </svg>
</a> </a>
@endif @endif
</div> </div>
</div> </div>
@@ -72,9 +72,9 @@
<x-primary-table> <x-primary-table>
<x-slot name="thead"> <x-slot name="thead">
<tr class="text-left"> <tr class="text-left">
@if (auth()->user()->rol_id == 5) @if (auth()->user()->rol_id == 5)
<th class="rounded-l-lg px-6 py-2">Subvendedor</th> <th class="rounded-l-lg px-6 py-2">Subvendedor</th>
@endif @endif
<th class="rounded-l-lg font-normal">Nombre</th> <th class="rounded-l-lg font-normal">Nombre</th>
<th class="font-normal">Email</th> <th class="font-normal">Email</th>
<th class="font-normal">Rol</th> <th class="font-normal">Rol</th>
@@ -87,74 +87,74 @@
</x-slot> </x-slot>
<x-slot name="tbody"> <x-slot name="tbody">
@foreach ($usuarios as $usuario) @foreach ($usuarios as $usuario)
<tr class="border-gray-200 text-left" x-data="{ openOption: false }"> <tr class="border-gray-200 text-left" x-data="{ openOption: false }">
@if (auth()->user()->rol_id == 5) @if (auth()->user()->rol_id == 5)
<td>{{ $usuario->subvendedor_relacion->name ?? 'N/A' }}</td> <td>{{ $usuario->subvendedor_relacion->name ?? 'N/A' }}</td>
@endif @endif
<td>{{ $usuario->name ?? '' }}</td> <td>{{ $usuario->name ?? '' }}</td>
<td>{{ $usuario->email ?? '' }}</td> <td>{{ $usuario->email ?? '' }}</td>
<td>{{ $usuario->rol->nombre ?? '' }}</td> <td>{{ $usuario->rol->nombre ?? '' }}</td>
<td>{{ $usuario->historiales_venta_count ?? '' }}</td> <td>{{ $usuario->historiales_venta_count ?? '' }}</td>
<td>{{ number_format($usuario->saldo->valor ?? 0) ?? 0 }}</td> <td>{{ number_format($usuario->saldo->valor ?? 0) ?? 0 }}</td>
<td> <td>
<p> <p>
<span>Tarifas: <span class="font-bold">{{ $usuario->countActiveTarifas() ?? 0 }}</span></span>, <span>Tarifas: <span class="font-bold">{{ $usuario->countActiveTarifas() ?? 0 }}</span></span>,
<span>Promos: <span class="font-bold">{{ $usuario->countActivePromos() ?? 0 }}</span> </span> <span>Promos: <span class="font-bold">{{ $usuario->countActivePromos() ?? 0 }}</span> </span>
</p> </p>
</td> </td>
<td> <td>
@if (auth()->user()->rol->nombre == 'super')
<button wire:click="saldo({{ $usuario->id }})" class="justify-center text-sm flex px-2 py-1 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-0 md:mb-0">Recargar</button>
@else
@if (Auth::user()->subvendedor)
<button wire:click="saldo({{ $usuario->id }})" class="justify-center text-sm flex px-2 py-1 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-0 md:mb-0">Recargar</button>
@endif
@endif
</td>
@if (auth()->user()->rol->nombre == 'super') @if (auth()->user()->rol->nombre == 'super')
<td> <button wire:click="saldo({{ $usuario->id }})" class="justify-center text-sm flex px-2 py-1 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-0 md:mb-0">Recargar</button>
<button x-on:click="openOption=!openOption"> @else
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 cursor-pointer"> @if (Auth::user()->subvendedor)
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" /> <button wire:click="saldo({{ $usuario->id }})" class="justify-center text-sm flex px-2 py-1 rounded-lg cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8] mb-0 md:mb-0">Recargar</button>
</svg>
</button>
<div x-cloak x-show="openOption" @click.away="openOption = false" class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg right-10">
<button x-on:click="openOption=false" wire:click="editar({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Editar</button>
<button x-on:click="openOption=!openOption" wire:click="editarPassword({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Editar password</button>
<button x-on:click="openOption=false" wire:click="saldo({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Agregar saldo</button>
<button x-on:click="openOption=false" wire:click="saldodesc({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Descontar saldo</button>
<button x-on:click="openOption=false,gestion=true" wire:click="gestionar({{ $usuario->id }},'{{ $usuario->rol_id }}','{{ $usuario->name }}')" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Precio servicio</button>
<button x-on:click="openOption=false,gestionPromo=true" wire:click="gestionarPromociones({{ $usuario->id }},'{{ $usuario->name }}')" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Precio promocion</button>
<button x-on:click="openOption=false" wire:click="eliminar({{ $usuario->id }})" class="text-white w-full py-1 bg-red-400 rounded-b-[1rem] hover:bg-red-600 hover:rounded-b-[1rem]">Eliminar</button>
</div>
</td>
@elseif (Auth::user()->subvendedor)
<td>
<button x-on:click="openOption=!openOption">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg>
</button>
<div x-cloak x-show="openOption" @click.away="openOption = false" class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg right-10">
<button x-on:click="openOption=false" wire:click="editar({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Editar</button>
<button x-on:click="openOption=!openOption" wire:click="editarPassword({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Editar password</button>
@if ($usuario->subvendedor)
<button x-on:click="openOption=!openOption" wire:click="quitarSubvendedor({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Quitar subvendedor</button>
@else
<button x-on:click="openOption=!openOption" wire:click="ponerSubvendedor({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Habilitar subvendedor</button>
@endif
<button x-on:click="openOption=false,gestion=true" wire:click="gestionar({{ $usuario->id }},'{{ $usuario->rol_id }}','{{ $usuario->name }}')" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Precio servicio</button>
<button x-on:click="openOption=false,gestionPromo=true" wire:click="gestionarPromociones({{ $usuario->id }},'{{ $usuario->name }}')" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Precio promocion</button>
<button x-on:click="openOption=false" wire:click="eliminar({{ $usuario->id }})" class="text-white w-full py-1 bg-red-400 rounded-b-[1rem] hover:bg-red-600 hover:rounded-b-[1rem]">Eliminar</button>
</div>
</td>
@else
@endif @endif
</tr> @endif
</td>
@if (auth()->user()->rol->nombre == 'super')
<td>
<button x-on:click="openOption=!openOption">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg>
</button>
<div x-cloak x-show="openOption" @click.away="openOption = false" class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg right-10">
<button x-on:click="openOption=false" wire:click="editar({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Editar</button>
<button x-on:click="openOption=!openOption" wire:click="editarPassword({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Editar password</button>
<button x-on:click="openOption=false" wire:click="saldo({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Agregar saldo</button>
<button x-on:click="openOption=false" wire:click="saldodesc({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Descontar saldo</button>
<button x-on:click="openOption=false,gestion=true" wire:click="gestionar({{ $usuario->id }},'{{ $usuario->rol_id }}','{{ $usuario->name }}')" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Precio servicio</button>
<button x-on:click="openOption=false,gestionPromo=true" wire:click="gestionarPromociones({{ $usuario->id }},'{{ $usuario->name }}')" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Precio promocion</button>
<button x-on:click="openOption=false" wire:click="eliminar({{ $usuario->id }})" class="text-white w-full py-1 bg-red-400 rounded-b-[1rem] hover:bg-red-600 hover:rounded-b-[1rem]">Eliminar</button>
</div>
</td>
@elseif (Auth::user()->subvendedor)
<td>
<button x-on:click="openOption=!openOption">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6 cursor-pointer">
<path stroke-linecap="round" stroke-linejoin="round" d="M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z" />
</svg>
</button>
<div x-cloak x-show="openOption" @click.away="openOption = false" class="sm:absolute bg-white text-center w-[8rem] rounded-[1rem] border-b border-gray-200 shadow-lg right-10">
<button x-on:click="openOption=false" wire:click="editar({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300 hover:rounded-t-[1rem]">Editar</button>
<button x-on:click="openOption=!openOption" wire:click="editarPassword({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Editar password</button>
@if ($usuario->subvendedor)
<button x-on:click="openOption=!openOption" wire:click="quitarSubvendedor({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Quitar subvendedor</button>
@else
<button x-on:click="openOption=!openOption" wire:click="ponerSubvendedor({{ $usuario->id }})" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Habilitar subvendedor</button>
@endif
<button x-on:click="openOption=false,gestion=true" wire:click="gestionar({{ $usuario->id }},'{{ $usuario->rol_id }}','{{ $usuario->name }}')" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Precio servicio</button>
<button x-on:click="openOption=false,gestionPromo=true" wire:click="gestionarPromociones({{ $usuario->id }},'{{ $usuario->name }}')" class="text-gray-500 w-full py-1 hover:bg-gray-200 border-b border-gray-300">Precio promocion</button>
<button x-on:click="openOption=false" wire:click="eliminar({{ $usuario->id }})" class="text-white w-full py-1 bg-red-400 rounded-b-[1rem] hover:bg-red-600 hover:rounded-b-[1rem]">Eliminar</button>
</div>
</td>
@else
@endif
</tr>
@endforeach @endforeach
</x-slot> </x-slot>
<x-slot name="tlink"> <x-slot name="tlink">
@@ -185,17 +185,17 @@
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<option value="" selected>Tarifas</option> <option value="" selected>Tarifas</option>
@if (!empty($consulta_tarifas)) @if (!empty($consulta_tarifas))
@foreach ($consulta_tarifas as $consulta_tarifa) @foreach ($consulta_tarifas as $consulta_tarifa)
@if ($consulta_tarifa->servicio && $consulta_tarifa->servicio->por_tiempo) @if ($consulta_tarifa->servicio && $consulta_tarifa->servicio->por_tiempo)
<option value="{{ $consulta_tarifa->id }}"> <option value="{{ $consulta_tarifa->id }}">
{{ $consulta_tarifa->servicio->nombre ?? '' }}: {{ $consulta_tarifa->dias ?? '' }} {{ $consulta_tarifa->dias == 1 ? 'día' : 'días' }} {{ $consulta_tarifa->servicio->nombre ?? '' }}: {{ $consulta_tarifa->dias ?? '' }} {{ $consulta_tarifa->dias == 1 ? 'día' : 'días' }}
</option> </option>
@elseif ($consulta_tarifa->servicio) @elseif ($consulta_tarifa->servicio)
<option value="{{ $consulta_tarifa->id }}"> <option value="{{ $consulta_tarifa->id }}">
{{ $consulta_tarifa->servicio->nombre ?? '' }}: {{ $consulta_tarifa->pantallas ?? '' }} {{ $consulta_tarifa->pantallas == 1 ? 'pantalla' : 'pantallas' }} - {{ $consulta_tarifa->dias ?? '' }} {{ $consulta_tarifa->dias == 1 ? 'día' : 'días' }} {{ $consulta_tarifa->servicio->nombre ?? '' }}: {{ $consulta_tarifa->pantallas ?? '' }} {{ $consulta_tarifa->pantallas == 1 ? 'pantalla' : 'pantallas' }} - {{ $consulta_tarifa->dias ?? '' }} {{ $consulta_tarifa->dias == 1 ? 'día' : 'días' }}
</option> </option>
@endif @endif
@endforeach @endforeach
@endif @endif
</select> </select>
</div> </div>
@@ -221,9 +221,9 @@
@if (auth()->user()->rol->nombre === 'super' || auth()->user()->rol->nombre === 'administrador') @if (auth()->user()->rol->nombre === 'super' || auth()->user()->rol->nombre === 'administrador')
<input placeholder="$12000" type="number" id="utilidad" wire:model="utilidad" min="0" class="w-1/2 border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> <input placeholder="$12000" type="number" id="utilidad" wire:model="utilidad" min="0" class="w-1/2 border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@else @else
<input disabled placeholder="$12000" type="number" id="utilidad" wire:model="utilidad" min="0" class="w-1/2 border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> <input disabled placeholder="$12000" type="number" id="utilidad" wire:model="utilidad" min="0" class="w-1/2 border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@endif @endif
<span> <span>
@@ -246,61 +246,61 @@
</thead> </thead>
<tbody class="text-gray-400 select-none"> <tbody class="text-gray-400 select-none">
@if (!empty($consulta_usuarioTarifas)) @if (!empty($consulta_usuarioTarifas))
@foreach ($consulta_usuarioTarifas as $usuarioTarifa) @foreach ($consulta_usuarioTarifas as $usuarioTarifa)
<tr class="border-gray-200 text-left w-full pl-4"> <tr class="border-gray-200 text-left w-full pl-4">
<td class="pl-[2rem]">{{ $usuarioTarifa->tarifa->servicio->nombre ?? '' }} <td class="pl-[2rem]">{{ $usuarioTarifa->tarifa->servicio->nombre ?? '' }}
</td> </td>
<td class="pl-[2rem]"> <td class="pl-[2rem]">
@if ($usuarioTarifa->tarifa) @if ($usuarioTarifa->tarifa)
@if ($usuarioTarifa->tarifa->servicio && $usuarioTarifa->tarifa->servicio->por_tiempo) @if ($usuarioTarifa->tarifa->servicio && $usuarioTarifa->tarifa->servicio->por_tiempo)
{{ $usuarioTarifa->tarifa->dias ?? '' }} {{ $usuarioTarifa->tarifa->dias ?? '' }}
{{ $usuarioTarifa->tarifa->dias == 1 ? 'día' : 'días' }} {{ $usuarioTarifa->tarifa->dias == 1 ? 'día' : 'días' }}
@else @else
{{ $usuarioTarifa->tarifa->pantallas ?? '' }} {{ $usuarioTarifa->tarifa->pantallas ?? '' }}
{{ $usuarioTarifa->tarifa->pantallas == 1 ? 'pantalla' : 'pantallas' }} {{ $usuarioTarifa->tarifa->pantallas == 1 ? 'pantalla' : 'pantallas' }}
- {{ $usuarioTarifa->tarifa->dias ?? '' }} - {{ $usuarioTarifa->tarifa->dias ?? '' }}
{{ $usuarioTarifa->tarifa->dias == 1 ? 'día' : 'días' }} {{ $usuarioTarifa->tarifa->dias == 1 ? 'día' : 'días' }}
@endif @endif
@else @else
{{ 'Tarifa no disponible' }} {{ 'Tarifa no disponible' }}
@endif @endif
</td> </td>
@if ($usuarioTarifa->visible !== 'true') @if ($usuarioTarifa->visible !== 'true')
<td class="pl-[2rem] flex"><input type="checkbox" disabled readonly <td class="pl-[2rem] flex"><input type="checkbox" disabled readonly
checked class="mx-auto p-2 rounded-full text-black"></td> checked class="mx-auto p-2 rounded-full text-black"></td>
@else @else
<td class="pl-[2rem] flex"><input type="checkbox" disabled readonly <td class="pl-[2rem] flex"><input type="checkbox" disabled readonly
class="mx-auto p-2 rounded-full text-black"></td> class="mx-auto p-2 rounded-full text-black"></td>
@endif @endif
<td class="pl-[2rem]">${{ $usuarioTarifa->precio ?? '' }}</td> <td class="pl-[2rem]">${{ $usuarioTarifa->precio ?? '' }}</td>
<td class="pl-[2rem]">${{ $usuarioTarifa->utilidad ?? '' }}</td> <td class="pl-[2rem]">${{ $usuarioTarifa->utilidad ?? '' }}</td>
<td class="pl-[1rem] pr-[1rem]"> <td class="pl-[1rem] pr-[1rem]">
<svg wire:click="eliminarUsuarioTarifa({{ $usuarioTarifa->id }})" <svg wire:click="eliminarUsuarioTarifa({{ $usuarioTarifa->id }})"
xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns="http://www.w3.org/2000/svg" version="1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svgjs="http://svgjs.com/svgjs" class="w-6 cursor-pointer" x="0" xmlns:svgjs="http://svgjs.com/svgjs" class="w-6 cursor-pointer" x="0"
y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512"
xml:space="preserve"> xml:space="preserve">
<g> <g>
<g id="Flat_Color" data-name="Flat Color"> <g id="Flat_Color" data-name="Flat Color">
<circle cx="12" cy="12" fill="#e63946" r="10" <circle cx="12" cy="12" fill="#e63946" r="10"
data-original="#e63946" class=""> data-original="#e63946" class="">
</circle> </circle>
<path <path
d="m13.41 12 2.3-2.29a1 1 0 0 0 -1.42-1.42l-2.29 2.3-2.29-2.3a1 1 0 0 0 -1.42 1.42l2.3 2.29-2.3 2.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l2.29-2.3 2.29 2.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z" d="m13.41 12 2.3-2.29a1 1 0 0 0 -1.42-1.42l-2.29 2.3-2.29-2.3a1 1 0 0 0 -1.42 1.42l2.3 2.29-2.3 2.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l2.29-2.3 2.29 2.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"
fill="#edebea" data-original="#edebea" class=""> fill="#edebea" data-original="#edebea" class="">
</path> </path>
</g> </g>
</g> </g>
</svg> </svg>
</td> </td>
</tr> </tr>
@endforeach @endforeach
@endif @endif
</tbody> </tbody>
</table> </table>
@@ -339,12 +339,12 @@
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<option value="" selected>Promociones</option> <option value="" selected>Promociones</option>
@if (!empty($consulta_promo)) @if (!empty($consulta_promo))
@foreach ($consulta_promo as $promocion) @foreach ($consulta_promo as $promocion)
@if (!empty($promocion->nombre)) @if (!empty($promocion->nombre))
<option value="{{ $promocion->id }}">{{ $promocion->nombre ?? '' }} <option value="{{ $promocion->id }}">{{ $promocion->nombre ?? '' }}
</option> </option>
@endif @endif
@endforeach @endforeach
@endif @endif
</select> </select>
@@ -367,9 +367,9 @@
Utilidad Utilidad
</p> </p>
@if (auth()->user()->rol->nombre === 'super' || auth()->user()->rol->nombre === 'administrador') @if (auth()->user()->rol->nombre === 'super' || auth()->user()->rol->nombre === 'administrador')
<input placeholder="$12000" type="number" id="utilidad" wire:model="utilidad" min="0" class="w-1/2 border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> <input placeholder="$12000" type="number" id="utilidad" wire:model="utilidad" min="0" class="w-1/2 border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@else @else
<input disabled placeholder="$12000" type="number" id="utilidad" wire:model="utilidad" min="0" class="w-1/2 border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> <input disabled placeholder="$12000" type="number" id="utilidad" wire:model="utilidad" min="0" class="w-1/2 border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@endif @endif
<span> <span>
<button wire:click="addpromos" type="button" <button wire:click="addpromos" type="button"
@@ -391,43 +391,43 @@
<tbody class="text-gray-400 select-none"> <tbody class="text-gray-400 select-none">
@if (!empty($consulta_usuarioPromo)) @if (!empty($consulta_usuarioPromo))
@foreach ($consulta_usuarioPromo as $usuarioPromo) @foreach ($consulta_usuarioPromo as $usuarioPromo)
<tr class="border-gray-200 text-left w-full pl-4"> <tr class="border-gray-200 text-left w-full pl-4">
<td class="pl-[2rem]">{{ $usuarioPromo->promocion->nombre ?? '' }}</td> <td class="pl-[2rem]">{{ $usuarioPromo->promocion->nombre ?? '' }}</td>
@if ($usuarioPromo->visible != 'true') @if ($usuarioPromo->visible != 'true')
<td class="pl-[2rem] flex"><input type="checkbox" disabled readonly <td class="pl-[2rem] flex"><input type="checkbox" disabled readonly
checked class="mx-auto p-2 rounded-full text-black"></td> checked class="mx-auto p-2 rounded-full text-black"></td>
@else @else
<td class="pl-[2rem] flex"><input type="checkbox" disabled readonly <td class="pl-[2rem] flex"><input type="checkbox" disabled readonly
class="mx-auto p-2 rounded-full text-black"></td> class="mx-auto p-2 rounded-full text-black"></td>
@endif @endif
<td class="pl-[2rem]">${{ $usuarioPromo->precio ?? '' }}</td> <td class="pl-[2rem]">${{ $usuarioPromo->precio ?? '' }}</td>
<td class="pl-[2rem]">${{ $usuarioPromo->utilidad ?? '' }}</td> <td class="pl-[2rem]">${{ $usuarioPromo->utilidad ?? '' }}</td>
<td class="pl-[1rem] pr-[1rem]"> <td class="pl-[1rem] pr-[1rem]">
<svg wire:click="eliminarUsuarioPromo({{ $usuarioPromo->id }})" <svg wire:click="eliminarUsuarioPromo({{ $usuarioPromo->id }})"
xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns="http://www.w3.org/2000/svg" version="1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svgjs="http://svgjs.com/svgjs" class="w-6 cursor-pointer" x="0" xmlns:svgjs="http://svgjs.com/svgjs" class="w-6 cursor-pointer" x="0"
y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512"
xml:space="preserve"> xml:space="preserve">
<g> <g>
<g id="Flat_Color" data-name="Flat Color"> <g id="Flat_Color" data-name="Flat Color">
<circle cx="12" cy="12" fill="#e63946" r="10" <circle cx="12" cy="12" fill="#e63946" r="10"
data-original="#e63946" class=""> data-original="#e63946" class="">
</circle> </circle>
<path <path
d="m13.41 12 2.3-2.29a1 1 0 0 0 -1.42-1.42l-2.29 2.3-2.29-2.3a1 1 0 0 0 -1.42 1.42l2.3 2.29-2.3 2.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l2.29-2.3 2.29 2.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z" d="m13.41 12 2.3-2.29a1 1 0 0 0 -1.42-1.42l-2.29 2.3-2.29-2.3a1 1 0 0 0 -1.42 1.42l2.3 2.29-2.3 2.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l2.29-2.3 2.29 2.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"
fill="#edebea" data-original="#edebea" class=""> fill="#edebea" data-original="#edebea" class="">
</path> </path>
</g> </g>
</g> </g>
</svg> </svg>
</td> </td>
</tr> </tr>
@endforeach @endforeach
@endif @endif
</tbody> </tbody>
@@ -445,132 +445,136 @@
</div> </div>
{{-- Añadir usuario --}} {{-- Añadir usuario --}}
<div x-cloak x-show="add" <div x-cloak x-show="add"
x-transition:enter="transition duration-350" x-transition:enter="transition duration-350"
x-transition:enter-start="opacity-0 scale-100" x-transition:enter-start="opacity-0 scale-100"
x-transition:enter-end="opacity-100 scale-100" x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition duration-350" x-transition:leave="transition duration-350"
x-transition:leave-start="opacity-100 scale-100" x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-100"
class="fixed inset-0 z-50 backdrop-blur-sm bg-black/20">
<div class="grid h-full place-items-center">
<form>
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md w-[20rem] sm:w-[24rem]">
<!-- Nombre -->
<div class="mb-4">
<label for="nombre" class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label>
<input type="text" id="nombre" wire:model="nombre"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow appearance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('nombre')
<span class="text-red-400 text-sm">Requerido*</span>
@enderror
</div>
<!-- Email -->
<div class="mb-4">
<label for="email" class="block text-gray-700 text-sm font-bold mb-2">Email:</label>
<input type="text" id="email" wire:model="email"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow appearance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('email')
<span class="text-red-400 text-sm">Requerido*</span>
@enderror
</div>
<!-- Contraseña -->
<div class="mb-4">
<label for="password" class="block text-gray-700 text-sm font-bold mb-2">Contraseña:</label>
<input type="text" id="password" wire:model="password"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow appearance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('password')
<span class="text-red-400 text-sm">Requerido*</span>
@enderror
</div>
<!-- Rol -->
<div class="mb-4">
<label for="estado_promocion" class="block text-gray-700 text-sm font-bold mb-2">Selecciona rol:</label>
<select id="estado_promocion" wire:model="rol"
class="w-full border-2 border-neutral-200 rounded-[0.8rem] shadow appearance-none ring-0 focus:ring-0 focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<option selected>Rol</option>
@foreach ($roles as $rol)
<option value="{{ $rol->id }}">{{ $rol->nombre }}</option>
@endforeach
</select>
@error('rol')
<span class="text-red-400 text-sm">Requerido*</span>
@enderror
</div>
<!-- Botones -->
<div class="px-4 py-3 sm:px-6 flex flex-col sm:flex-row-reverse sm:justify-evenly gap-3 mt-4">
<button wire:click="crear" type="button"
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out text-sm">
Guardar
</button>
<button wire:click="limpiarInputAdd" type="button"
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] ease-in-out text-sm">
Cerrar
</button>
</div>
</div>
</form>
</div>
</div>
{{-- editar usuario --}}
<div x-cloak x-show="editar" x-transition:enter="transition duration-350"
x-transition:enter-start="opacity-0 scale-100" x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition duration-350" x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-100" x-transition:leave-end="opacity-0 scale-100"
class="absolute backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full"> class="fixed inset-0 z-50 backdrop-blur-sm bg-black/20">
<div class="grid h-full place-items-center "> <div class="grid h-full place-items-center">
<form> <form>
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md"> <div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md w-[20rem] sm:w-[24rem]">
<!-- Nombre -->
<div class="mb-4"> <div class="mb-4">
<label for="nombre_edit" <label for="nombre" class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label>
class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label> <input type="text" id="nombre" wire:model="nombre"
<input type="text" id="nombre_edit" wire:model="nombre_edit" class="border-2 border-neutral-200 rounded-[0.8rem] shadow appearance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> @error('nombre')
@error('nombre_edit') <span class="text-red-400 text-sm">Requerido*</span>
<span class="text-red-400 text-sm ">Requerido*</span>
@enderror @enderror
</div> </div>
<!-- Email -->
<div class="mb-4">
<label for="email" class="block text-gray-700 text-sm font-bold mb-2">Email:</label>
<input type="text" id="email" wire:model="email"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow appearance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('email')
<span class="text-red-400 text-sm">Requerido*</span>
@enderror
</div>
<!-- Contraseña -->
<div class="mb-4">
<label for="password" class="block text-gray-700 text-sm font-bold mb-2">Contraseña:</label>
<input type="text" id="password" wire:model="password"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow appearance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('password')
<span class="text-red-400 text-sm">Requerido*</span>
@enderror
</div>
<!-- Rol -->
<div class="mb-4">
<label for="estado_promocion" class="block text-gray-700 text-sm font-bold mb-2">Selecciona rol:</label>
<select id="estado_promocion" wire:model="rol"
class="w-full border-2 border-neutral-200 rounded-[0.8rem] shadow appearance-none ring-0 focus:ring-0 focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<option selected>Rol</option>
@foreach ($roles as $rol)
<option value="{{ $rol->id }}">{{ $rol->nombre }}</option>
@endforeach
</select>
@error('rol')
<span class="text-red-400 text-sm">Requerido*</span>
@enderror
</div>
<!-- Botones -->
<div class="px-4 py-3 sm:px-6 flex flex-col sm:flex-row-reverse sm:justify-evenly gap-3 mt-4">
<button wire:click="crear" type="button"
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out text-sm">
Guardar
</button>
<button wire:click="limpiarInputAdd" type="button"
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] ease-in-out text-sm">
Cerrar
</button>
</div>
</div>
</form>
</div>
</div>
{{-- Editar usuario --}}
<div x-cloak x-show="editar"
x-transition:enter="transition duration-350"
x-transition:enter-start="opacity-0 scale-100"
x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition duration-350"
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-100"
class="fixed inset-0 z-50 backdrop-blur-sm bg-black/20">
<div class="grid h-full place-items-center">
<form>
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md w-[20rem] sm:w-[24rem]">
<!-- Nombre -->
<div class="mb-4">
<label for="nombre_edit" class="block text-gray-700 text-sm font-bold mb-2">Nombre:</label>
<input type="text" id="nombre_edit" wire:model="nombre_edit"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow appearance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('nombre_edit')
<span class="text-red-400 text-sm">Requerido*</span>
@enderror
</div>
<!-- Email -->
<div class="mb-4"> <div class="mb-4">
<label for="email_edit" class="block text-gray-700 text-sm font-bold mb-2">Email:</label> <label for="email_edit" class="block text-gray-700 text-sm font-bold mb-2">Email:</label>
<input type="text" id="email_edit" wire:model="email_edit" <input type="text" id="email_edit" wire:model="email_edit"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> class="border-2 border-neutral-200 rounded-[0.8rem] shadow appearance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('email_edit') @error('email_edit')
<span class="text-red-400 text-sm ">Requerido*</span> <span class="text-red-400 text-sm">Requerido*</span>
@enderror @enderror
</div> </div>
<!-- Rol -->
<div class="mb-4"> <div class="mb-4">
<label class="select-none text-gray-700 text-sm font-bold mb-2">Selecciona rol:</label> <label for="rol_edit" class="block text-gray-700 text-sm font-bold mb-2">Selecciona rol:</label>
<select name="rol_edit" id="rol_edit" wire:model="rol_edit" <select id="rol_edit" wire:model="rol_edit"
class="w-full border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none ring-0 focus:ring-0 focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> class="w-full border-2 border-neutral-200 rounded-[0.8rem] shadow appearance-none ring-0 focus:ring-0 focus:border-neutral-300 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<option selected>Rol</option> <option selected disabled>Rol</option>
@foreach ($roles as $rol) @foreach ($roles as $rol)
<option value="{{ $rol->id }}">{{ $rol->nombre }}</option> <option value="{{ $rol->id }}">{{ $rol->nombre }}</option>
@endforeach @endforeach
</select> </select>
@error('rol_edit') @error('rol_edit')
<span class="text-red-400 text-sm ">Requerido*</span> <span class="text-red-400 text-sm">Requerido*</span>
@enderror @enderror
</div> </div>
<div <!-- Botones -->
class="bg-white px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse sm:justify-evenly gap-5 mt-4"> <div class="px-4 py-3 sm:px-6 flex flex-col sm:flex-row-reverse sm:justify-evenly gap-3 mt-4">
<span> <button wire:click="actualizar" type="button"
<button wire:click="actualizar" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out text-sm">
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button> Guardar
</span> </button>
<span> <button wire:click="limpiarInputEdit" type="button"
<button wire:click="limpiarInputEdit" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] ease-in-out text-sm">
class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 text-white bg-[#585858] hover:bg-[#3a3a3a] ease-in-out sm-text-sm sm-leading-5">Cerrar</button> Cerrar
</span> </button>
</div> </div>
</div> </div>
</form> </form>
@@ -595,7 +599,7 @@
<input type="text" id="newPassword" wire:model="newPassword" <input type="text" id="newPassword" wire:model="newPassword"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:ring-0 focus:border-neutral-300 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
@error('newPassword') @error('newPassword')
<span class="error text-red-400">{{ 'Diligencie correctamente*' }}</span> <span class="error text-red-400">{{ 'Diligencie correctamente*' }}</span>
@enderror @enderror
</div> </div>
@@ -640,12 +644,12 @@
<div class="flex text-sm justify-center">Tu valor total seria: $<p> <div class="flex text-sm justify-center">Tu valor total seria: $<p>
@php @php
$valor_recargar = str_replace([',', '.'], '', $valor_recargar); $valor_recargar = str_replace([',', '.'], '', $valor_recargar);
@endphp @endphp
@if (!empty($valor_recargar)) @if (!empty($valor_recargar))
{{ number_format((int) $saldo_actual + (int) $valor_recargar) }} {{ number_format((int) $saldo_actual + (int) $valor_recargar) }}
@else @else
{{ number_format((int) $saldo_actual) }} {{ number_format((int) $saldo_actual) }}
@endif @endif
</p> </p>
</div> </div>
@@ -654,11 +658,11 @@
<div class="bg-white px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse sm:justify-evenly gap-5 mt-4"> <div class="bg-white px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse sm:justify-evenly gap-5 mt-4">
<span> <span>
@if (auth()->user()->rol->nombre === 'administrador' || auth()->user()->rol->nombre === 'super') @if (auth()->user()->rol->nombre === 'administrador' || auth()->user()->rol->nombre === 'super')
<button wire:click="addSaldo" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button> <button wire:click="addSaldo" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button>
@else @else
@if (Auth::user()->subvendedor) @if (Auth::user()->subvendedor)
<button wire:click="addSaldoSubvendedor" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button> <button wire:click="addSaldoSubvendedor" type="button" class="inline-flex justify-center w-full rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Guardar</button>
@endif @endif
@endif @endif
</span> </span>
<span> <span>
@@ -733,7 +737,7 @@
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-[72%] sm:w-60 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-[72%] sm:w-60 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<option value="" selected>Promociones</option> <option value="" selected>Promociones</option>
@foreach ($promo as $servicio) @foreach ($promo as $servicio)
<option value="{{ $servicio->id }}">{{ $servicio->nombre ?? '' }}</option> <option value="{{ $servicio->id }}">{{ $servicio->nombre ?? '' }}</option>
@endforeach @endforeach
</select> </select>
@@ -746,7 +750,7 @@
class="w-full border-2 border-neutral-200 rounded-lg focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> class="w-full border-2 border-neutral-200 rounded-lg focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<option value="" selected>Roles</option> <option value="" selected>Roles</option>
@foreach ($roles as $rol) @foreach ($roles as $rol)
<option value="{{ $rol->id }}">{{ $rol->nombre ?? '' }}</option> <option value="{{ $rol->id }}">{{ $rol->nombre ?? '' }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
@@ -792,24 +796,24 @@
</thead> </thead>
<tbody class="text-gray-500 select-none"> <tbody class="text-gray-500 select-none">
@if (!empty($tarifas)) @if (!empty($tarifas))
@foreach ($tarifas as $tarifa) @foreach ($tarifas as $tarifa)
<tr class="border-gray-200 text-left w-full pl-4"> <tr class="border-gray-200 text-left w-full pl-4">
<td class="pl-[1rem]"> <td class="pl-[1rem]">
@if ($tarifa->visible == 'activo') @if ($tarifa->visible == 'activo')
<div class="bg-green-500 rounded-full w-3 h-3"></div> <div class="bg-green-500 rounded-full w-3 h-3"></div>
@else @else
<div class="bg-red-500 rounded-full w-3 h-3"></div> <div class="bg-red-500 rounded-full w-3 h-3"></div>
@endif @endif
</td> </td>
<td class="pl-[1rem]">{{ $tarifa->rol->nombre ?? '' }}</td> <td class="pl-[1rem]">{{ $tarifa->rol->nombre ?? '' }}</td>
<td class="pl-[1rem]">{{ number_format($tarifa->precio) ?? 0 }}</td> <td class="pl-[1rem]">{{ number_format($tarifa->precio) ?? 0 }}</td>
<td class="pl-[1rem]">{{ number_format($tarifa->utilidad) ?? 0 }}</td> <td class="pl-[1rem]">{{ number_format($tarifa->utilidad) ?? 0 }}</td>
<td class="pl-[1rem]"> <td class="pl-[1rem]">
<button wire:click="editarTarifa({{ $tarifa }})" <button wire:click="editarTarifa({{ $tarifa }})"
class="justify-center flex px-3 py-2 rounded-lg text-xs cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8]">Editar</button> class="justify-center flex px-3 py-2 rounded-lg text-xs cursor-pointer text-white bg-[#B221FD] hover:bg-[#7a02b8]">Editar</button>
</td> </td>
</tr> </tr>
@endforeach @endforeach
@endif @endif
</tbody> </tbody>
</table> </table>
@@ -834,48 +838,48 @@
<div class="grid h-full place-items-center"> <div class="grid h-full place-items-center">
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md"> <div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4 rounded-[1rem] shadow-md">
@if ($informacionTarifaRol) @if ($informacionTarifaRol)
<div> <div>
<label class="block text-gray-700 text-sm font-bold mb-2">Pantallas:</label> <label class="block text-gray-700 text-sm font-bold mb-2">Pantallas:</label>
<div class="grid grid-cols-3 gap-2 text-left mb-4"> <div class="grid grid-cols-3 gap-2 text-left mb-4">
<div class="w-[6rem]"> <div class="w-[6rem]">
<label class="text-gray-500 text-sm">Rol</label> <label class="text-gray-500 text-sm">Rol</label>
<select name="roles" id="roles" <select name="roles" id="roles"
wire:model.debounce.500ms="roles_modTarifas" wire:model.debounce.500ms="roles_modTarifas"
class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"> class="border-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<option value="" selected>Roles</option> <option value="" selected>Roles</option>
@foreach ($roles as $rol) @foreach ($roles as $rol)
<option value="{{ $rol->id }}">{{ $rol->nombre ?? '' }}</option> <option value="{{ $rol->id }}">{{ $rol->nombre ?? '' }}</option>
@endforeach @endforeach
</select> </select>
</div>
<div class="w-[6rem]">
<label class="text-gray-500 text-sm">Precio</label>
<input type="number" id="precio_modTarifas" wire:model="precio_modTarifas"
min="0"
class="w-full border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
<div class="w-[6rem]">
<label class="text-gray-500 text-sm">Utilidad</label>
<input type="number" id="utilidad" wire:model="utilidad" min="0"
class="w-full border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
</div>
</div> </div>
<div class="w-[6rem]">
<div class="mb-4 grid grid-cols-2"> <label class="text-gray-500 text-sm">Precio</label>
<div class="flex m-auto items-center"> <input type="number" id="precio_modTarifas" wire:model="precio_modTarifas"
<label class="text-gray-500 text-sm mr-2">Activa</label> min="0"
<input type="checkbox" id="estadoTarifa" wire:model="estadoTarifa" class="w-full border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
class="border-2 border-neutral-200 focus:ring-0 shadow apperance-none focus:border-neutral-300 text-[#B221FD] leading-tight focus:outline-none focus:shadow-outline"> </div>
</div> <div class="w-[6rem]">
<div class="mb-3 mt-3 flex justify-end"> <label class="text-gray-500 text-sm">Utilidad</label>
<span> <input type="number" id="utilidad" wire:model="utilidad" min="0"
<button wire:click="actualizarTarifaRol('{{ $informacionTarifaRol['id'] }}')" class="w-full border-2 border-neutral-200 rounded-[0.8rem] focus:ring-0 shadow apperance-none focus:border-neutral-300 py-2 pl-2 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
type="button"
class="inline-flex justify-center w-full md:w-auto rounded-md border border-transparent px-4 py-1 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Actualizar</button>
</span>
</div>
</div> </div>
</div> </div>
<div class="mb-4 grid grid-cols-2">
<div class="flex m-auto items-center">
<label class="text-gray-500 text-sm mr-2">Activa</label>
<input type="checkbox" id="estadoTarifa" wire:model="estadoTarifa"
class="border-2 border-neutral-200 focus:ring-0 shadow apperance-none focus:border-neutral-300 text-[#B221FD] leading-tight focus:outline-none focus:shadow-outline">
</div>
<div class="mb-3 mt-3 flex justify-end">
<span>
<button wire:click="actualizarTarifaRol('{{ $informacionTarifaRol['id'] }}')"
type="button"
class="inline-flex justify-center w-full md:w-auto rounded-md border border-transparent px-4 py-1 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Actualizar</button>
</span>
</div>
</div>
</div>
@endif @endif