|
-
-
-
- |
- @endforeach
-
diff --git a/.env b/.env index 4638f5d..290b041 100644 --- a/.env +++ b/.env @@ -9,7 +9,7 @@ LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug DB_CONNECTION=mysql -DB_HOST=31.220.16.2 +DB_HOST=82.180.168.2 DB_PORT=3306 DB_DATABASE=u111286300_sir DB_USERNAME=u111286300_sir diff --git a/app/Http/Livewire/ShowIndexServicio.php b/app/Http/Livewire/ShowIndexServicio.php index 7e78efc..5877869 100644 --- a/app/Http/Livewire/ShowIndexServicio.php +++ b/app/Http/Livewire/ShowIndexServicio.php @@ -54,11 +54,11 @@ class ShowIndexServicio extends Component $this->fecha= $date->format('Y-m-d'); if (!empty($this->tarifa_id)) { - + + + $tarifas = Tarifas::with('servicio')->where('id', $this->tarifa_id)->first(); $this->fecha_final_1 = $today = Carbon::now()->addDays($tarifas->dias-15); $this->fecha_final_2 = $today = Carbon::now()->addDays($tarifas->dias+15); - - $tarifas = Tarifas::with('servicio')->where('id', $this->tarifa_id)->first(); $cuentas_creadas = Cuentas::whereDate('inicio','>=',$this->fecha)->where('servicio_id',$this->servicio_id)->where('estado','activo')->get(); $cuentas_tomadas = Historial_cuenta::whereIn('cuenta_id', $cuentas_creadas->pluck('id'))->count(); diff --git a/app/Http/Livewire/ShowServicios.php b/app/Http/Livewire/ShowServicios.php index a2ab656..97e3c0d 100644 --- a/app/Http/Livewire/ShowServicios.php +++ b/app/Http/Livewire/ShowServicios.php @@ -274,7 +274,7 @@ class ShowServicios extends Component if ((int) $pantalla_servicio >= (int) $cantidad_solicitada && (int) $pantalla_servicio_completa != (int) $this->pantallas_tarjetaPlan) { $suma = $pantalla_servicio - $cantidad_solicitada; - $cantidad_necesaria = 1; + $cantidad_necesaria = $this->cantidad_tarjetaPlan; $cuenta = Cuentas::where('servicio_id', $this->servicio_id)->whereDate('inicio', '>=', $this->fecha)->Orderby('created_at', 'ASC')->withCount('historiales')->where('estado', 'activo')->having('historiales_count', '<=', $suma)->get(); } elseif ((int) $pantalla_servicio_completa == (int) $this->pantallas_tarjetaPlan) { @@ -292,10 +292,11 @@ class ShowServicios extends Component $cuenta = null; $cantidad_necesaria = null; } - + //dd($cuenta, $cantidad_necesaria); for ($h = 0; $h < (int) $cantidad_necesaria; $h++) { - + //dd($h); if (!empty($cuenta)) { + $perfil = $cuenta[$h]->historiales_count; for ($y = 0; $y < (int) $pantallas; $y++) { @@ -315,6 +316,7 @@ class ShowServicios extends Component } } + //dd($historial->cuentas); $descuento = Saldo::where('usuario_id', Auth::user()->id)->first(); $saldo_anterior = $descuento->valor; @@ -323,6 +325,7 @@ class ShowServicios extends Component $cobro = $descuento->update(['valor' => $nuevo_saldo]); if ($cobro) { $historial->update(['estado' => 'activo']); + $this->credenciales($historial); } else { $this->alert('warning', 'Error en el cobro, comuniquese con soporte!', [ diff --git a/app/Http/Livewire/ShowUsuarios.php b/app/Http/Livewire/ShowUsuarios.php index f631308..b69c1da 100644 --- a/app/Http/Livewire/ShowUsuarios.php +++ b/app/Http/Livewire/ShowUsuarios.php @@ -77,6 +77,7 @@ class ShowUsuarios extends Component public $precio_modTarifas = 0; public $consulta_saldo; public $modTarifas; + public $modalSaldoDesc; @@ -173,6 +174,23 @@ class ShowUsuarios extends Component $this->saldo_actual = $this->consulta_saldo->valor; $this->modalSaldo = true; + } + public function saldodesc($user_saldo) + { + $this->user_saldo = $user_saldo; + $this->consulta_saldo = Saldo::where('usuario_id', $this->user_saldo)->first(); + + if (is_null($this->consulta_saldo)) { + $saldo = new Saldo; + $saldo->valor = 0; + $saldo->usuario_id = $this->user_saldo; + $saldo->save(); + $this->consulta_saldo = $saldo; + } + + $this->saldo_actual = $this->consulta_saldo->valor; + $this->modalSaldoDesc = true; + } public function addSaldo() @@ -200,6 +218,31 @@ class ShowUsuarios extends Component } + public function descontar() + { + $recarga = new recarga; + $recarga->payment_method_id = 'manual'; + $recarga->status = 'Descuento'; + $recarga->usuario_id = $this->user_saldo; + $recarga->saldo_id = $this->consulta_saldo->id; + $recarga->monto = $this->valor_recargar; + $recarga->valor_recarga = $this->valor_recargar; + $recarga->save(); + + + $this->consulta_saldo->update([ + 'valor' => $this->saldo_actual - $this->valor_recargar + ]); + + $this->alert('success', 'Saldo actualizado con exito!', [ + 'position' => 'top' + ]); + + + $this->limpiarSaldo(); + + } + public function editar($id) { $this->id_edit = $id; @@ -455,6 +498,7 @@ $usuarioEliminado = User::where('name', 'usuarioEliminado')->value('id'); { $this->valor_recargar = null; $this->modalSaldo = false; + $this->modalSaldoDesc = false; } /* ------------- ACTUALIZAR ------------- */ diff --git a/public/photos/I8y14wajBG.webp b/public/photos/I8y14wajBG.webp new file mode 100644 index 0000000..dad693a Binary files /dev/null and b/public/photos/I8y14wajBG.webp differ diff --git a/public/photos/KLJIjZiBK5.webp b/public/photos/KLJIjZiBK5.webp new file mode 100644 index 0000000..050da11 Binary files /dev/null and b/public/photos/KLJIjZiBK5.webp differ diff --git a/public/photos/T47MpK7b09LB7WH4TH14PgGsksdny33tNpiUsQ3H.jpg b/public/photos/T47MpK7b09LB7WH4TH14PgGsksdny33tNpiUsQ3H.jpg new file mode 100644 index 0000000..7dc6f98 Binary files /dev/null and b/public/photos/T47MpK7b09LB7WH4TH14PgGsksdny33tNpiUsQ3H.jpg differ diff --git a/public/photos/gKVoc6IFjX.webp b/public/photos/gKVoc6IFjX.webp new file mode 100644 index 0000000..dad693a Binary files /dev/null and b/public/photos/gKVoc6IFjX.webp differ diff --git a/public/photos/iOGJ5rdL0ThcepgEhKMjG1PCiIQAGnJxLvyO7W0m.jpg b/public/photos/iOGJ5rdL0ThcepgEhKMjG1PCiIQAGnJxLvyO7W0m.jpg new file mode 100644 index 0000000..443088c Binary files /dev/null and b/public/photos/iOGJ5rdL0ThcepgEhKMjG1PCiIQAGnJxLvyO7W0m.jpg differ diff --git a/public/photos/kyMjdozMZe.webp b/public/photos/kyMjdozMZe.webp new file mode 100644 index 0000000..050da11 Binary files /dev/null and b/public/photos/kyMjdozMZe.webp differ diff --git a/public/photos/yu6VrwAjx3dgys8CU5Rf6fIl3MuUVxOyJsXWXOt4.png b/public/photos/yu6VrwAjx3dgys8CU5Rf6fIl3MuUVxOyJsXWXOt4.png new file mode 100644 index 0000000..661ad7b Binary files /dev/null and b/public/photos/yu6VrwAjx3dgys8CU5Rf6fIl3MuUVxOyJsXWXOt4.png differ diff --git a/resources/views/livewire/show-index-categoria.blade.php b/resources/views/livewire/show-index-categoria.blade.php index ac228e2..8f356e5 100644 --- a/resources/views/livewire/show-index-categoria.blade.php +++ b/resources/views/livewire/show-index-categoria.blade.php @@ -1,132 +1,132 @@ -
+
Cargando
Personalización de precios para {{$usuario_nombre}}
+Personalización de precios para {{ $usuario_nombre }}
| Servicio | @@ -194,32 +221,53 @@ modTarifas: @entangle('modTarifas'),|||||||
|---|---|---|---|---|---|---|---|
| {{ $usuarioTarifa->tarifa->servicio->nombre ?? '' }} | - -- @if($usuarioTarifa->tarifa->servicio->por_tiempo) - {{ $usuarioTarifa->tarifa->dias ?? '' }} {{ $usuarioTarifa->tarifa->dias == 1 ? 'día' : 'días' }} + | ||||||
| {{ $usuarioTarifa->tarifa->servicio->nombre ?? '' }} + | ++ @if ($usuarioTarifa->tarifa->servicio->por_tiempo) + {{ $usuarioTarifa->tarifa->dias ?? '' }} + {{ $usuarioTarifa->tarifa->dias == 1 ? 'día' : 'días' }} + @else + {{ $usuarioTarifa->tarifa->pantallas ?? '' }} + {{ $usuarioTarifa->tarifa->pantallas == 1 ? 'pantalla' : 'pantallas' }} + - {{ $usuarioTarifa->tarifa->dias ?? '' }} + {{ $usuarioTarifa->tarifa->dias == 1 ? 'día' : 'días' }} + @endif + | + + @if ($usuarioTarifa->visible != 'true') +@else - {{ $usuarioTarifa->tarifa->pantallas ?? '' }} {{ $usuarioTarifa->tarifa->pantallas == 1 ? 'pantalla' : 'pantallas' }} - {{ $usuarioTarifa->tarifa->dias ?? '' }} {{ $usuarioTarifa->tarifa->dias == 1 ? 'día' : 'días' }} - + | @endif - - - @if ($usuarioTarifa->visible != 'true') - | - @else - | - @endif - | ${{ $usuarioTarifa->precio ?? '' }} | - -- - | -${{ $usuarioTarifa->precio ?? '' }} | + ++ + | + @endforeach @endif @@ -234,101 +282,125 @@ modTarifas: @entangle('modTarifas'), - + - {{-- Gestionar promocion --}} -