23/10/23 - Version en Principal y Cliente

- Agregamos la version de la aplicación en la pantalla principal y en la del cliente
This commit is contained in:
2023-10-23 12:45:28 -06:00
parent cd7565df49
commit 09ee88c0d9
9 changed files with 189 additions and 190 deletions

View File

@@ -20,8 +20,6 @@ Version=9.85
'########################################################################################################### '###########################################################################################################
#End Region #End Region
'Ctrl + click ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=github&Args=..\..\ 'Ctrl + click ide://run?file=%WINDIR%\System32\cmd.exe&Args=/c&Args=github&Args=..\..\
Sub Class_Globals Sub Class_Globals

View File

@@ -140,6 +140,7 @@ Sub Class_Globals
Private Label20 As Label Private Label20 As Label
Private l_calle1 As Label Private l_calle1 As Label
Private l_ubicacion2 As Label Private l_ubicacion2 As Label
Private l_version As Label
End Sub End Sub
'You can add more parameters here. 'You can add more parameters here.
@@ -153,16 +154,18 @@ Private Sub B4XPage_Created (Root1 As B4XView)
'load the layout to Root 'load the layout to Root
' Activity.RemoveAllViews ' Activity.RemoveAllViews
Root.LoadLayout("cliente") Root.LoadLayout("cliente")
l_version.Text = Application.VersionName
Subs.centraPanel(Panel1, Root.Width)
ruta = File.DirInternal ruta = File.DirInternal
If File.Exists(ruta, "kmt.db") = False Then If File.Exists(ruta, "kmt.db") = False Then
File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db") File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db")
End If End If
skmt.Initialize(ruta,"kmt.db", True) skmt.Initialize(ruta,"kmt.db", True)
c=skmt.ExecQuery("select CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_MTOCOMPRA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)") c = skmt.ExecQuery("select CAT_CL_CODIGO,CAT_CL_RUTA,CAT_CL_NOMBRE,CAT_CL_ATIENDE1,CAT_CL_ATIENTE2,CAT_CL_TELEFONO,CAT_CL_EMAIL,CAT_CL_CALLE,CAT_CL_NOEXT,CAT_CL_NOINT,CAT_CL_CALLE1,CAT_CL_CALLE2,CAT_CL_COLONIA,CAT_CL_MUNI,CAT_CL_EDO,CAT_CL_CP,CAT_CL_LONG,CAT_CL_LAT,CAT_CL_MTOCOMPRA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
s=skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)") s = skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")
s.Position=0 s.Position = 0
If c.RowCount>0 Then If c.RowCount>0 Then
c.Position=0 c.Position = 0
la_cuenta.Text = c.GetString("CAT_CL_CODIGO") la_cuenta.Text = c.GetString("CAT_CL_CODIGO")
cuenta = c.GetString("CAT_CL_CODIGO") cuenta = c.GetString("CAT_CL_CODIGO")
La_nombre.Text = c.GetString("CAT_CL_NOMBRE") La_nombre.Text = c.GetString("CAT_CL_NOMBRE")

View File

@@ -225,6 +225,7 @@ Sub Class_Globals
Private p_principal As Panel Private p_principal As Panel
Private p_mandaInfo As Panel Private p_mandaInfo As Panel
Private l_version As Label
End Sub End Sub
'You can add more parameters here. 'You can add more parameters here.
@@ -238,6 +239,10 @@ Private Sub B4XPage_Created (Root1 As B4XView)
'load the layout to Root 'load the layout to Root
Root.LoadLayout("principal") Root.LoadLayout("principal")
s.Initialize(Me, "Subs") s.Initialize(Me, "Subs")
p_mandaInfo.Width = Root.Width
p_mandaInfo.Height = Root.Height
s.centraPanel(P1, Root.Width)
l_version.Text = Application.VersionName
rd.Initialize 'Inicializamos el respaldo diario. rd.Initialize 'Inicializamos el respaldo diario.
rd.vacuum rd.vacuum
EJECUTANDO=1 EJECUTANDO=1
@@ -481,11 +486,7 @@ End Sub
Sub Subir_Click Sub Subir_Click
CARGA = "SUBIR" CARGA = "SUBIR"
p_mandaInfo.Width = Root.Width
p_mandaInfo.Height = Root.Height
P1.Visible = True P1.Visible = True
P1.Left = (p_mandaInfo.Width/2) - (P1.Width/2)
P1.top = (p_mandaInfo.Height/2) - (P1.Height/2)
p_mandaInfo.Visible = True p_mandaInfo.Visible = True
P1.BringToFront P1.BringToFront
p_mandaInfo.BringToFront p_mandaInfo.BringToFront
@@ -689,7 +690,7 @@ Sub Subir_Click
' Dim fotox() As Byte ' Dim fotox() As Byte
' Dim cmd As DBCommand ' Dim cmd As DBCommand
' c = Starter.skmt.ExecQuery("Select CODIGO, ALMACEN, RUTA, NOM_FOTO from HIST_FOTO_CLIENTE") ' c = Starter.skmt.ExecQuery("Select CODIGO, ALMACEN, RUTA, NOM_FOTO from HIST_FOTO_CLIENTE")
' '
' c.Position = 0 ' c.Position = 0
' '
' Dim Dirp As String = File.DirInternal ' Dim Dirp As String = File.DirInternal
@@ -746,15 +747,13 @@ Sub cargar_Click
End If End If
If Not (pedidodiaanterior) Then If Not (pedidodiaanterior) Then
CARGA = "CARGAR" CARGA = "CARGAR"
p_mandaInfo.Width = Root.Width s.panelVisible(p_mandaInfo, 0, 0)
p_mandaInfo.Height = Root.Height
P1.Left = (p_mandaInfo.Width/2) - (P1.Width/2) P1.Left = (p_mandaInfo.Width/2) - (P1.Width/2)
P1.top = (p_mandaInfo.Height/2) - (P1.Height/2) P1.top = (p_mandaInfo.Height/2) - (P1.Height/2)
img2.Visible =True img2.Visible =True
L_P_1.Visible = True L_P_1.Visible = True
S_CC.Visible = True S_CC.Visible = True
Btn_Ubicar.Visible=False Btn_Ubicar.Visible = False
P1.Visible = True
p_mandaInfo.Visible = True p_mandaInfo.Visible = True
p_principal.Visible = False p_principal.Visible = False
Subs.panelVisible(P1, 0, 0) Subs.panelVisible(P1, 0, 0)
@@ -1778,6 +1777,7 @@ Sub connecta_Click
Log(Starter.DBReqServer) Log(Starter.DBReqServer)
connecta1 = connecta1 + 1 connecta1 = connecta1 + 1
' imei = p.GetDeviceId ' imei = p.GetDeviceId
IME.HideKeyboard
imei = "" imei = ""
conn = "1" conn = "1"
Dim cmd As DBCommand Dim cmd As DBCommand

View File

@@ -371,16 +371,6 @@ Sub centraProgressBar(elemento As ProgressBar, anchoElementoSuperior As Int) 'ig
elemento.Left = Round(anchoElementoSuperior/2)-(elemento.Width/2) elemento.Left = Round(anchoElementoSuperior/2)-(elemento.Width/2)
End Sub End Sub
'Regresa el usuario de la tabla USUARIOA si es que existe, si no existe, regresa "SinUsuario".
Sub buscaDBUsuario As String 'ignore
Private c As Cursor
Private usuario As String = "SinUsuario"
c=kmt.ExecQuery("select USUARIO from usuarioa")
c.Position=0
If c.RowCount > 0 Then usuario = c.GetString("USUARIO")
Return usuario
End Sub
'Regresa la fecha en el formato "MM/dd/yyyy" 'Regresa la fecha en el formato "MM/dd/yyyy"
Sub traeFecha As String 'ignore Sub traeFecha As String 'ignore
DateTime.DateFormat = "MM/dd/yyyy" DateTime.DateFormat = "MM/dd/yyyy"
@@ -596,3 +586,22 @@ Sub mandaPendientes 'ignore
End If End If
ab.Close ab.Close
End Sub End Sub
'Borra el pedido del cliente actual.
'Borra los registros de la tabla "pedido" y "pedido_cliente"
'Actualiza las tablas "cat_gunaprod" y "kmt_info".
Sub borraPedidoClienteActual As String
Private thisC As Cursor
thisC=Starter.skmt.ExecQuery("select PE_PROID,PE_CANT FROM PEDIDO where pe_cliente in (Select CUENTA from cuentaa) ")
If thisC.RowCount>0 Then
For i=0 To thisC.RowCount -1
thisC.Position=i
Starter.skmt.ExecNonQuery2("update cat_gunaprod set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?", Array As Object(thisC.GetString("PE_CANT"),thisC.GetString("PE_PROID")))
Starter.skmt.ExecNonQuery2("INSERT INTO INVENT_X_ENVIAR (ALMACEN , PROID , CANTIDAD ) VALUES(?,?,?) ", Array As Object (traeAlmacen, thisC.GetString("PE_PROID"),thisC.GetString("PE_CANT")* -1))
Next
End If
Starter.skmt.ExecNonQuery("delete from pedido_cliente where pc_cliente in (Select CUENTA from cuentaa)")
Starter.skmt.ExecNonQuery("delete from pedido where pe_cliente in (Select CUENTA from cuentaa)")
Starter.skmt.ExecNonQuery("UPDATE kmt_info set gestion = 0 where CAT_CL_CODIGO In (select cuenta from cuentaa)")
Return 1
End Sub

Binary file not shown.

Binary file not shown.

View File

@@ -712,7 +712,6 @@ Library22=sql
Library23=togglelibrary Library23=togglelibrary
Library24=xcustomlistview Library24=xcustomlistview
Library25=xui Library25=xui
Library26=kms_helpersubs
Library3=baqrcode Library3=baqrcode
Library4=batteryprogressview Library4=batteryprogressview
Library5=bitmapcreator Library5=bitmapcreator
@@ -748,7 +747,7 @@ Module7=C_Mapas
Module8=C_Nota Module8=C_Nota
Module9=C_NoVenta Module9=C_NoVenta
NumberOfFiles=347 NumberOfFiles=347
NumberOfLibraries=26 NumberOfLibraries=25
NumberOfModules=26 NumberOfModules=26
Version=12.5 Version=12.5
@EndOfDesignText@ @EndOfDesignText@

View File

@@ -79,6 +79,6 @@ ModuleClosedNodes6=
ModuleClosedNodes7= ModuleClosedNodes7=
ModuleClosedNodes8= ModuleClosedNodes8=
ModuleClosedNodes9= ModuleClosedNodes9=
NavigationStack=B4XMainPage,B_SERVER_Click,704,0,B4XMainPage,lv_server_ItemClick,719,0,B4XMainPage,CheckNotificationAccess,744,0,B4XMainPage,b_envioBD_Click,743,0,B4XMainPage,B4XPage_Appear,307,0,NotificationService,NotiMon_NotificationPosted,40,0,NotificationService,Service_Destroy,29,0,NotificationService,Service_Start,22,0,C_Principal,Subir_Click,633,0,Subs,traeMaxPromos,975,0,Subs,alcanzanLosVariablesParaPromo,965,0 NavigationStack=C_Subs,Initialize,24,0,C_Subs,envioTest,61,0,Subs,centraProgressBar,642,0,Subs,actualizaProducto,778,0,Subs,guardaProductoSinGestion,777,0,Subs,borraPedidoClienteActual,1231,0,Subs,traeTotalesClienteActual,1227,0,C_Subs,centraProgressBar,366,0,C_Subs,borraPedidoClienteActual,601,0,C_Subs,mandaPendientes,581,0,C_Subs,dbInit,34,0
SelectedBuild=0 SelectedBuild=0
VisibleModules=2,12,24,23,16,25,15,13,6,8 VisibleModules=2,12,24,16,25

View File

@@ -647,16 +647,6 @@ Sub centraProgressBar(elemento As ProgressBar, anchoElementoSuperior As Int) 'ig
elemento.Left = Round(anchoElementoSuperior/2)-(elemento.Width/2) elemento.Left = Round(anchoElementoSuperior/2)-(elemento.Width/2)
End Sub End Sub
'Regresa el usuario de la tabla USUARIOA si es que existe, si no existe, regresa "SinUsuario".
Sub buscaDBUsuario As String 'ignore
Private c As Cursor
Private usuario As String = "SinUsuario"
c=kmt.ExecQuery("select USUARIO from usuarioa")
c.Position=0
If c.RowCount > 0 Then usuario = c.GetString("USUARIO")
Return usuario
End Sub
'Saca el usuario de la tabla USUARIOA 'Saca el usuario de la tabla USUARIOA
Sub dameUsuarioDeDB As String 'ignore Sub dameUsuarioDeDB As String 'ignore
Private c As Cursor Private c As Cursor