From 78667e65f10cd7646cd1161412089730e4fa10b0 Mon Sep 17 00:00:00 2001 From: Jose Alberto Guerra Ugalde Date: Thu, 10 Apr 2025 16:55:44 -0600 Subject: [PATCH] - VERSION 5.04.09 - Se cambiaron mas lados donde se usaba KMTS1 --- B4A/B4XMainPage.bas | 49 ++++++++++++++++++++++++++++++++-------- B4A/C_Cliente.bas | 16 ++++++------- B4A/Files/cliente.bal | Bin 104409 -> 104409 bytes B4A/Files/login.bal | Bin 23539 -> 23539 bytes B4A/KelloggsV4.b4a | 2 +- B4A/KelloggsV4.b4a.meta | 2 +- B4A/Starter.bas | 1 + 7 files changed, 50 insertions(+), 20 deletions(-) diff --git a/B4A/B4XMainPage.bas b/B4A/B4XMainPage.bas index 15e7e81..6444495 100644 --- a/B4A/B4XMainPage.bas +++ b/B4A/B4XMainPage.bas @@ -544,6 +544,35 @@ Sub JobDone(Job As HttpJob) Next paso1 = 1 End If + 'BYPASS EXTRAS + If result.Tag = "traeBypass" Then 'query tag + If result.Rows.Size = 1 Then ' Si hay contraseña de bypass + For Each records() As Object In result.Rows + Starter.passSupervisor = records(result.Columns.Get("BYPASS")) + Next + Log("CONTRASEÑA VALIDA " & Starter.passSupervisor) + b_importarBD.Visible = True + p_importarBDWA.Visible = True + Starter.passSupervisor = user.Text.Trim + Else + Log("CONTRASEÑA INVALIDA") + b_importarBD.Visible = False + p_importarBDWA.Visible = False + End If + End If + 'BYPASS IMPORTAR BD WA + If result.Tag = "bypass" Then 'query tag + If result.Rows.Size = 1 Then ' Si hay contraseña de bypass + Log("CONTRASEÑA VALIDA " & Starter.passSupervisor) + b_importarBD.Visible = True + p_importarBDWA.Visible = True + Starter.passSupervisor = user.Text.Trim + Else + Log("CONTRASEÑA INVALIDA") + b_importarBD.Visible = False + p_importarBDWA.Visible = False + End If + End If End If Job.Release End If @@ -640,6 +669,7 @@ Sub i_engranes_Click Label1 = ListView1.SingleLineLayout.Label Label1.TextSize = 20 Label1.TextColor = Colors.Black + et_geocerca.Text = ""sdsf If user.Text = "KMTS1" Then ListView1.AddSingleLine("http://10.0.0.205:1781") ListView1.AddSingleLine("http://keymon.lat:1781") c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("SERVER")) @@ -651,13 +681,12 @@ Sub i_engranes_Click Panel1.Top = (Root.Height/2) - (Panel1.Height/2) Panel1.Elevation = 100 Panel1.BringToFront - If user.Text.Trim = "KMTS1" Then - b_importarBD.Visible = True - p_importarBDWA.Visible = True - Else - b_importarBD.Visible = False - p_importarBDWA.Visible = False - End If + Dim cmd As DBCommand + cmd.Initialize + cmd.Name = "selectBypass" ' Trae la contraseña desde la tabla "BYPASS" en web. (La ultima es KMT2025) + cmd.Parameters = Array As Object(user.Text.Trim) + reqManager.ExecuteQuery(cmd , 0, "bypass") + Log($"${Starter.DBReqServer}, ${user.Text}, ${Subs.traeAlmacen}, ${Subs.traeRuta}"$) End Sub Private Sub i_engranes_LongClick @@ -853,10 +882,10 @@ End Sub Private Sub et_geocerca_TextChanged (Old As String, New As String) Private x As Cursor = Starter.skmt.ExecQuery($"select CAT_VA_VALOR from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'FINDIA_PASS'"$) - Log(New) + Log(New & "|" & Starter.passSupervisor) If x.RowCount > 0 Then x.Position = 0 - If New = x.GetString("CAT_VA_VALOR") Or New = "KMTS1" Then + If New = x.GetString("CAT_VA_VALOR") Or New = Starter.passSupervisor Then cb_geocerca.Enabled = True cb_cartaPorte.Enabled = True et_maxClientesNuevos.Enabled = True @@ -873,7 +902,7 @@ Private Sub et_geocerca_TextChanged (Old As String, New As String) l_maxClientesNuevos.TextColor = Colors.LightGray et_maxClientesNuevos.TextColor = Colors.LightGray End If - Else if New = "KMTS1" Then + Else if New = Starter.passSupervisor Then cb_geocerca.Enabled = True cb_cartaPorte.Enabled = True et_maxClientesNuevos.Enabled = True diff --git a/B4A/C_Cliente.bas b/B4A/C_Cliente.bas index 5943b46..0d7409a 100644 --- a/B4A/C_Cliente.bas +++ b/B4A/C_Cliente.bas @@ -4112,19 +4112,19 @@ Private Sub p_pideGeoPass_Click End Sub Private Sub b_geopass_Click - If et_geopass.Text.trim = "KMTS1" Then - m_lat = Starter.lat_gps - m_lon = Starter.lon_gps - GPS_LocationChanged(Starter.ubicacionActual) - Starter.skmt.ExecNonQuery($"update kmt_info set CAT_CL_LAT = '${Starter.lat_gps}', CAT_CL_LONG = '${Starter.lon_gps}' where CAT_CL_CODIGO = '${Subs.traeCliente}'"$) - Else +' If et_geopass.Text.trim = "KMTS1" Then +' m_lat = Starter.lat_gps +' m_lon = Starter.lon_gps +' GPS_LocationChanged(Starter.ubicacionActual) +' Starter.skmt.ExecNonQuery($"update kmt_info set CAT_CL_LAT = '${Starter.lat_gps}', CAT_CL_LONG = '${Starter.lon_gps}' where CAT_CL_CODIGO = '${Subs.traeCliente}'"$) +' Else Dim cmd As DBCommand cmd.Initialize cmd.Name = "selectBypass" ' Trae la contraseña desde la tabla "BYPASS" en web. (La ultima es KMT2025) cmd.Parameters = Array As Object(et_geopass.Text.Trim) reqManager.ExecuteQuery(cmd , 0, "bypass") Log($"${Starter.DBReqServer}, ${et_geopass.Text}, ${Subs.traeAlmacen}, ${Subs.traeRuta}"$) - End If +' End If p_pideGeoPass.Visible = False ime.HideKeyboard ' Log("Guardamos coords") @@ -4155,7 +4155,7 @@ Sub JobDone(Job As HttpJob) If result.Tag = "bypass" Then 'query tag Log("SIN REGISTROS " & result.Rows.Size) Subs.logJobDoneResultados(result) - If result.Rows.Size = 1 Then + If result.Rows.Size = 1 Then ' Si hay contraseña de bypass m_lat = Starter.lat_gps m_lon = Starter.lon_gps GPS_LocationChanged(Starter.ubicacionActual) diff --git a/B4A/Files/cliente.bal b/B4A/Files/cliente.bal index e37973f4cd8e1b11e41926b04a02becd2cea8701..25190999bc9726cb96ccf68c73ac196f008e4c58 100644 GIT binary patch delta 28 kcmcb)p6%v(wuUW?({&jcrz`q0s!yH}>9(C!kMT+-0H9n7F8}}l delta 30 mcmcb)p6%v(wuUW?({(3jMDk46@nw{mJR#C;JF6b!l}rG`Y7313 diff --git a/B4A/Files/login.bal b/B4A/Files/login.bal index e486fbbccd0204c24a571a6a6b46407270291202..57e9fd1151efd5d25ed6454279b2b0da8ecdc231 100644 GIT binary patch delta 26 icmeyoo$>Q_#tjP`Co6|)Os;Y;n*82UWHX=BQ%L}*pbKgM delta 26 icmeyoo$>Q_#tjP`Cr`E1m|W#xH2J-y$YwsLr;-4!91Fkz diff --git a/B4A/KelloggsV4.b4a b/B4A/KelloggsV4.b4a index b568616..028890c 100644 --- a/B4A/KelloggsV4.b4a +++ b/B4A/KelloggsV4.b4a @@ -907,7 +907,7 @@ Version=12.8 #Region Project Attributes #ApplicationLabel: Kelloggs Venta #VersionCode: 3000 - #VersionName: 5.04.08 + #VersionName: 5.04.09 #SupportedOrientations: portrait #CanInstallToExternalStorage: False #BridgeLogger:true diff --git a/B4A/KelloggsV4.b4a.meta b/B4A/KelloggsV4.b4a.meta index ed638ca..705e082 100644 --- a/B4A/KelloggsV4.b4a.meta +++ b/B4A/KelloggsV4.b4a.meta @@ -91,6 +91,6 @@ ModuleClosedNodes6= ModuleClosedNodes7= ModuleClosedNodes8= ModuleClosedNodes9= -NavigationStack=C_Productos,b_prodMas_Click,639,6,C_Productos,et_pCant_TextChanged,748,6,C_Productos,et_pCant_FocusChanged,846,0,C_Principal,Class_Globals,0,0,C_Principal,cargar_Click,757,0,C_Principal,JobDone,2099,0,DBRequestManager,trackNext,342,0,DBRequestManager,trackInit,333,0,C_Cliente,p_pideGeoPass_Click,4106,0,C_Cliente,b_geopass_Click,4129,6 +NavigationStack=B4XMainPage,et_geocerca_TextChanged,865,4,DBRequestManager,trackNext,342,0,DBRequestManager,trackInit,333,0,Diseñador Visual,cliente.bal,-100,1,C_Cliente,p_pideGeoPass_Click,4106,0,C_Cliente,b_geopass_Click,4114,6,B4XMainPage,et_maxClientesNuevos_TextChanged,851,0,B4XMainPage,user_EnterPressed,636,0,B4XMainPage,JobDone,556,6,B4XMainPage,i_engranes_Click,680,4 SelectedBuild=0 VisibleModules=1,28,11,3,29,12,7,9,17 diff --git a/B4A/Starter.bas b/B4A/Starter.bas index bd3c409..02fd859 100644 --- a/B4A/Starter.bas +++ b/B4A/Starter.bas @@ -56,6 +56,7 @@ Sub Process_Globals Dim pingShell As Boolean = False Dim errorConnDBReq As Boolean = False Dim GUID As String = "" + dim passSupervisor as string = "" End Sub Sub Service_Create