mirror of
https://github.com/KeymonSoft/Guna_Preventa.git
synced 2026-04-17 21:06:32 +00:00
- VERSION 5.12.14
- Correcciones del codigo del GPS en Cliente.
This commit is contained in:
@@ -541,14 +541,12 @@ End Sub
|
|||||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||||
|
|
||||||
Sub B4XPage_Appear
|
Sub B4XPage_Appear
|
||||||
Starter.enCliente = true
|
Starter.enCliente = True
|
||||||
Tels.Visible = False
|
Tels.Visible = False
|
||||||
gest.Visible = False
|
gest.Visible = False
|
||||||
' Tels.Enabled = True
|
' Tels.Enabled = True
|
||||||
' gest.Enabled = True
|
' gest.Enabled = True
|
||||||
|
' MejorarPrecisionGPS
|
||||||
MejorarPrecisionGPS
|
|
||||||
'
|
|
||||||
' ' Al aparecer la página del cliente
|
' ' Al aparecer la página del cliente
|
||||||
' InicializarLocalizacionMejorada
|
' InicializarLocalizacionMejorada
|
||||||
|
|
||||||
@@ -609,9 +607,6 @@ Sub B4XPage_Appear
|
|||||||
' b_Inicio_Fin_venta.Visible = False
|
' b_Inicio_Fin_venta.Visible = False
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If Subs.hayPedido Then 'Si hay pedido, deshabilitamos el boton de "No Venta"
|
If Subs.hayPedido Then 'Si hay pedido, deshabilitamos el boton de "No Venta"
|
||||||
Log(">>>>> HAY PEDIDO")
|
Log(">>>>> HAY PEDIDO")
|
||||||
Tels.Enabled = False
|
Tels.Enabled = False
|
||||||
@@ -626,8 +621,6 @@ Sub B4XPage_Appear
|
|||||||
skmt.Initialize(ruta,"kmt.db", True)
|
skmt.Initialize(ruta,"kmt.db", True)
|
||||||
reqManager.Initialize(Me, Starter.server)
|
reqManager.Initialize(Me, Starter.server)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim fotomostrar1 As Cursor = Starter.skmt.ExecQuery("SELECT foto FROM kmt_info3 where CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA) AND foto IS NULL")
|
Dim fotomostrar1 As Cursor = Starter.skmt.ExecQuery("SELECT foto FROM kmt_info3 where CAT_CL_CODIGO IN (SELECT CUENTA FROM CUENTAA) AND foto IS NULL")
|
||||||
If fotomostrar1.RowCount > 0 Then
|
If fotomostrar1.RowCount > 0 Then
|
||||||
ImageView4.Bitmap = LoadBitmap(File.DirAssets,"images.png")
|
ImageView4.Bitmap = LoadBitmap(File.DirAssets,"images.png")
|
||||||
@@ -675,8 +668,6 @@ Sub B4XPage_Appear
|
|||||||
End If
|
End If
|
||||||
c.Close
|
c.Close
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If ALMACEN = "1" Then
|
If ALMACEN = "1" Then
|
||||||
Tels.Visible = False
|
Tels.Visible = False
|
||||||
gest.Visible = True
|
gest.Visible = True
|
||||||
@@ -967,7 +958,6 @@ Sub B4XPage_Appear
|
|||||||
c.Close
|
c.Close
|
||||||
c2.Close
|
c2.Close
|
||||||
c3.Close
|
c3.Close
|
||||||
|
|
||||||
End If
|
End If
|
||||||
If Not(Subs.traemontoprod) Then
|
If Not(Subs.traemontoprod) Then
|
||||||
If Not(Subs.traemontoprod2) Then
|
If Not(Subs.traemontoprod2) Then
|
||||||
@@ -982,16 +972,12 @@ Sub B4XPage_Appear
|
|||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'AQUI CAMBIAR
|
'AQUI CAMBIAR
|
||||||
Private s3 As Cursor=B4XPages.MainPage.skmt.ExecQuery2("select * 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"))
|
Private s3 As Cursor=B4XPages.MainPage.skmt.ExecQuery2("select * 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"))
|
||||||
' LogColor(s3.RowCount,Colors.Yellow)
|
' LogColor(s3.RowCount,Colors.Yellow)
|
||||||
@@ -1165,7 +1151,7 @@ Sub B4XPage_Appear
|
|||||||
B4XPages.MainPage.skmt.ExecNonQuery2("delete from pedido where pe_cedis = 'MYKONOS_01' and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?", Array As Object(tipo_venta))
|
B4XPages.MainPage.skmt.ExecNonQuery2("delete from pedido where pe_cedis = 'MYKONOS_01' and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?", Array As Object(tipo_venta))
|
||||||
' B4XPage_Appear
|
' B4XPage_Appear
|
||||||
Private s3 As Cursor=B4XPages.MainPage.skmt.ExecQuery2("select * 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"))
|
Private s3 As Cursor=B4XPages.MainPage.skmt.ExecQuery2("select * 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"))
|
||||||
' LogColor(s3.RowCount,Colors.Yellow)
|
' LogColor(s3.RowCount,Colors.Yellow)
|
||||||
If s3.RowCount > 0 Then
|
If s3.RowCount > 0 Then
|
||||||
c=B4XPages.MainPage.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,CAT_CL_NUM_SERIEFISICO,IFNULL(CAT_CL_BCREDITO,0) AS CAT_CL_BCREDITO from kmt_info3 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
c=B4XPages.MainPage.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,CAT_CL_NUM_SERIEFISICO,IFNULL(CAT_CL_BCREDITO,0) AS CAT_CL_BCREDITO from kmt_info3 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
||||||
s=B4XPages.MainPage.skmt.ExecQuery2("select iFNULL(sum(pe_costo_tot),0) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and (PE_RECALCULO = ? or PE_RECALCULO = ? or PE_RECALCULO IS NULL)",Array As String("","null"))
|
s=B4XPages.MainPage.skmt.ExecQuery2("select iFNULL(sum(pe_costo_tot),0) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa) and (PE_RECALCULO = ? or PE_RECALCULO = ? or PE_RECALCULO IS NULL)",Array As String("","null"))
|
||||||
@@ -1230,14 +1216,11 @@ Sub B4XPage_Appear
|
|||||||
|
|
||||||
Dim pagarepen As Cursor = B4XPages.MainPage.skmt.ExecQuery("select FECHA, SALDO_PENDIENTE FROM ABONOSP WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
Dim pagarepen As Cursor = B4XPages.MainPage.skmt.ExecQuery("select FECHA, SALDO_PENDIENTE FROM ABONOSP WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
||||||
If pagarepen.RowCount > 0 Then
|
If pagarepen.RowCount > 0 Then
|
||||||
|
|
||||||
|
|
||||||
pagarepen.Position = 0
|
pagarepen.Position = 0
|
||||||
DateTime.DateFormat="dd/MM/yyyy"
|
DateTime.DateFormat="dd/MM/yyyy"
|
||||||
Dim FechaInicio As String = pagarepen.GetString("FECHA") ' Formato: dd/MM/yyyy
|
Dim FechaInicio As String = pagarepen.GetString("FECHA") ' Formato: dd/MM/yyyy
|
||||||
' Dim FechaHoy As String = DateTime.Date(DateTime.Now) ' Fecha actual en formato dd/MM/yyyy
|
' Dim FechaHoy As String = DateTime.Date(DateTime.Now) ' Fecha actual en formato dd/MM/yyyy
|
||||||
Log(pagarepen.GetString("FECHA"))
|
Log(pagarepen.GetString("FECHA"))
|
||||||
|
|
||||||
' Convertir las fechas a milisegundos (desde 01/01/1970)
|
' Convertir las fechas a milisegundos (desde 01/01/1970)
|
||||||
Dim TicksInicio As Long = DateTime.DateParse(FechaInicio)
|
Dim TicksInicio As Long = DateTime.DateParse(FechaInicio)
|
||||||
Dim TicksHoy As Long = DateTime.DateParse(DateTime.Date(DateTime.Now))
|
Dim TicksHoy As Long = DateTime.DateParse(DateTime.Date(DateTime.Now))
|
||||||
@@ -1257,13 +1240,11 @@ Sub B4XPage_Appear
|
|||||||
Else If DiferenciaDias > c4.GetInt("CAT_CL_DIASCREDITO") + 1 Then
|
Else If DiferenciaDias > c4.GetInt("CAT_CL_DIASCREDITO") + 1 Then
|
||||||
l_credito.Color = Colors.Red
|
l_credito.Color = Colors.Red
|
||||||
l_limite.Color = Colors.Red
|
l_limite.Color = Colors.Red
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
l_credito.Color = Colors.Transparent
|
l_credito.Color = Colors.Transparent
|
||||||
l_limite.Color = Colors.Transparent
|
l_limite.Color = Colors.Transparent
|
||||||
End If
|
End If
|
||||||
|
|
||||||
l_credito.Visible = True
|
l_credito.Visible = True
|
||||||
l_limite.Visible = True
|
l_limite.Visible = True
|
||||||
l_limite.Text = c.GetInt("CAT_CL_LIMITECREDITO")
|
l_limite.Text = c.GetInt("CAT_CL_LIMITECREDITO")
|
||||||
@@ -1278,11 +1259,8 @@ Sub B4XPage_Appear
|
|||||||
|
|
||||||
Dim coloressaldo As Cursor=B4XPages.MainPage.skmt.ExecQuery("select IFNULL(CAT_CL_CLASIFICADOR3,0) AS CAT_CL_CLASIFICADOR3, IFNULL(CAT_CL_CLASIFICADOR2,'') AS CAT_CL_CLASIFICADOR2 from kmt_info3 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
Dim coloressaldo As Cursor=B4XPages.MainPage.skmt.ExecQuery("select IFNULL(CAT_CL_CLASIFICADOR3,0) AS CAT_CL_CLASIFICADOR3, IFNULL(CAT_CL_CLASIFICADOR2,'') AS CAT_CL_CLASIFICADOR2 from kmt_info3 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
||||||
coloressaldo.Position = 0
|
coloressaldo.Position = 0
|
||||||
|
|
||||||
la_saldooper.Text = coloressaldo.GetDouble("CAT_CL_CLASIFICADOR3")
|
la_saldooper.Text = coloressaldo.GetDouble("CAT_CL_CLASIFICADOR3")
|
||||||
|
|
||||||
l_animal.Text = coloressaldo.GetString("CAT_CL_CLASIFICADOR2")
|
l_animal.Text = coloressaldo.GetString("CAT_CL_CLASIFICADOR2")
|
||||||
|
|
||||||
If coloressaldo.GetString("CAT_CL_CLASIFICADOR2") = "Chimpancé KIN" Then
|
If coloressaldo.GetString("CAT_CL_CLASIFICADOR2") = "Chimpancé KIN" Then
|
||||||
l_animal.Color = Colors.RGB(84,255,172)
|
l_animal.Color = Colors.RGB(84,255,172)
|
||||||
Label22.Color = Colors.RGB(84,255,172)
|
Label22.Color = Colors.RGB(84,255,172)
|
||||||
@@ -1299,7 +1277,6 @@ Sub B4XPage_Appear
|
|||||||
l_animal.Color = Colors.Transparent
|
l_animal.Color = Colors.Transparent
|
||||||
Label22.Color = Colors.Transparent
|
Label22.Color = Colors.Transparent
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub MejorarPrecisionGPS As ResumableSub
|
Sub MejorarPrecisionGPS As ResumableSub
|
||||||
@@ -1321,7 +1298,6 @@ Sub MejorarPrecisionGPS As ResumableSub
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Return False ' No se logró buena precisión
|
Return False ' No se logró buena precisión
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1329,16 +1305,11 @@ End Sub
|
|||||||
Sub recalculoXcant
|
Sub recalculoXcant
|
||||||
' Private c As Cursor = B4XPages.MainPage.skmt.ExecQuery2("SELECT* FROM PEDIDO JOIN CAT_PROMOS_DESCUENTOS ON CAT_PD_PRODUCTO = PE_PROID WHERE PE_CLIENTE IN (Select CUENTA FROM CUENTAA) AND PE_CEDIS = ? AND PE_CANT >= CAT_PD_RANGO AND CAT_PD_RANGO2 <= PE_CANT", Array As String(Subs.traeAlmacen))
|
' Private c As Cursor = B4XPages.MainPage.skmt.ExecQuery2("SELECT* FROM PEDIDO JOIN CAT_PROMOS_DESCUENTOS ON CAT_PD_PRODUCTO = PE_PROID WHERE PE_CLIENTE IN (Select CUENTA FROM CUENTAA) AND PE_CEDIS = ? AND PE_CANT >= CAT_PD_RANGO AND CAT_PD_RANGO2 <= PE_CANT", Array As String(Subs.traeAlmacen))
|
||||||
Private c As Cursor = B4XPages.MainPage.skmt.ExecQuery2("SELECT * FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA FROM CUENTAA) AND PE_CEDIS = ? ", Array As String(Subs.traeAlmacen))
|
Private c As Cursor = B4XPages.MainPage.skmt.ExecQuery2("SELECT * FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA FROM CUENTAA) AND PE_CEDIS = ? ", Array As String(Subs.traeAlmacen))
|
||||||
|
|
||||||
|
|
||||||
If c.RowCount > 0 Then
|
If c.RowCount > 0 Then
|
||||||
For promespdes = 0 To c.RowCount -1
|
For promespdes = 0 To c.RowCount -1
|
||||||
c.Position = promespdes
|
c.Position = promespdes
|
||||||
Dim rangosel As Cursor= B4XPages.MainPage.skmt.ExecQuery2("SELECT * FROM CAT_PROMOS_DESCUENTOS WHERE CAT_PD_PRODUCTO = ? AND CAT_PD_RANGO <= ? AND CAT_PD_RANGO2 >= ?",Array As String(c.GetString("PE_PROID"),c.GetInt("PE_CANT"),c.GetInt("PE_CANT")))
|
Dim rangosel As Cursor= B4XPages.MainPage.skmt.ExecQuery2("SELECT * FROM CAT_PROMOS_DESCUENTOS WHERE CAT_PD_PRODUCTO = ? AND CAT_PD_RANGO <= ? AND CAT_PD_RANGO2 >= ?",Array As String(c.GetString("PE_PROID"),c.GetInt("PE_CANT"),c.GetInt("PE_CANT")))
|
||||||
If rangosel.RowCount > 0 Then
|
If rangosel.RowCount > 0 Then
|
||||||
|
|
||||||
' delete fromo pedido where cliete = estecliente!!! y prodId = esteID
|
|
||||||
|
|
||||||
For hjh = 0 To rangosel.RowCount-1
|
For hjh = 0 To rangosel.RowCount-1
|
||||||
rangosel.Position = hjh
|
rangosel.Position = hjh
|
||||||
If rangosel.GetString("CAT_PD_TIER").Contains(Subs.traeTipoCliente) Then
|
If rangosel.GetString("CAT_PD_TIER").Contains(Subs.traeTipoCliente) Then
|
||||||
@@ -1355,12 +1326,9 @@ Sub recalculoXcant
|
|||||||
Next
|
Next
|
||||||
Else ' No cumple el rango ...
|
Else ' No cumple el rango ...
|
||||||
Dim rangosel2 As Cursor= B4XPages.MainPage.skmt.ExecQuery2("SELECT * FROM CAT_PROMOS_DESCUENTOS WHERE CAT_PD_PRODUCTO = ? and ? > cat_pd_rango2",Array As String(c.GetString("PE_PROID"),c.GetInt("PE_CANT")))
|
Dim rangosel2 As Cursor= B4XPages.MainPage.skmt.ExecQuery2("SELECT * FROM CAT_PROMOS_DESCUENTOS WHERE CAT_PD_PRODUCTO = ? and ? > cat_pd_rango2",Array As String(c.GetString("PE_PROID"),c.GetInt("PE_CANT")))
|
||||||
|
|
||||||
' definir rango sup y cantidad
|
' definir rango sup y cantidad
|
||||||
|
|
||||||
If rangosel2.RowCount > 0 Then
|
If rangosel2.RowCount > 0 Then
|
||||||
' rangosel2.Position = 0
|
' rangosel2.Position = 0
|
||||||
|
|
||||||
For hjh = 0 To rangosel2.RowCount-1
|
For hjh = 0 To rangosel2.RowCount-1
|
||||||
rangosel2.Position = hjh
|
rangosel2.Position = hjh
|
||||||
If rangosel2.GetString("CAT_PD_TIER").Contains(Subs.traeTipoCliente) Then
|
If rangosel2.GetString("CAT_PD_TIER").Contains(Subs.traeTipoCliente) Then
|
||||||
@@ -1372,20 +1340,17 @@ Sub recalculoXcant
|
|||||||
Log(NumberFormat2(((c.GetString("PE_COSTOU") * rangosel2.GetString("CAT_PD_DESCUENTO"))/100),0,2,2,False))
|
Log(NumberFormat2(((c.GetString("PE_COSTOU") * rangosel2.GetString("CAT_PD_DESCUENTO"))/100),0,2,2,False))
|
||||||
Log(rangosel2.GetString("CAT_PD_DESCUENTO"))
|
Log(rangosel2.GetString("CAT_PD_DESCUENTO"))
|
||||||
Private recalculototal As Float = rangosel2.GetString("CAT_PD_RANGO2") * recalculo
|
Private recalculototal As Float = rangosel2.GetString("CAT_PD_RANGO2") * recalculo
|
||||||
|
|
||||||
' Restar total cantidad menos rango mayor para obtener la diferencia y saber cuanto hay de mas
|
' Restar total cantidad menos rango mayor para obtener la diferencia y saber cuanto hay de mas
|
||||||
|
|
||||||
' INSERT de producto (diferencia entre el rango sup y cantidad de pedido
|
' INSERT de producto (diferencia entre el rango sup y cantidad de pedido
|
||||||
|
|
||||||
skmt.ExecNonQuery2("UPDATE PEDIDO set PE_RECALCULO = ?, PE_RECALCULOTOT = ?, PE_RECCEDIS = ?, PE_RECCANT = ? WHERE PE_PROID = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) ",Array As String(NumberFormat2(recalculo,0,2,2,False),NumberFormat2(recalculototal,0,2,2,False),rangosel2.GetString("CAT_PD_COD_PROMO"), rangosel2.GetString("CAT_PD_RANGO2"),c.GetString("PE_PROID")))
|
skmt.ExecNonQuery2("UPDATE PEDIDO set PE_RECALCULO = ?, PE_RECALCULOTOT = ?, PE_RECCEDIS = ?, PE_RECCANT = ? WHERE PE_PROID = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) ",Array As String(NumberFormat2(recalculo,0,2,2,False),NumberFormat2(recalculototal,0,2,2,False),rangosel2.GetString("CAT_PD_COD_PROMO"), rangosel2.GetString("CAT_PD_RANGO2"),c.GetString("PE_PROID")))
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
skmt.ExecNonQuery2("UPDATE PEDIDO set PE_RECALCULO = NULL, PE_RECALCULOTOT = NULL, PE_RECCEDIS = NULL, PE_RECCANT = NULL WHERE PE_PROID = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) ",Array As String(c.GetString("PE_PROID")))
|
skmt.ExecNonQuery2("UPDATE PEDIDO set PE_RECALCULO = NULL, PE_RECALCULOTOT = NULL, PE_RECCEDIS = NULL, PE_RECCANT = NULL WHERE PE_PROID = ? AND PE_CLIENTE IN (SELECT CUENTA FROM CUENTAA) ",Array As String(c.GetString("PE_PROID")))
|
||||||
End If
|
End If
|
||||||
|
rangosel2.Close
|
||||||
End If
|
End If
|
||||||
|
rangosel.Close
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1396,31 +1361,25 @@ Private Sub LA_GPS_Click
|
|||||||
ToastMessageShow("Mejorando precisión GPS...", False)
|
ToastMessageShow("Mejorando precisión GPS...", False)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
' En lugar de 100m y 50m, usar valores más amplios temporalmente
|
' En lugar de 100m y 50m, usar valores más amplios temporalmente
|
||||||
Private Sub RevisarGeocerca
|
Private Sub RevisarGeocerca
|
||||||
' Dim distanciaAlmacen As Int = distancealm ' Tu cálculo actual
|
' Dim distanciaAlmacen As Int = distancealm ' Tu cálculo actual
|
||||||
' Dim distanciaCliente As Int = distance ' Tu cálculo al cliente
|
' Dim distanciaCliente As Int = distance ' Tu cálculo al cliente
|
||||||
Log(distancealm)
|
Log(distancealm)
|
||||||
Log(distance)
|
Log(distance)
|
||||||
' Usar umbrales más amplios (ej: 150m y 80m)
|
' Usar umbrales más amplios (ej: 150m y 80m)
|
||||||
|
|
||||||
|
|
||||||
If distancealm > 0 Or distance > 50 Then
|
If distancealm > 0 Or distance > 50 Then
|
||||||
|
|
||||||
If distancealm < 100 Or distance < 50 Then
|
If distancealm < 100 Or distance < 50 Then
|
||||||
HabilitarBotones(True)
|
HabilitarBotones(True)
|
||||||
Else
|
Else
|
||||||
HabilitarBotones(True)
|
HabilitarBotones(True)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub HabilitarBotones(dentroDeRango As Boolean)
|
Sub HabilitarBotones(dentroDeRango As Boolean)
|
||||||
If dentroDeRango Then
|
If dentroDeRango Then
|
||||||
If Tels.IsInitialized Then
|
If Tels.IsInitialized Then
|
||||||
|
|
||||||
Tels.Visible = True
|
Tels.Visible = True
|
||||||
gest.Visible = True
|
gest.Visible = True
|
||||||
Tels.Enabled = True
|
Tels.Enabled = True
|
||||||
@@ -1429,7 +1388,6 @@ Sub HabilitarBotones(dentroDeRango As Boolean)
|
|||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
If Tels.IsInitialized Then
|
If Tels.IsInitialized Then
|
||||||
|
|
||||||
Tels.Visible = False
|
Tels.Visible = False
|
||||||
gest.Visible = False
|
gest.Visible = False
|
||||||
' ToastMessageShow("FUERA de rango GPS - Botones deshabilitados", False)
|
' ToastMessageShow("FUERA de rango GPS - Botones deshabilitados", False)
|
||||||
@@ -1441,16 +1399,11 @@ Sub InicializarLocalizacionMejorada
|
|||||||
' Usar tanto GPS como red para mejor precisión
|
' Usar tanto GPS como red para mejor precisión
|
||||||
Dim LocationManager As JavaObject
|
Dim LocationManager As JavaObject
|
||||||
LocationManager.InitializeStatic("android.location.LocationManager")
|
LocationManager.InitializeStatic("android.location.LocationManager")
|
||||||
|
|
||||||
' Solicitar ubicaciones de GPS y red
|
' Solicitar ubicaciones de GPS y red
|
||||||
g.Start(0, 0) ' GPS
|
g.Start(0, 0) ' GPS
|
||||||
' También podrías usar la ubicación por red para casos interiores
|
' También podrías usar la ubicación por red para casos interiores
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'Sub GPS_LocationChanged (Location1 As Location)
|
|
||||||
'
|
|
||||||
'End Sub
|
|
||||||
'
|
|
||||||
Sub GPS_LocationChanged (Location1 As Location)
|
Sub GPS_LocationChanged (Location1 As Location)
|
||||||
LogColor($"Entrando a Cliente.GPS_LocationChanged"$, Colors.red)
|
LogColor($"Entrando a Cliente.GPS_LocationChanged"$, Colors.red)
|
||||||
' Log($"${Location1.Latitude}, ${Location1.Longitude}"$)
|
' Log($"${Location1.Latitude}, ${Location1.Longitude}"$)
|
||||||
@@ -1533,7 +1486,6 @@ Sub GPS_LocationChanged (Location1 As Location)
|
|||||||
Dim ubi1, ubi2 As Location
|
Dim ubi1, ubi2 As Location
|
||||||
ubi1.Initialize2(B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps)
|
ubi1.Initialize2(B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps)
|
||||||
ubi2.Initialize2(al_latitud, al_longitud)
|
ubi2.Initialize2(al_latitud, al_longitud)
|
||||||
|
|
||||||
distancealm = ubi1.DistanceTo(ubi2)
|
distancealm = ubi1.DistanceTo(ubi2)
|
||||||
End If
|
End If
|
||||||
' Mostrar la precisión actual
|
' Mostrar la precisión actual
|
||||||
@@ -1718,13 +1670,11 @@ Sub GPS_LocationChanged (Location1 As Location)
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' RevisarGeocerca
|
' RevisarGeocerca
|
||||||
Else
|
Else
|
||||||
If LA_GPS.IsInitialized Then
|
If LA_GPS.IsInitialized Then
|
||||||
' LA_GPS.Text = $"UBICACIÓN - Precisión: ${NumberFormat2(Location1.Accuracy, 0, 1, 1, False)}m"$
|
' LA_GPS.Text = $"UBICACIÓN - Precisión: ${NumberFormat2(Location1.Accuracy, 0, 1, 1, False)}m"$
|
||||||
LA_GPS.Text = $"BAJA PRECISIÓN (${NumberFormat2(Location1.Accuracy, 0, 1, 1, False)}m)"$
|
LA_GPS.Text = $"BAJA PRECISIÓN (${NumberFormat2(Location1.Accuracy, 0, 1, 1, False)}m)"$
|
||||||
|
|
||||||
LA_GPS.TextColor = Colors.Red
|
LA_GPS.TextColor = Colors.Red
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -1877,8 +1827,6 @@ Sub JobDone(Job As HttpJob)
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
' If Job.JobName = "DBRequest" Then
|
' If Job.JobName = "DBRequest" Then
|
||||||
' Dim result1 As DBResult = reqManager.HandleJob(Job)
|
' Dim result1 As DBResult = reqManager.HandleJob(Job)
|
||||||
' If result1.Tag = "CHECAENCUESTA" Then 'query tag
|
' If result1.Tag = "CHECAENCUESTA" Then 'query tag
|
||||||
@@ -1897,12 +1845,8 @@ Sub JobDone(Job As HttpJob)
|
|||||||
' End If
|
' End If
|
||||||
' End If
|
' End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If result1.Tag = "kmt_datos_foto" Then 'query tag
|
If result1.Tag = "kmt_datos_foto" Then 'query tag
|
||||||
|
|
||||||
For Each records() As Object In result1.Rows
|
For Each records() As Object In result1.Rows
|
||||||
|
|
||||||
Dim CAT_CL_FOTO() As Byte = records(result1.Columns.Get("CAT_CL_FOTO"))
|
Dim CAT_CL_FOTO() As Byte = records(result1.Columns.Get("CAT_CL_FOTO"))
|
||||||
Next
|
Next
|
||||||
Log("si paso")
|
Log("si paso")
|
||||||
@@ -1923,17 +1867,10 @@ Sub JobDone(Job As HttpJob)
|
|||||||
Bitmap1.Initialize2(InputStream1)
|
Bitmap1.Initialize2(InputStream1)
|
||||||
InputStream1.Close
|
InputStream1.Close
|
||||||
ImageView4.Bitmap = Bitmap1
|
ImageView4.Bitmap = Bitmap1
|
||||||
|
|
||||||
Log("aqui si hay foto")
|
Log("aqui si hay foto")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Job.Release
|
Job.Release
|
||||||
End Sub
|
End Sub
|
||||||
@@ -1943,10 +1880,9 @@ Sub ListView1_ItemLongClick (Position As Int, Value As Object)
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub gest_Click
|
Sub gest_Click
|
||||||
|
' Mejorar precisión antes de procesar la venta
|
||||||
' Mejorar precisión antes de procesar la venta
|
' MejorarPrecisionGPS
|
||||||
MejorarPrecisionGPS
|
' Sleep(500) ' Esperar un poco para que el GPS se estabilice
|
||||||
Sleep(500) ' Esperar un poco para que el GPS se estabilice
|
|
||||||
|
|
||||||
Dim pagarepen As Cursor = B4XPages.MainPage.skmt.ExecQuery("select FECHA, SALDO_PENDIENTE FROM ABONOSP WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
Dim pagarepen As Cursor = B4XPages.MainPage.skmt.ExecQuery("select FECHA, SALDO_PENDIENTE FROM ABONOSP WHERE CLIENTE IN (SELECT CUENTA FROM CUENTAA)")
|
||||||
If pagarepen.RowCount > 0 Then
|
If pagarepen.RowCount > 0 Then
|
||||||
@@ -1969,11 +1905,8 @@ Sub gest_Click
|
|||||||
c=B4XPages.MainPage.skmt.ExecQuery("select IFNULL(CAT_CL_DIASCREDITO,0) AS CAT_CL_DIASCREDITO from kmt_info3 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
c=B4XPages.MainPage.skmt.ExecQuery("select IFNULL(CAT_CL_DIASCREDITO,0) AS CAT_CL_DIASCREDITO from kmt_info3 where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
||||||
c.Position = 0
|
c.Position = 0
|
||||||
|
|
||||||
|
|
||||||
If DiferenciaDias <= c.GetInt("CAT_CL_DIASCREDITO") + 1 Then
|
If DiferenciaDias <= c.GetInt("CAT_CL_DIASCREDITO") + 1 Then
|
||||||
|
|
||||||
' MsgboxAsync($"Favor de pagar su credito el día de mañana por un monto de $${pagarepen.GetString("SALDO_PENDIENTE")}"$, "Recordatorio")
|
' MsgboxAsync($"Favor de pagar su credito el día de mañana por un monto de $${pagarepen.GetString("SALDO_PENDIENTE")}"$, "Recordatorio")
|
||||||
|
|
||||||
Msgbox2Async($"Favor de pagar su credito el día de mañana por un monto de $${pagarepen.GetString("SALDO_PENDIENTE")}"$, "Recordatorio", "Ok", "", "", LoadBitmap(File.DirAssets,"alert2.png"), False)
|
Msgbox2Async($"Favor de pagar su credito el día de mañana por un monto de $${pagarepen.GetString("SALDO_PENDIENTE")}"$, "Recordatorio", "Ok", "", "", LoadBitmap(File.DirAssets,"alert2.png"), False)
|
||||||
Wait For Msgbox_Result (resultado As Int)
|
Wait For Msgbox_Result (resultado As Int)
|
||||||
If resultado = DialogResponse.POSITIVE Then
|
If resultado = DialogResponse.POSITIVE Then
|
||||||
@@ -1982,11 +1915,8 @@ Sub gest_Click
|
|||||||
Else If DiferenciaDias > c.GetInt("CAT_CL_DIASCREDITO") + 1 Then
|
Else If DiferenciaDias > c.GetInt("CAT_CL_DIASCREDITO") + 1 Then
|
||||||
MsgboxAsync($"No se puede realizar venta por que presenta ${(DiferenciaDias-(c.GetInt("CAT_CL_DIASCREDITO") +1))} días de atraso en el credito, por un monto de $${pagarepen.GetString("SALDO_PENDIENTE")}"$, "Atención")
|
MsgboxAsync($"No se puede realizar venta por que presenta ${(DiferenciaDias-(c.GetInt("CAT_CL_DIASCREDITO") +1))} días de atraso en el credito, por un monto de $${pagarepen.GetString("SALDO_PENDIENTE")}"$, "Atención")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
gestionar
|
gestionar
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ Version=12.8
|
|||||||
#Region Project Attributes
|
#Region Project Attributes
|
||||||
#ApplicationLabel: Guna Preventa
|
#ApplicationLabel: Guna Preventa
|
||||||
#VersionCode: 1
|
#VersionCode: 1
|
||||||
#VersionName: 5.12.13
|
#VersionName: 5.12.14
|
||||||
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
||||||
#SupportedOrientations: portrait
|
#SupportedOrientations: portrait
|
||||||
#CanInstallToExternalStorage: False
|
#CanInstallToExternalStorage: False
|
||||||
|
|||||||
@@ -88,6 +88,6 @@ ModuleClosedNodes6=
|
|||||||
ModuleClosedNodes7=6,8,9,10,11
|
ModuleClosedNodes7=6,8,9,10,11
|
||||||
ModuleClosedNodes8=
|
ModuleClosedNodes8=
|
||||||
ModuleClosedNodes9=
|
ModuleClosedNodes9=
|
||||||
NavigationStack=C_Cliente,EnviarPDFWhatsAppNumero,6469,4,C_Cliente,GPS_LocationChanged,1453,6,C_Cliente,Impresion3,3210,0,C_Cliente,PDFGENERAR2,6361,0,B4XMainPage,Entrar_LongClick,506,0,C_Principal,resdia_Click,2867,0,C_Principal,B4XPage_Appear,495,0,C_Cliente,B4XPage_Appear,863,0,C_Principal,Subir_Click,743,6,B4XMainPage,Class_Globals,25,0
|
NavigationStack=C_Cliente,b_geopass_Click,1763,0,C_Cliente,iniciofin,1738,0,C_Cliente,p_pideGeoPass_Click,1723,0,C_Cliente,GPS_LocationChanged,1449,0,C_Cliente,InicializarLocalizacionMejorada,1411,0,C_Cliente,HabilitarBotones,1390,0,C_Cliente,RevisarGeocerca,1375,0,C_Cliente,LA_GPS_Click,1366,0,C_Cliente,MejorarPrecisionGPS,1296,0,C_Cliente,recalculoXcant,1301,0,C_Cliente,B4XPage_Appear,1252,0
|
||||||
SelectedBuild=0
|
SelectedBuild=0
|
||||||
VisibleModules=27,2,16,28,5,13,17,29,19,4,12,22
|
VisibleModules=27,2,16,28,5,13,17,29,19,4,12,22
|
||||||
|
|||||||
@@ -458,6 +458,20 @@ Private Sub CreateLocationRequestSmallD As LocationRequest
|
|||||||
Return lr
|
Return lr
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CreateLocationRequest2 As LocationRequest
|
||||||
|
Private logger As Boolean = True
|
||||||
|
If logger Then Log("Iniciamos CreateLocationRequest2")
|
||||||
|
Dim lr As LocationRequest
|
||||||
|
lr.Initialize
|
||||||
|
lr.SetInterval(1000) 'Intervalo deseado para actualizaciones de ubicacion
|
||||||
|
lr.SetFastestInterval(lr.GetInterval / 2) 'Intervalo minimo para actualizaciones de ubicacion
|
||||||
|
lr.setNumUpdates(2) 'Solicitamos solo 2 actualizaciones con estos parametros
|
||||||
|
lr.SetSmallestDisplacement(1) 'Solo registra cambio de ubicacion si es mayor a XX mts
|
||||||
|
lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY)
|
||||||
|
actualLR=lr
|
||||||
|
Return lr
|
||||||
|
End Sub
|
||||||
|
|
||||||
Sub dameUltimaUbicacionConocida
|
Sub dameUltimaUbicacionConocida
|
||||||
If FLP.GetLastKnownLocation.IsInitialized Then 'Mandamos ultima ubicacion guardada
|
If FLP.GetLastKnownLocation.IsInitialized Then 'Mandamos ultima ubicacion guardada
|
||||||
' If Main.logger Then Log("Mandamos UUC : "&formatoFecha(FLP.GetLastKnownLocation.Time))
|
' If Main.logger Then Log("Mandamos UUC : "&formatoFecha(FLP.GetLastKnownLocation.Time))
|
||||||
@@ -476,20 +490,6 @@ Public Sub StopFLP
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CreateLocationRequest2 As LocationRequest
|
|
||||||
Private logger As Boolean = True
|
|
||||||
If logger Then Log("Iniciamos CreateLocationRequest2")
|
|
||||||
Dim lr As LocationRequest
|
|
||||||
lr.Initialize
|
|
||||||
lr.SetInterval(1000) 'Intervalo deseado para actualizaciones de ubicacion
|
|
||||||
lr.SetFastestInterval(lr.GetInterval / 2) 'Intervalo minimo para actualizaciones de ubicacion
|
|
||||||
lr.setNumUpdates(2) 'Solicitamos solo 2 actualizaciones con estos parametros
|
|
||||||
lr.SetSmallestDisplacement(1) 'Solo registra cambio de ubicacion si es mayor a XX mts
|
|
||||||
lr.SetPriority(lr.Priority.PRIORITY_HIGH_ACCURACY)
|
|
||||||
actualLR=lr
|
|
||||||
Return lr
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Sub flp_LocationChanged (Location1 As Location)
|
Sub flp_LocationChanged (Location1 As Location)
|
||||||
Log($"Loc changed:${Location1.Longitude},${Location1.Latitude}"$)
|
Log($"Loc changed:${Location1.Longitude},${Location1.Latitude}"$)
|
||||||
' ToastMessageShow("Loc changed", False)
|
' ToastMessageShow("Loc changed", False)
|
||||||
|
|||||||
28
B4A/_juntaBas.ps1
Normal file
28
B4A/_juntaBas.ps1
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# SCRIPT: _juntaBas.ps1 - Versión Saneada y Optimizada para LLM
|
||||||
|
$OutputFile="_CODIGO_COMPLETO_PARA_LLM.txt"
|
||||||
|
|
||||||
|
# Eliminar el archivo anterior si existe (IMPORTANTE)
|
||||||
|
Remove-Item -Path $OutputFile -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
Write-Host "Iniciando fusion para LLM..."
|
||||||
|
|
||||||
|
# Itera sobre los archivos .bas, .b4a, .b4j
|
||||||
|
Get-ChildItem -Path ".\*" -Include @("*.bas", "*.b4a", "*.b4j") | ForEach-Object {
|
||||||
|
$currentFile = $_.Name
|
||||||
|
Write-Host "Procesando: $currentFile"
|
||||||
|
|
||||||
|
# --- ENCABEZADO ESTRUCTURADO Y COMENTADO EN B4X (Agregado al archivo) ---
|
||||||
|
Add-Content -Path $OutputFile -Value "`n'======================================================================================"
|
||||||
|
Add-Content -Path $OutputFile -Value $"// ARCHIVO_INICIO: ${currentFile}"
|
||||||
|
Add-Content -Path $OutputFile -Value "'======================================================================================`n"
|
||||||
|
|
||||||
|
# Vuelca el contenido del archivo
|
||||||
|
Get-Content -Encoding UTF8 -Path $_.FullName -Raw | Add-Content -Path $OutputFile
|
||||||
|
|
||||||
|
# --- DELIMITADOR DE FIN DE ARCHIVO (Agregado al archivo) ---
|
||||||
|
Add-Content -Path $OutputFile -Value "`n'======================================================================================"
|
||||||
|
Add-Content -Path $OutputFile -Value $"// ARCHIVO_FIN: ${currentFile}"
|
||||||
|
Add-Content -Path $OutputFile -Value "'======================================================================================`n"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "`nProceso terminado. Se ha creado el archivo: $OutputFile"
|
||||||
Reference in New Issue
Block a user