mirror of
https://github.com/KeymonSoft/ADM2.git
synced 2026-04-17 19:36:33 +00:00
VERSION 6.01.01
- Se cambia e envio de las fotos a una formma para guardarlas en disco y no en BD - Se agrega la hora de inico a las NO Ventas de la Bitacora!
This commit is contained in:
@@ -7,11 +7,11 @@ Version=11.5
|
||||
Sub Class_Globals
|
||||
Private Root As B4XView 'ignore
|
||||
Private xui As XUI 'ignore
|
||||
|
||||
|
||||
Dim g As GPS
|
||||
Dim ruta As String
|
||||
Dim c As Cursor
|
||||
|
||||
|
||||
Dim CANCELA As Button
|
||||
Dim GUARDA As Button
|
||||
Dim cuenta As String
|
||||
@@ -20,7 +20,7 @@ Sub Class_Globals
|
||||
Dim sDate2,sTime2 As String
|
||||
Dim no_cliente As String
|
||||
Dim no_ruta As String
|
||||
|
||||
|
||||
Dim r_4 As RadioButton
|
||||
Dim E_NOMBRE As EditText
|
||||
Dim tgl As Toggle
|
||||
@@ -45,6 +45,8 @@ Sub Class_Globals
|
||||
Dim giros As String
|
||||
Private L_Atiende As Label
|
||||
Private ET_Atiende As EditText
|
||||
Dim bitacora As C_BItacora
|
||||
Dim reqManager As DBRequestManager
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -62,6 +64,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
If File.Exists(ruta, "kmt.db") = False Then
|
||||
File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db")
|
||||
End If
|
||||
reqManager.Initialize(Me, Starter.DBReqServer)
|
||||
' skmt.Initialize(ruta,"kmt.db", True)
|
||||
' p_camara.Height = Root.Height
|
||||
' p_camara.Width = Root.Width
|
||||
@@ -81,7 +84,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
Else
|
||||
ToastMessageShow("Sin permisos de escritura!!!", True)
|
||||
End If
|
||||
|
||||
|
||||
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_READ_EXTERNAL_STORAGE)
|
||||
Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)
|
||||
If Result Then
|
||||
@@ -94,6 +97,7 @@ End Sub
|
||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||
|
||||
Sub B4XPage_Appear
|
||||
bitacora.Initialize("bitacora", "bitacora", Root, Starter.skmt, reqManager)
|
||||
et_direccion.Text = ""
|
||||
E_NOMBRE.Text = ""
|
||||
ET_Atiende.Text = ""
|
||||
@@ -117,7 +121,7 @@ Sub B4XPage_Appear
|
||||
GUARDA.Visible = True 'Si hay ubicaccion, mostramos el boton de guardar.
|
||||
l_sinUbicacion.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
If Not(Starter.GPS.GPSEnabled) Then
|
||||
ToastMessageShow("Debe Activar el GPS del Equipo.", True)
|
||||
StartActivity(Starter.GPS.LocationSettingsIntent)
|
||||
@@ -125,8 +129,16 @@ Sub B4XPage_Appear
|
||||
Starter.GPS.Start(0, 0)
|
||||
' If Starter.ubicacionActual.Latitude <> 0 Then GPS_LocationChanged(Starter.ubicacionActual)
|
||||
End If
|
||||
|
||||
If Tracker.FLP.IsInitialized And Tracker.FLP.GetLastKnownLocation.IsInitialized Then
|
||||
lat = Tracker.FLP.GetLastKnownLocation.Latitude
|
||||
lon = Tracker.FLP.GetLastKnownLocation.Longitude
|
||||
l_sinUbicacion.Text = ("Latitud: " & lat & ", Longitud: "& lon)
|
||||
Log("Latitud: " & lat & " - " & "Longuitud: " & lon)
|
||||
End If
|
||||
|
||||
CallSubDelayed(Tracker, "StartFLPSmall")
|
||||
|
||||
|
||||
c = Starter.skmt.ExecQuery("SELECT GIRO FROM CAT_GIRO order by 1")
|
||||
Dim Items As List
|
||||
Items.Initialize
|
||||
@@ -144,13 +156,14 @@ End Sub
|
||||
|
||||
Sub GPS_LocationChanged (Location1 As Location)
|
||||
If B4XPages.MainPage.lat_gps <> "0.0" Then
|
||||
Log("-- LOC CHANGED")
|
||||
GUARDA.Visible = True 'Si hay ubicaccion, mostramos el boton de guardar.
|
||||
l_sinUbicacion.Visible = True
|
||||
lat = Location1.Latitude
|
||||
lon = Location1.Longitude
|
||||
l_sinUbicacion.Text = ("Latitud: " & lat & ", Longotud: "& lon)
|
||||
l_sinUbicacion.Text = ("Latitud: " & lat & ", Longitud: "& lon)
|
||||
End If
|
||||
|
||||
|
||||
b_ubicacion.TextSize = 13
|
||||
b_ubicacion.Text = $"Precisión GPS $1.0{Location1.Accuracy} m"$
|
||||
If Location1.Accuracy > 200 Then
|
||||
@@ -158,6 +171,7 @@ Sub GPS_LocationChanged (Location1 As Location)
|
||||
b_ubicacion.TextSize = 16
|
||||
b_ubicacion.Text = $"Mala señal $1.0{Location1.Accuracy} m"$
|
||||
End If
|
||||
Log("Latitud: " & lat & " - " & "Longuitud: " & lon)
|
||||
End Sub
|
||||
|
||||
Sub CANCELA_Click
|
||||
@@ -172,6 +186,7 @@ Sub GUARDA_Click
|
||||
' Verifica si la dirección tiene más de 3 caracteres
|
||||
Else If et_direccion.Text.Length > 3 Then
|
||||
' Verifica si la latitud es diferente de 0
|
||||
|
||||
If lat <> 0 Then
|
||||
' Verifica si el giro del cliente está seleccionado
|
||||
If giros <> "SELECCIONA UNA OPCIÓN" Or cb_giro.SelectedItem <> "SELECCIONA UNA OPCIÓN" Then
|
||||
@@ -210,16 +225,18 @@ Sub GUARDA_Click
|
||||
c.Close
|
||||
' Starter.skmt.ExecNonQuery2("INSERT INTO HIST_FOTO_CLIENTE(CODIGO, ALMACEN, RUTA) VALUES(?,?,?)", Array As Object(no_cliente, ALMACEN, no_ruta))
|
||||
' Starter.skmt.ExecNonQuery2("INSERT INTO NOVENTA (NV_CLIENTE,NV_FECHA,NV_USER,NV_MOTIVO,NV_LAT,NV_LON,NV_NOMBRE,NV_DIRECCION) VALUES(?,?,?,?,?,?,?,?) ", Array As Object (no_cliente,sDate & sTime, usuario, "NUEVO CLIENTE", lat, lon, E_NOMBRE.Text,et_direccion.Text))
|
||||
|
||||
|
||||
DateTime.DateFormat = "dd/MM/yyyy"
|
||||
DateTime.Timeformat = "HH:mm:ss"
|
||||
sDate2 = DateTime.Date(DateTime.Now)
|
||||
sTime2 = DateTime.Time(DateTime.Now)
|
||||
|
||||
|
||||
Starter.skmt.ExecNonQuery2("INSERT INTO CLIENTES_NUEVOS(CN_ID, CN_FECHA, CN_USER, CN_LAT, CN_LON, CN_NOMBRE, CN_DIRECCION, CN_FOTO, CN_RUTA, CN_GIRO, CN_SOLICITA) VALUES (?,?,?,?,?,?,?,?,?,?,?)", Array As String(no_cliente, sDate2 &" "&sTime2, usuario, lat, lon, E_NOMBRE.Text, et_direccion.Text, ALMACEN, no_ruta, cb_giro.SelectedItem, ET_Atiende.Text))
|
||||
' fototomada = "0"
|
||||
B4XPages.ShowPage("Cliente")
|
||||
CallSubDelayed(Tracker, "StartFLP")
|
||||
Log("-- XX")
|
||||
bitacora.mandaBitacora(Subs.fechanormal(DateTime.Now), Subs.traeUsuarioDeBD, Subs.traeAlmacen, Subs.traeRutaBitacora, "Nuevo Cliente", Subs.traeCliente, "", Subs.fechanormal(DateTime.Now), B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, 2, "", "", "")
|
||||
' CallSubDelayed(Tracker, "StartFLP")
|
||||
Else
|
||||
' Mensaje de advertencia si ET_Atiende.Text está vacío
|
||||
MsgboxAsync("Por favor, debe capturar al encargado que atiende el negocio.","Atención")
|
||||
|
||||
Reference in New Issue
Block a user