log
This commit is contained in:
@@ -54,6 +54,7 @@ class ShowUsuarios extends Component
|
||||
public $nuevo_saldo;
|
||||
public $valor_recargar;
|
||||
public $user_saldo;
|
||||
public $utilidad = 0;
|
||||
|
||||
public $consulta_tarifas;
|
||||
public $consulta_usuarioTarifas;
|
||||
@@ -227,6 +228,13 @@ class ShowUsuarios extends Component
|
||||
$recarga->valor_recarga = $this->valor_recargar;
|
||||
$recarga->save();
|
||||
|
||||
$userSaldo = User::find($this->user_saldo);
|
||||
|
||||
$logsGeneral = new Log_general();
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha descontado la cantidad de $' . $this->valor_recargar . ' al usuario ' . $userSaldo->name . ' - ' . $userSaldo->email;
|
||||
$logsGeneral->save();
|
||||
|
||||
|
||||
$this->consulta_saldo->update([
|
||||
'valor' => $this->saldo_actual - $this->valor_recargar
|
||||
@@ -306,9 +314,14 @@ class ShowUsuarios extends Component
|
||||
$this->alert('warning', '¡Coloque un precio!', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
} elseif (empty($this->utilidad)) {
|
||||
$this->alert('warning', '¡Coloque una utilidad!', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
} else {
|
||||
$usuarioTarifa = new Usuario_tarifa;
|
||||
$usuarioTarifa->precio = $this->precioTarifasGestion;
|
||||
$usuarioTarifa->utilidad = $this->utilidad;
|
||||
$usuarioTarifa->tarifa_id = $this->tarifasGestion;
|
||||
$usuarioTarifa->usuario_id = $this->usuarioGestion_id;
|
||||
$usuarioTarifa->visible = $this->estadoTarifa ? 'false' : 'true';
|
||||
@@ -369,6 +382,7 @@ class ShowUsuarios extends Component
|
||||
} else {
|
||||
$usuarioPromo = new Usuario_promo();
|
||||
$usuarioPromo->precio = $this->precioPromoGestion;
|
||||
$usuarioPromo->utilidad = $this->utilidad;
|
||||
$usuarioPromo->promocion_id = $this->promoGestion;
|
||||
$usuarioPromo->usuario_id = $this->usuarioGestion_id;
|
||||
if ($this->estadoPromo) {
|
||||
@@ -520,6 +534,7 @@ class ShowUsuarios extends Component
|
||||
} else {
|
||||
$tarifa = new TarifaPromo;
|
||||
$tarifa->precio = $this->precio_modTarifas;
|
||||
$tarifa->utilidad = $this->utilidad;
|
||||
$tarifa->promocion_id = $this->servicio_modTarifas;
|
||||
$tarifa->rol_id = $this->roles_modTarifas;
|
||||
$tarifa->save();
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('tarifa_promos', function (Blueprint $table) {
|
||||
$table->string('utilidad')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('tarifa_promos', function (Blueprint $table) {
|
||||
$table->dropColumn('utilidad');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -200,7 +200,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 mt-3 flex justify-end">
|
||||
<div class="mb-3 mt-3 flex gap-4 justify-end items-center">
|
||||
<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">
|
||||
<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>
|
||||
@@ -215,6 +219,7 @@
|
||||
<th class="font-normal pl-[2rem]">Plan</th>
|
||||
<th class="font-normal pl-[2rem]">Oculto</th>
|
||||
<th class="font-normal pl-[2rem]">Tarifa</th>
|
||||
<th class="font-normal pl-[2rem]">Utilidad</th>
|
||||
<th class="font-normal rounded-r-l pr-[2rem]"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -246,6 +251,7 @@
|
||||
@endif
|
||||
|
||||
<td class="pl-[2rem]">${{ $usuarioTarifa->precio ?? '' }}</td>
|
||||
<td class="pl-[2rem]">${{ $usuarioTarifa->utilidad ?? '' }}</td>
|
||||
|
||||
<td class="pl-[1rem] pr-[1rem]">
|
||||
<svg wire:click="eliminarUsuarioTarifa({{ $usuarioTarifa->id }})"
|
||||
@@ -330,7 +336,11 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="mb-3 mt-3 flex justify-end">
|
||||
<div class="mb-3 mt-3 flex gap-4 justify-end items-center">
|
||||
<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">
|
||||
<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>
|
||||
@@ -344,6 +354,7 @@
|
||||
<th class="rounded-l-lg font-normal pl-[2rem]">Promocion</th>
|
||||
<th class="font-normal pl-[2rem]">Oculto</th>
|
||||
<th class="font-normal pl-[2rem]">Precio</th>
|
||||
<th class="font-normal pl-[2rem]">Utilidad</th>
|
||||
<th class="font-normal rounded-r-l pr-[2rem]"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -363,6 +374,7 @@
|
||||
@endif
|
||||
|
||||
<td class="pl-[2rem]">${{ $usuarioPromo->precio ?? '' }}</td>
|
||||
<td class="pl-[2rem]">${{ $usuarioPromo->utilidad ?? '' }}</td>
|
||||
|
||||
<td class="pl-[1rem] pr-[1rem]">
|
||||
<svg wire:click="eliminarUsuarioPromo({{ $usuarioPromo->id }})"
|
||||
@@ -703,7 +715,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 mt-3 flex justify-end">
|
||||
<div class="mb-3 mt-3 flex gap-4 justify-end items-center">
|
||||
<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">
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user