This commit is contained in:
Jose Alberto Guerra Ugalde
2024-11-04 13:20:47 -06:00
parent 7057c92bb6
commit 217b955083
17 changed files with 212 additions and 132 deletions

View File

@@ -26,7 +26,7 @@ Sub Class_Globals
Dim ESPACIO As Int
Dim BLANCO As String
Dim cuenta As String
Dim tipo_venta As String = "PREVENTA"
Dim tipo_venta As String = Subs.traeTipoVentaDeBD
Dim MAC_IMPRESORA As String
Dim btAdmin As BluetoothAdmin
Dim Printer1 As EscPosPrinter
@@ -428,6 +428,7 @@ Sub Class_Globals
Private p_transparenteInicioFin As Panel
Dim b_geo As String
Private b_preventa As Button
End Sub
'You can add more parameters here.
@@ -486,6 +487,10 @@ End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Sub B4XPage_Appear
gest.Text = "PreVenta"
If Subs.traeTipoVentaDeBD = "VENTA" Then gest.Text = "Venta"
If la_cuenta.Text = "0" Then gest.Text = "Carga Abordo"
iniciofin
que_modulo = 1
dentroDeGeocerca = False
indicePregunta = 0
@@ -501,12 +506,13 @@ Sub B4XPage_Appear
cercavalor = 0
l_version.Text = Application.VersionName
p_transparenteInicioFin.Width = Root.Width : p_transparenteInicioFin.Height = Root.Height
b_preventa.left = (Root.Width / 2) - (b_preventa.width / 2)
b_Inicio_Fin_venta.Left = 5
b_Inicio_Fin_venta.Width = Root.Width - 10
b_Inicio_Fin_venta.Text = "INICIAR VENTA"
b_Inicio_Fin_venta.BringToFront
' LogColor(">>>>>> EN VENTA: " & Starter.enVenta, Colors.red)
If Not(Starter.enVenta) And la_cuenta.Text <> "0" Then
If Not(Starter.enVenta) Then
b_Inicio_Fin_venta.Visible = True
Log("EnVenta Visible")
Else
@@ -699,8 +705,8 @@ Sub B4XPage_Appear
For i = 0 To j3.RowCount -1
Log("aqui tronare?")
j3.Position = i
B4XPages.MainPage.skmt.ExecNonQuery($"update CAT_GUNAPROD set cat_gp_almacen = cat_gp_almacen + ${j3.GetString("PE_CANT")} where cat_gp_id = '${j3.Getstring("PE_PROID")}'"$)
B4XPages.MainPage.skmt.ExecNonQuery2("delete from pedido where pe_cedis in (select pe_cedis from pedido where pe_pronombre = ?) and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?", Array As Object(j3.GetString("PE_PRONOMBRE"), "PREVENTA"))
B4XPages.MainPage.skmt.ExecNonQuery($"update ${Subs.traeTablaProds(tipo_venta)} set cat_gp_almacen = cat_gp_almacen + ${j3.GetString("PE_CANT")} where cat_gp_id = '${j3.Getstring("PE_PROID")}'"$)
B4XPages.MainPage.skmt.ExecNonQuery2("delete from pedido where pe_cedis in (select pe_cedis from pedido where pe_pronombre = ?) and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?", Array As Object(j3.GetString("PE_PRONOMBRE"), tipo_venta))
Next
End If
j3.Close
@@ -802,7 +808,8 @@ Sub B4XPage_Appear
Private s5 As Cursor = B4XPages.MainPage.skmt.ExecQuery2("select iFNULL(sum(PE_RECALCULOTOT),0) as TOTAL_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and (PE_RECALCULO <> ? or PE_RECALCULO <> ? OR PE_RECALCULO IS NOT NULL)",Array As String("","null"))
s5.Position = 0
If c.RowCount > 0 Then
c.Position=0
c.Position = 0
Log(">>>>>> " & c.GetString("CAT_CL_CODIGO"))
la_cuenta.Text = c.GetString("CAT_CL_CODIGO")
la_cuenta_gallina.Text = c.GetString("CAT_CL_CODIGO")
La_nombre.Text = c.GetString("CAT_CL_NOMBRE")
@@ -866,7 +873,7 @@ Sub B4XPage_Appear
End If
total_cliente = s.GetString("TOTAL_CLIE")
m_lat = "0"
If c.GetString("CAT_CL_LAT") <> "" Then m_lat =c.GetString("CAT_CL_LAT")
If c.GetString("CAT_CL_LAT") <> "" Then m_lat = c.GetString("CAT_CL_LAT")
If m_lat.Length < 5 Then m_lat = "0"
m_lon = "0"
If c.GetString("CAT_CL_LONG") <> "" Then m_lon =c.GetString("CAT_CL_LONG")
@@ -888,6 +895,7 @@ Sub B4XPage_Appear
s.Close
End If
'AQUI TERMINA
Starter.idCliente = la_cuenta.text
c = skmt.ExecQuery("SELECT CAT_VA_VALOR FROM CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = 'GEOCERCA'")
If c.RowCount > 0 Then
c.Position = 0
@@ -911,7 +919,7 @@ Sub B4XPage_Appear
End Sub
Sub GPS_LocationChanged (Location1 As Location)
' LogColor($"Entrando a Cliente.GPS_LocationChanged"$, Colors.red)
LogColor($"Entrando a Cliente.GPS_LocationChanged"$, Colors.red)
If Tracker.FLP.GetLastKnownLocation.IsInitialized And Tracker.FLP.GetLastKnownLocation.Latitude <> 0 Then
B4XPages.MainPage.lat_gps = Tracker.FLP.GetLastKnownLocation.Latitude
B4XPages.MainPage.lon_gps = Tracker.FLP.GetLastKnownLocation.Longitude
@@ -951,7 +959,8 @@ Sub GPS_LocationChanged (Location1 As Location)
gest.Visible = False
Tels.Visible = False
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
Log(999)
' b_Inicio_Fin_venta.Visible = False
End If
End If
If geo = "1" Then
@@ -993,7 +1002,8 @@ Sub GPS_LocationChanged (Location1 As Location)
Tels.Visible = False
gest.Visible = False
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
Log(998)
' b_Inicio_Fin_venta.Visible = False
c = skmt.ExecQuery("SELECT PC_CLIENTE FROM PEDIDO_CLIENTE WHERE PC_CLIENTE IN (Select CUENTA from cuentaa)")
If c.RowCount > 0 Then
precision = "0"
@@ -1013,7 +1023,8 @@ Sub GPS_LocationChanged (Location1 As Location)
Tels.Visible = False
gest.Visible = False
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
Log(997)
' b_Inicio_Fin_venta.Visible = False
LA_GEO.TextColor = Colors.Red
If ALMACEN = "1" Then
Tels.Visible = False
@@ -1042,7 +1053,8 @@ Sub GPS_LocationChanged (Location1 As Location)
Tels.Visible = False
gest.Visible = False
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
Log(996)
' b_Inicio_Fin_venta.Visible = False
c = skmt.ExecQuery("SELECT NV_CLIENTE FROM NOVENTA CLIENTE WHERE NV_CLIENTE IN (Select CUENTA from cuentaa)")
If c.RowCount > 0 Then
Tels.Visible = True
@@ -1053,7 +1065,8 @@ Sub GPS_LocationChanged (Location1 As Location)
Tels.Visible = False
gest.Visible = False
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
Log(995)
' b_Inicio_Fin_venta.Visible = False
LA_GEO.TextColor = Colors.Red
If ALMACEN = "1" Then
Tels.Visible = False
@@ -1074,7 +1087,8 @@ Sub GPS_LocationChanged (Location1 As Location)
Tels.Visible = False
gest.Visible = False
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
Log(994)
' b_Inicio_Fin_venta.Visible = False
LA_GEO.TextColor = Colors.Red
If ALMACEN = "1" Then
Tels.Visible = False
@@ -1102,14 +1116,19 @@ Private Sub p_pideGeoPass_Click
End Sub
'Muestra u oculta el boton de inicio y fin de venta
Private Sub iniciofin
Log(">>>>> " & Starter.enVenta)
If Starter.enVenta = False Then
Log(333)
p_transparenteInicioFin.BringToFront
p_transparenteInicioFin.Visible = True
b_Inicio_Fin_venta.Visible = True
' Log("Hacemos visible el boton de Inicio Venta2")
' Log("Hacemos visible el boton de Inicio Venta")
Else
Log(4444)
If b_Inicio_Fin_venta.Text <> "TERMINAR VENTA" Then
Log(555)
p_transparenteInicioFin.Visible = False
b_Inicio_Fin_venta.Visible = False
End If
@@ -1363,25 +1382,14 @@ End Sub
Private Sub b_preguntag_Click
B4XPages.MainPage.skmt.ExecNonQuery2("UPDATE kmt_info2 SET CAT_CL_GIRO = ? WHERE CAT_CL_CODIGO = ? And CAT_CL_NOMBRE = ?", Array As Object (girotienda, la_cuenta.text,La_nombre.Text))
skmt.ExecNonQuery2("INSERT INTO HIST_ENCUESTA_AVISO_GIRO(HEAV_CLIENTE , HEAV_MODULO , HEAV_AVISO ,HEAV_GIRO ) VALUES (?,?,?,?) ", Array As Object( clie_id, ENCUESTA, "ACEPTA",girotienda))
If girotienda <> "Selecciona una opcion" Then
If girotienda = "Tienda de Abarrotes (Abarrotes, Misceláneas, Minisupers, Particulares con Venta y Cremerías)" Then
Dim result As Int= -3
Do While result=-3
result = Msgbox2("Entiendo, acepto y consiento que GUNA usará mis datos Personales y serán tratados acorde con lo establecido en la Ley Federal de Protección de Datos Personales en Posesión de los Particulares (en lo sucesivo la “Ley”), y su respectivo Reglamento; bajo lo manifestado en el Aviso de Privacidad Texto Completo que se encuentra en la página www.guna.com.mx", "AVISO DE PRIVACIDAD","ACEPTO","", "NO ACEPTO",LoadBitmap(File.DirAssets,"alert2.png"))
Select Case result
Case DialogResponse.POSITIVE
' If ALMACEN = "35" Or ALMACEN = "43" Or ALMACEN = "54" Or ALMACEN = "73" Or ALMACEN = "56" Then 'ALMACEN = "7" Then '
' ''Or ALMACEN = "56" ATIZAPAN PEDIGRI
' p_pregunta1.Visible = False
@@ -1398,8 +1406,6 @@ Private Sub b_preguntag_Click
' b_venta.Visible = False
' Guardar.Visible = False
' HIST.Visible = False
'
'
' Else
Log(que_modulo)
If que_modulo = Null Or que_modulo = " " Then que_modulo = "1"
@@ -1428,8 +1434,6 @@ Private Sub b_preguntag_Click
Panel7.Visible = False
else if que_modulo = "2" Then
'' para la m2
If p_m1.IsInitialized And p_m1.Visible Then
p_m1.Visible = False
@@ -1458,14 +1462,11 @@ Private Sub b_preguntag_Click
p_m3.Width = Root.Width * 0.94
SV_ENCUESTA.Panel.Height = p_m3.Height + 60
else if que_modulo = "4" Then
'' para la m4
If p_m3.IsInitialized And p_m3.Visible Then
p_m3.Visible = False
Else
End If
p_pregunta1.Visible = False
p_cliente.Visible = False
@@ -1483,7 +1484,6 @@ Private Sub b_preguntag_Click
cb_p3_m4.SetItems(Items2)
itemselect2 = "Selecciona una opcion"
Dim Items3 As List
Items3.Initialize
Items3.Add("Selecciona una opcion")
@@ -1502,13 +1502,11 @@ Private Sub b_preguntag_Click
itemselect6 = "Selecciona una opcion"
cb_p4_5_m4.SetItems(Items3)
itemselect7 = "Selecciona una opcion"
'
else if que_modulo = "5" Then
'' 'MODULO 5
If p_m4.IsInitialized And p_m4.Visible Then
p_m4.Visible = False
Else
End If
p_cliente.Visible = False
SV_ENCUESTA.Visible = True
@@ -1516,7 +1514,6 @@ Private Sub b_preguntag_Click
SV_ENCUESTA.Panel.LoadLayout("ENCUESTA_M5")
p_modulo5.Width = Root.Width * 0.94
SV_ENCUESTA.Panel.Height = p_modulo5.Height + 30
Dim Items8 As List
Items8.Initialize
Items8.Add("Selecciona una opcion")
@@ -1546,19 +1543,12 @@ Private Sub b_preguntag_Click
End If
Else
p_pregunta1.Visible = False
B4XPages.ShowPage("productos")
End If
' End IF
Case DialogResponse.NEGATIVE
B4XPages.ShowPage("productos")
End Select
Loop
'fin modulos
' If girotienda = "Tienda de Abarrotes (Abarrotes, Misceláneas, Minisupers, Particulares con Venta y Cremerías)" Then
@@ -1705,18 +1695,13 @@ Private Sub b_preguntag_Click
' itemselect7 = "Selecciona una opcion"
' End If
' FIN MODULO 4
' Else
' B4XPages.ShowPage("productos")
' End If
Else
p_pregunta1.Visible = False
B4XPages.ShowPage("productos")
End If
Else
Msgbox("Contesta la pregunta por favor","AVISO")
End If
@@ -1911,8 +1896,8 @@ Sub B_guardaencuesta_Click
p_pregunta1.Visible = False
SV_ENCUESTA.Visible = False
p_cliente.Visible = True
tipo_venta = "PREVENTA"
' StartActivity(colonia2)
' tipo_venta = "PREVENTA"
' StartActivity(colonia2)
B4XPages.ShowPage("productos")
End If
Else
@@ -1946,7 +1931,7 @@ Private Sub B4XPage_CloseRequest As ResumableSub
Else if SV_ENCUESTA.Visible Then
SV_ENCUESTA.visible = False
p_cliente.Visible = True
Else If B4XPages.MainPage.nota Then
' Else If B4XPages.MainPage.nota Then
Else
B4XPages.ShowPage("Clientes")
@@ -1968,7 +1953,8 @@ Sub Guardar_Click
p_transparenteInicioFin.Visible = True
b_Inicio_Fin_venta.Visible = True
b_Inicio_Fin_venta.Text = "TERMINAR VENTA"
Log("Hacemos visible el boton de Terminar Venta3")
' Starter.idCliente = ""
Log("Hacemos visible el boton de Terminar Venta")
End Sub
Sub guardadoventa
@@ -3195,16 +3181,12 @@ Private Sub B_guardaencuesta_m2_Click
CB3_P6_M3.Text = "SAHUAYO"
CB4_P6_M3.Text = "MERZA/DUERO"
CB5_P6_M3.Text = "HUGOSS"
End If
Else
p_pregunta1.Visible = False
SV_ENCUESTA.Visible = False
p_cliente.Visible = True
tipo_venta = "PREVENTA"
' StartActivity(colonia2)
' tipo_venta = "PREVENTA"
B4XPages.ShowPage("productos")
MsgboxAsync("Encuesta guardada","")
End If
@@ -3359,10 +3341,8 @@ Private Sub B_guardaencuesta_m3_Click
p_pregunta1.Visible = False
SV_ENCUESTA.Visible = False
p_cliente.Visible = True
tipo_venta = "PREVENTA"
' StartActivity(colonia2)
' tipo_venta = "PREVENTA"
B4XPages.ShowPage("productos")
MsgboxAsync("Encuesta guardada","")
End If
Else
@@ -3443,14 +3423,11 @@ Private Sub B_guardaencuesta_m4_Click
itemselect16 = "Selecciona una opcion"
MsgboxAsync("Encuesta guardada","")
Else
B4XPages.MainPage.tipo_venta = "PREVENTA"
' B4XPages.ShowPage("productos")
B4XPages.MainPage.tipo_venta = tipo_venta
' tipo_venta = "PREVENTA"
p_pregunta1.Visible = False
SV_ENCUESTA.Visible = False
p_cliente.Visible = True
tipo_venta = "PREVENTA"
B4XPages.ShowPage("productos")
' StartActivity(colonia2)
B4XPages.ShowPage("productos")
End If
Else
@@ -3495,7 +3472,7 @@ Private Sub B_guardaencuesta_m5_Click
skmt.ExecNonQuery2("INSERT INTO ENCUESTA_MODULO5 (CLIENTE, ALMACEN,P1, P2, P3, P4, P5, P6, P7, P8, P9) VALUES (?,?,?,?,?,?,?,?,?,?,?)", Array As Object(Subs.traeCliente, ALMACEN,itemselect8,itemselect9,itemselect10,itemselect11,itemselect12,itemselect13,itemselect14,itemselect15,itemselect16))
SV_ENCUESTA.Visible = False
p_cliente.Visible = True
B4XPages.MainPage.tipo_venta = "PREVENTA"
B4XPages.MainPage.tipo_venta = tipo_venta
B4XPages.ShowPage("productos")
MsgboxAsync("Encuesta guardada","")
Else
@@ -3752,8 +3729,7 @@ Private Sub B_GUARDA_CE_PED_Click
'b_venta.Visible = True
b_like.Visible = False
Guardar.Visible = True
tipo_venta = "PREVENTA"
' StartActivity(colonia2)
' tipo_venta = "PREVENTA"
B4XPages.ShowPage("productos")
End Sub
@@ -4802,4 +4778,8 @@ End Sub
Private Sub p_transparenteInicioFin_Click
End Sub
Private Sub b_preventa_Click
End Sub