diff --git a/app/Http/Livewire/ShowRecarga.php b/app/Http/Livewire/ShowRecarga.php index 226e88b..919338b 100755 --- a/app/Http/Livewire/ShowRecarga.php +++ b/app/Http/Livewire/ShowRecarga.php @@ -22,11 +22,21 @@ class ShowRecarga extends Component use LivewireAlert; public $numero_nequi; public $valor_recarga; + public $valor_recarga_format; public $nequi =false; public $cobrar = false; public $monto = 0; - - + + public function updatedValorRecargaFormat($value) + { + // Limpiar el valor formatado quitando los puntos + $cleanValue = str_replace(',', '', $value); + + // Asignar el valor limpio a valor_recarga + $this->valor_recarga = $cleanValue; + } + + public function render() { // $this->fechaActual = date('d/m/Y'); @@ -37,7 +47,7 @@ class ShowRecarga extends Component $consulta_historial = recarga::where('usuario_id',Auth::user()->id)->orderBy('id','DESC')->limit(20)->get(); $consulta_saldo = User::where('id',Auth::user()->id)->with('saldo')->first(); - + return view('livewire.show-recarga',[ 'user' => $consulta_saldo, 'historial_recargas' => $consulta_historial @@ -46,7 +56,7 @@ class ShowRecarga extends Component public function pagar(){ - + //auth2.0 $client_id='5ml5b35ijjk13f4q99utnsm97e'; $client_secret='1b3703aq0o6t1rrfti13q7uf7f42glik3gsf81s0d783shblmt8l'; @@ -54,8 +64,8 @@ class ShowRecarga extends Component $endpoint="https://oauth.sandbox.nequi.com/oauth2/token?grant_type=client_credentials"; $date= Carbon::now()->format('Y-m-d\TH:i:s.z\Z'); //dd($date); - - //dd($this->numero_nequi); + + //dd($this->numero_nequi); //push $RestEndpoint = '/payments/v2/-services-paymentservice-unregisteredpayment'; @@ -66,8 +76,8 @@ class ShowRecarga extends Component 'Accept' => 'application/json', 'Authorization' => $authorization ); - - //Solicitud + + //Solicitud $request = Requests::post($endpoint, $headers); @@ -98,7 +108,7 @@ class ShowRecarga extends Component $options1 = array( 'timeout' => 30 - + ); $endpoint1 = 'https://api.sandbox.nequi.com' . $RestEndpoint; @@ -135,7 +145,7 @@ $request1 = Requests::post($endpoint1, $headers1, $body1, $options1); if (isset($request1->status_code) && $request1->status_code == 200 && isset($request1->body) && !empty($request1->body) ) { - + try { $response1 = json_decode($request1->body); @@ -143,18 +153,18 @@ if (isset($request1->status_code) && $request1->status_code == 200 && isset($req $status = $response1->ResponseMessage->ResponseHeader->Status; $statusCode = isset($status) ? $status->StatusCode : ''; $statusDesc = isset($status) ? $status->StatusDesc : ''; - + if ($statusCode == 0) { $this->alert('success', 'Solicitud de pago enviada', [ 'position' => 'top' ]); - + $payment = $response1->ResponseMessage->ResponseBody->any->unregisteredPaymentRS; $trnId = isset($payment) ? trim($payment->transactionId) : ''; - + if ( !empty($trnId)) { - + $recarga = new recarga; $recarga-> payment_type_id= ''; $recarga-> payment_method_id= ''; @@ -172,7 +182,7 @@ if (isset($request1->status_code) && $request1->status_code == 200 && isset($req ]); $this->nequi = false; - } + } $this->alert('success', $trnId, [ 'position' => 'top' ]); @@ -181,7 +191,7 @@ if (isset($request1->status_code) && $request1->status_code == 200 && isset($req $this->alert('warning', $statusCode . ' = ' . $statusDesc, [ 'position' => 'top' ]); - + } } catch (Exception $e) { throw $e; diff --git a/resources/views/livewire/show-planes.blade.php b/resources/views/livewire/show-planes.blade.php index db50791..498e6ab 100755 --- a/resources/views/livewire/show-planes.blade.php +++ b/resources/views/livewire/show-planes.blade.php @@ -26,7 +26,7 @@
- + Planes
@@ -42,11 +42,17 @@ @if (auth()->user()->rol->nombre != 'editor' && auth()->user()->rol->nombre != 'administrador') - + Modificar tarifas - - - + + + @endif @@ -94,17 +100,11 @@
- -
- @if (auth()->user()->rol->nombre != 'editor') -
- -
- @endif - +
+ +
+
- - + +
@@ -397,23 +398,28 @@
- - + +
- +
- + - +
@@ -466,24 +472,38 @@ @if (!empty($consulta_verUsuarios->servicio->tarifas)) - @foreach ($consulta_verUsuarios->servicio->tarifas as $tarifaItem) - @if ($consulta_verUsuarios->estado == 'pendiente' && $tarifaItem->rol_id == '5' ) + @if ($consulta_verUsuarios->estado == 'pendiente' && $tarifaItem->rol_id == '5') @if ($tarifaItem->pantallas == $tarifaItem->servicio->completa) @if ($tarifaItem->servicio->por_tiempo) - + @else - + @endif @endif @else - @if ($tarifaItem->rol_id == '5' && ($tarifaItem->pantallas < ($tarifaItem->servicio->pantallas - count($consulta_verUsuarios->historiales)))) - + @if ( + $tarifaItem->rol_id == '5' && + $tarifaItem->pantallas < $tarifaItem->servicio->pantallas - count($consulta_verUsuarios->historiales)) @if ($tarifaItem->servicio->por_tiempo) - + @else - + @endif @endif @endif @@ -496,7 +516,8 @@
- + + @endforeach @@ -797,7 +819,8 @@
- +
@@ -853,7 +876,8 @@
- +
diff --git a/resources/views/livewire/show-recarga.blade.php b/resources/views/livewire/show-recarga.blade.php index 2eea3c6..21f9d26 100755 --- a/resources/views/livewire/show-recarga.blade.php +++ b/resources/views/livewire/show-recarga.blade.php @@ -1,7 +1,7 @@ -
+
-
+

Cargando

@@ -30,21 +30,26 @@ Monto a recargar
- + + + @if ($valor_recarga) -
Tu valor a pagar seria: $

- - {{ $nuevo_valor = ($valor_recarga * 0.03 + '700') * 0.19 + ($valor_recarga * 0.03 + '700') + $valor_recarga }} - - +

Tu valor a pagar seria: $

+ {{ number_format($nuevo_valor = ($valor_recarga * 0.03 + '700') * 0.19 + ($valor_recarga * 0.03 + '700') + $valor_recarga) }}

-
@endif -

Se sumara $700 COP+ IVA + 3% adicional al pago en - Mercado Pago por costos de sistema.

+

Se sumara $700 COP+ IVA + 3% adicional al pago en Mercado Pago por costos de sistema.

@@ -96,7 +101,6 @@ @foreach ($historial_recargas as $historial_recarga) - {{-- {{date("d/m/Y", strtotime($historial_recarga->created_at))}} --}} {{ date('d/m/Y', strtotime($historial_recarga->created_at)) }} ${{ number_format($historial_recarga->monto) }} {{ $historial_recarga->status }} @@ -125,5 +129,14 @@
+
diff --git a/resources/views/livewire/show-servicios.blade.php b/resources/views/livewire/show-servicios.blade.php index c883836..6617feb 100755 --- a/resources/views/livewire/show-servicios.blade.php +++ b/resources/views/livewire/show-servicios.blade.php @@ -552,9 +552,10 @@ @endforeach @endif @endif - *Usuario:* {{ trim($cuenta->correo) }} *Contraseña:* {{ trim($cuenta->password) }} + + @endforeach @@ -570,9 +571,7 @@

- Este servicio vencerá el

- - {{ Carbon\Carbon::parse($cuentas->fecha_final)->format('Y/m/d') ?? '' }}.

+ Este servicio vencerá el

{{ Carbon\Carbon::parse($cuentas->fecha_final)->format('Y/m/d') ?? '' }}.

@endif diff --git a/resources/views/livewire/show-usuarios.blade.php b/resources/views/livewire/show-usuarios.blade.php index 06da2fd..daf5466 100755 --- a/resources/views/livewire/show-usuarios.blade.php +++ b/resources/views/livewire/show-usuarios.blade.php @@ -580,9 +580,7 @@ Monto a recargar
- +
Tu valor total seria: $

{{ number_format($saldo_actual + $valor_recargar) }} diff --git a/routes/web.php b/routes/web.php index 75cd750..73b96ad 100755 --- a/routes/web.php +++ b/routes/web.php @@ -46,6 +46,7 @@ Route::middleware(["auth"])->group(function () { // Editores Route::middleware(["auth", "solo_usuario_editor"])->group(function () { Route::any('/planes', [MenuController::class, 'showplanes'])->name('planes'); + Route::get('/import', [MenuController::class, 'showimport'])->name('import'); }); //Administradores @@ -57,7 +58,6 @@ Route::middleware(["auth", "solo_usuario_administrador"])->group(function () { Route::get('/configuracion', [MenuController::class, 'showconfiguracion'])->name('configuracion'); Route::get('/categoria', [MenuController::class, 'showcategoria'])->name('categoria'); Route::any('/logs', [MenuController::class, 'showlogs'])->name('logs'); - Route::get('/import', [MenuController::class, 'showimport'])->name('import'); Route::any('/logs-recargas', [MenuController::class, 'showLogRecargas'])->name('logsRecargas'); Route::any('/log-general', [MenuController::class, 'showLogGeneral'])->name('logGeneral'); Route::any('/log-historial', [MenuController::class, 'showLogHistorial'])->name('logHistorial');