porfavor hacer la migracion

This commit is contained in:
Felipe
2024-03-01 10:46:35 -05:00
parent df673cbc65
commit accc509652
7 changed files with 186 additions and 111 deletions
+5 -4
View File
@@ -10,8 +10,8 @@ class ShowLogGeneral extends Component
public $entradas;
public $buscar;
public $filtro_fecha;
public $filtro_fecha;
public function render()
{
$query = Log_general::query();
@@ -23,11 +23,12 @@ class ShowLogGeneral extends Component
if ($this->filtro_fecha) {
$query->whereDate('created_at', $this->filtro_fecha);
}
$logs = $query->orderBy('id', 'desc')->paginate($this->entradas);
$logs = $query->orderBy('id', 'desc')->paginate($this->entradas);
return view('livewire.show-log-general', [
'logs' => $logs
]);
}
}
+12 -2
View File
@@ -4,6 +4,7 @@ namespace App\Http\Livewire;
use App\Models\Log_general;
use App\Models\Log_historial;
use App\Models\User;
use Livewire\Component;
class ShowLogHistorial extends Component
@@ -13,9 +14,11 @@ class ShowLogHistorial extends Component
public $buscar;
public $filtro_fecha;
public $user_id;
public function render()
{
$query = Log_general::query();
$query = Log_historial::query();
if ($this->buscar) {
$query->where('detalle', 'like', '%' . $this->buscar . '%');
@@ -25,10 +28,17 @@ class ShowLogHistorial extends Component
$query->whereDate('created_at', $this->filtro_fecha);
}
if ($this->user_id) {
$query->where('user_id', $this->user_id);
}
$logs = $query->orderBy('id', 'desc')->paginate($this->entradas);
$users = User::orderBy('name')->get();
return view('livewire.show-log-historial', [
'logs' => $logs
'logs' => $logs,
'users' => $users
]);
}
}
+22
View File
@@ -6,6 +6,7 @@ use App\Models\Cuentas;
use App\Models\Historiale;
use App\Models\Historial_cuenta;
use App\Models\Log_general;
use App\Models\Log_historial;
use App\Models\Notificacion;
use App\Models\Pendientes;
use App\Models\Role;
@@ -280,6 +281,11 @@ class ShowPlanes extends Component
$cuenta->estado = $this->estado;
$cuenta->save();
Log_historial::create([
'user_id' => Auth::user()->id,
'detalle' => 'El usuario ha creado la cuenta ' . $cuenta->correo
]);
if ($this->estado === 'activo') {
$servicioPantallas = Servicio::find($this->servicio_newCuenta)->pantallas;
@@ -487,8 +493,24 @@ class ShowPlanes extends Component
public function eliminarCuentas()
{
$cuentas = Cuentas::whereIn('id', $this->delete_1)->get();
if ($cuentas) {
forEach ($cuentas as $cuenta) {
Log_historial::create([
'user_id' => Auth::user()->id,
'detalle' => 'El usuario ha eliminado la cuenta ' . $cuenta->correo
]);
}
}
$consulta_cuentas = Cuentas::whereIn('id', $this->delete_1)->delete();
$this->alert('success', 'Cuentas eliminadas correctamente!', [
'position' => 'top'
]);
$this->delete_1 = [];
}
public function openAdd()
@@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('log_historial', function (Blueprint $table) {
$table->id();
$table->text('detalle');
$table->unsignedBigInteger('user_id');
$table->timestamps();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
}
public function down()
{
Schema::dropIfExists('log_historial');
}
};
@@ -1,28 +1,46 @@
<div class="h-full w-full md:my-2">
<div class="bg-[#f5f5f5] m-auto p-2 md:p-5 w-auto x-auto grid grid-cols-1 lg:grid-cols-1text-center rounded-xl py-4 px-2 ms:px-8 xl:mx-10 mb-8 ">
<div class="md:flex justify-center my-2 items-center text-center ">
<div
class="bg-[#f5f5f5] m-auto p-2 md:p-5 w-auto x-auto grid grid-cols-1 lg:grid-cols-1text-center rounded-xl py-4 px-2 ms:px-8 xl:mx-10 mb-8 ">
<div class="md:flex justify-center my-2 items-center text-center">
<div class="flex text-sm">
<svg class="w-4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve">
<path d="M15.4,9.88,10.81,5.29a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42L14,11.29a1,1,0,0,1,0,1.42L9.4,17.29a1,1,0,0,0,1.41,1.42l4.59-4.59A3,3,0,0,0,15.4,9.88Z" fill="#b221fd" data-original="#000000" />
<svg class="w-4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" x="0" y="0" viewBox="0 0 24 24"
style="enable-background:new 0 0 512 512" xml:space="preserve">
<path
d="M15.4,9.88,10.81,5.29a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42L14,11.29a1,1,0,0,1,0,1.42L9.4,17.29a1,1,0,0,0,1.41,1.42l4.59-4.59A3,3,0,0,0,15.4,9.88Z"
fill="#b221fd" data-original="#000000" />
</svg>
Log historial
</div>
<div class="flex relative text-sm mx-auto w-64 md:w-auto my-2">
<input id="buscar" type="search" wire:model.lazy="buscar" placeholder="Buscar" class="shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 w-64 md:w-auto rounded-[0.8rem] pr-7 py-1 m-auto focus:border-neutral-300 focus:outline-none focus:shadow-outline">
<svg class="w-5 absolute top-2 right-3" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="w-4 absolute" x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512;rotate: 90deg;" xml:space="preserve" class="">
<input id="buscar" type="search" wire:model.lazy="buscar" placeholder="Buscar"
class="shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 w-64 md:w-auto rounded-lg pr-7 py-1 m-auto focus:border-neutral-300 focus:outline-none focus:shadow-outline">
<svg class="w-5 absolute top-2 right-3" xmlns="http://www.w3.org/2000/svg" version="1.1"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" class="w-4 absolute"
x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512;rotate: 90deg;"
xml:space="preserve" class="">
<g id="Layer_31" data-name="Layer 31">
<path d="m21.71 20.29-5.4-5.39a7.92 7.92 0 0 0 1.69-4.9 8 8 0 1 0 -8 8 7.92 7.92 0 0 0 4.9-1.69l5.39 5.4a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zm-17.71-10.29a6 6 0 1 1 6 6 6 6 0 0 1 -6-6z" fill="#b221fd" data-original="#000000" class=""></path>
<path
d="m21.71 20.29-5.4-5.39a7.92 7.92 0 0 0 1.69-4.9 8 8 0 1 0 -8 8 7.92 7.92 0 0 0 4.9-1.69l5.39 5.4a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42zm-17.71-10.29a6 6 0 1 1 6 6 6 6 0 0 1 -6-6z"
fill="#b221fd" data-original="#000000" class=""></path>
</g>
</svg>
</div>
<div class="text-sm mr-auto">
<input type="date" wire:model="filtro_fecha" class="shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 w-64 md:w-auto rounded-[0.8rem] pr-7 py-1 m-auto focus:border-neutral-300 focus:outline-none focus:shadow-outline">
<select name="user_id" id="user_id" wire:model.debounce.500ms="user_id" class="w-40 mx-auto border-2 border-neutral-200 rounded-lg 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">
<option value="" selected>Todos</option>
@foreach ($users as $user)
<option value="{{ $user->id }}">{{ $user->name ?? '' }} - {{ $user->email ?? '' }}</option>
@endforeach
</select>
<div class="text-sm">
<input type="date" wire:model="filtro_fecha"
class="shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 w-64 md:w-auto rounded-lg pr-7 py-1 m-auto focus:border-neutral-300 focus:outline-none focus:shadow-outline">
</div>
</div>
<x-ver-entrada />
{{-- <x-primary-table>
<x-primary-table>
<x-slot name="thead">
<tr class="text-left">
<th class="rounded-l-lg font-normal w-1/8 pl-2 sm:w-1/8">Usuario</th>
@@ -42,6 +60,6 @@
<x-slot name="tlink">
{{ $logs->links() }}
</x-slot>
</x-primary-table> --}}
</x-primary-table>
</div>
</div>
@@ -6,9 +6,9 @@
gestionPromo: @entangle('gestionPromo'),
modalPassword: @entangle('modalPassword'),
modTarifas: @entangle('modTarifas'),
modalSaldoDesc:@entangle('modalSaldoDesc'),
modalSaldoDesc: @entangle('modalSaldoDesc'),
}" class="h-full w-full md:my-2">
<div class=" absolute backdrop-blur-sm bg-white/70 left-0 bottom-0 top-0 right-0 h-full z-40" wire:loading
<div class="absolute backdrop-blur-sm bg-white/70 left-0 bottom-0 top-0 right-0 h-full z-40" wire:loading
wire:target="gestionarPromociones,addpromos,eliminarUsuarioPromo,gestionar,eliminarUsuarioTarifa,addtarifas,crear,actualizar,editar,eliminar,limpiarInputAdd,limpiarInputEdit,editarPassword,limpiarContra,confirmarNewPassword,saldo,addSaldo">
<div class="grid h-full place-items-center ">
<div class="max-w-xs">
@@ -18,43 +18,34 @@
</div>
</div>
<div class="bg-[#f5f5f5] md:w-[100%] m-auto p-2 md:p-5 rounded-[1.2rem] relative mb-4 ">
<div class="bg-[#f5f5f5] md:w-full m-auto p-2 md:p-5 rounded-lg relative mb-4">
<div class="grid grid-cols-1 sm:flex justify-between my-2 items-center">
<div class="grid grid-cols-1 sm:flex items-center gap-3 md:gap-8">
<div class="grid grid-cols-1 sm:flex items-center gap-3 md:gap-8">
<div class="flex text-sm">
<svg class="w-4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" x="0" y="0"
viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve">
<svg class="w-4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" x="0" y="0" viewBox="0 0 24 24" style="enable-background:new 0 0 512 512" xml:space="preserve">
<g>
<path
d="M15.4,9.88,10.81,5.29a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42L14,11.29a1,1,0,0,1,0,1.42L9.4,17.29a1,1,0,0,0,1.41,1.42l4.59-4.59A3,3,0,0,0,15.4,9.88Z"
fill="#b221fd" data-original="#000000" />
<path d="M15.4,9.88,10.81,5.29a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42L14,11.29a1,1,0,0,1,0,1.42L9.4,17.29a1,1,0,0,0,1.41,1.42l4.59-4.59A3,3,0,0,0,15.4,9.88Z" fill="#b221fd" data-original="#000000" />
</g>
</svg>
Usuario
</div>
@if (auth()->user()->rol->nombre !== 'administrador' && auth()->user()->rol->nombre !== 'editor')
<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
<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" />
</svg>
</a>
<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.
<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" />
<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>
</a>
@endif
</div>
<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
<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" />
</svg>
</a>
<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.
<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" />
<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>
</a>
@endif
</div>
</div>
@@ -62,13 +53,12 @@
{{-- Buscar --}}
<div class="flex relative">
<input id="buscar" type="search" wire:model="buscar" placeholder="Buscar"
class="w-full md:w-auto shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 rounded-[0.8rem] px-4 py-1 m-auto focus:border-neutral-300 focus:outline-none focus:shadow-outline">
<input id="buscar" type="search" wire:model="buscar" placeholder="Buscar" class="w-full md:w-auto shadow-md border-2 active:border-neutral-200 focus:ring-0 border-neutral-200 rounded-[0.8rem] px-4 py-1 m-auto focus:border-neutral-300 focus:outline-none focus:shadow-outline">
</div>
{{-- -Tabla usuarios - --}}
<div class="py-2">
<table class="text-center rounded-lg shadow-lg m-auto mt-4 mb-4 bg-white md:w-10/12">
<table class="text-center rounded-lg shadow-lg m-auto mt-4 mb-4 bg-white md:w-10/12">
<thead class="font-normal bg-[#000029] text-white h-9">
<tr class="text-left">
<th class="rounded-l-lg font-normal pl-[2rem]">Nombre</th>
@@ -119,8 +109,10 @@
<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"
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
@@ -200,7 +192,9 @@
<p class="font-semibold text-gray-500">
Utilidad
</p>
<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">
<span>
<button wire:click="addtarifas" 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">Añadir</button>
@@ -253,13 +247,13 @@
<svg wire:click="eliminarUsuarioTarifa({{ $usuarioTarifa->id }})"
xmlns="http://www.w3.org/2000/svg" version="1.1"
xmlns:xlink="http://www.w3.org/1999/xlink"
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" xml:space="preserve">
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"
xml:space="preserve">
<g>
<g id="Flat_Color" data-name="Flat Color">
<circle cx="12" cy="12" fill="#e63946"
r="10" data-original="#e63946" class="">
<circle cx="12" cy="12" fill="#e63946" r="10"
data-original="#e63946" class="">
</circle>
<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"
@@ -336,7 +330,9 @@
<p class="font-semibold text-gray-500">
Utilidad
</p>
<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">
<span>
<button wire:click="addpromos" 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">Añadir</button>
@@ -376,13 +372,13 @@
<svg wire:click="eliminarUsuarioPromo({{ $usuarioPromo->id }})"
xmlns="http://www.w3.org/2000/svg" version="1.1"
xmlns:xlink="http://www.w3.org/1999/xlink"
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" xml:space="preserve">
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"
xml:space="preserve">
<g>
<g id="Flat_Color" data-name="Flat Color">
<circle cx="12" cy="12" fill="#e63946"
r="10" data-original="#e63946" class="">
<circle cx="12" cy="12" fill="#e63946" r="10"
data-original="#e63946" class="">
</circle>
<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"
@@ -620,53 +616,53 @@
</div>
</div>
{{-- Modal quitar saldo --}}
<div x-cloak x-show="modalSaldoDesc" 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="absolute backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full">
<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="text-center bg-[#000029] text-white text-lg font-semibold rounded-lg py-2 mb-4">
Descontar saldo
</div>
<div class="text-center">
<div class="flex justify-center mb-4">
Saldo actual: $<p class="font-semibold">{{ number_format($saldo_actual) }}</p>
</div>
<div class="mt-2">
Monto a descontar
</div>
<div>
<input type="number" min="0" name="monto" wire:model="valor_recargar"
placeholder="$100.000" required
class="border-2 w-1/2 md:w-auto mb-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
{{-- Modal quitar saldo --}}
<div x-cloak x-show="modalSaldoDesc" 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="absolute backdrop-blur-sm bg-black/20 left-0 bottom-0 top-0 right-0 h-full">
<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="text-center bg-[#000029] text-white text-lg font-semibold rounded-lg py-2 mb-4">
Descontar saldo
</div>
<div class="text-center">
<div class="flex justify-center mb-4">
Saldo actual: $<p class="font-semibold">{{ number_format($saldo_actual) }}</p>
</div>
<div class="mt-2">
Monto a descontar
</div>
<div>
<input type="number" min="0" name="monto" wire:model="valor_recargar"
placeholder="$100.000" required
class="border-2 w-1/2 md:w-auto mb-2 border-neutral-200 rounded-[0.8rem] shadow apperance-none focus:border-neutral-300 focus:ring-0 py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline">
<div class="flex text-sm justify-center">Tu valor total seria: $<p>
{{ $saldo_actual - $valor_recargar }}
<div class="flex text-sm justify-center">Tu valor total seria: $<p>
{{ $saldo_actual - $valor_recargar }}
</p>
</div>
</div>
</p>
</div>
</div>
<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>
<button wire:click="descontar" 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>
</span>
<span>
<button wire:click="limpiarSaldo" x-on:click="modalSaldo=false" 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] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
</span>
</div>
<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>
<button wire:click="descontar" 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>
</span>
<span>
<button wire:click="limpiarSaldo" x-on:click="modalSaldo=false" 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] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Cerrar</button>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{{-- Modal tarifas --}}
@@ -715,7 +711,9 @@
<p class="font-semibold text-gray-500">
Utilidad
</p>
<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">
<span>
<button wire:click="updateTarifas" 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">Añadir</button>
@@ -748,8 +746,8 @@
<g>
<g id="Flat_Color" data-name="Flat Color">
<circle cx="12" cy="12" fill="#e63946"
r="10" data-original="#e63946"
class=""></circle>
r="10" data-original="#e63946" class="">
</circle>
<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"
fill="#edebea" data-original="#edebea"
-1
View File
@@ -41,7 +41,6 @@ Route::middleware(["auth"])->group(function () {
Route::get('/promociones', [MenuController::class, 'showpromociones'])->name('promociones');
Route::get('/wompi/{monto}', [MenuController::class, 'showwompi'])->name('wompi');
Route::any('/logs', [MenuController::class, 'showlogs'])->name('logs');
Route::any('/log-general', [MenuController::class, 'showLogGeneral'])->name('logGeneral');
});
// Editores