mirror of
https://github.com/KeymonSoft/Medicomed_Preventa.git
synced 2026-04-17 21:16:08 +00:00
Version 4.09.22
Se agrego la Bitacora que tiene Kelloggs
This commit is contained in:
@@ -141,6 +141,14 @@ Sub Class_Globals
|
||||
Private Label20 As Label
|
||||
Private l_calle1 As Label
|
||||
Private l_ubicacion2 As Label
|
||||
|
||||
Dim dentroDeGeocerca As Boolean = False
|
||||
Dim b_inicioFinVenta As Button
|
||||
Dim precision As Int = 0
|
||||
Dim motivoNoVenta, motivoNoVisita As String
|
||||
Dim usuario As String = ""
|
||||
Dim Id_Almacen As String
|
||||
Dim ruta_tienda As String
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -192,10 +200,11 @@ End Sub
|
||||
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
|
||||
|
||||
Sub B4XPage_Appear
|
||||
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_CAMERA)
|
||||
Wait For B4XPage_PermissionResult (Permission As String, resultC As Boolean)
|
||||
Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
|
||||
Wait For B4XPage_PermissionResult (Permission As String, resultC As Boolean)
|
||||
' Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_CAMERA)
|
||||
' Wait For B4XPage_PermissionResult (Permission As String, resultC As Boolean)
|
||||
' Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
|
||||
' Wait For B4XPage_PermissionResult (Permission As String, resultC As Boolean)
|
||||
b_inicioFinVenta.Width = Root.Width
|
||||
LA_GPS.TextColor = Colors.Red
|
||||
LA_GPS.Text = "SIN UBICACION GPS"
|
||||
cercavalor = 0
|
||||
@@ -328,6 +337,19 @@ Sub B4XPage_Appear
|
||||
gest.Visible = True
|
||||
'Si el cliente es nuevo, no aparece el boton de venta
|
||||
If la_cuenta.text.SubString2(0,1) = "N" Then gest.Visible = False
|
||||
|
||||
b_inicioFinVenta.Text = "INICIAR VENTA"
|
||||
b_inicioFinVenta.BringToFront
|
||||
' LogColor(">>>>>> EN VENTA: " & B4XPages.MainPage.enVenta, Colors.red)
|
||||
If Not(Starter.enVenta) And la_cuenta.Text <> "0" Then
|
||||
b_inicioFinVenta.Visible = True
|
||||
' Log("EnVenta Visible")
|
||||
Else
|
||||
' Log("EnVenta NO Visible")
|
||||
b_inicioFinVenta.Visible = False
|
||||
End If
|
||||
' LogColor(">>>>>> EN VENTA: " & Starter.enVenta, Colors.red)
|
||||
|
||||
End Sub
|
||||
|
||||
Sub GPS_LocationChanged (Location1 As Location)
|
||||
@@ -428,7 +450,13 @@ Sub DATOS_Click
|
||||
B4XPages.ShowPage("telefonos")
|
||||
End Sub
|
||||
|
||||
Sub Guardar_Click
|
||||
Sub Guardar_Click
|
||||
b_inicioFinVenta.Text = "FIN VENTA"
|
||||
b_inicioFinVenta.Visible = True
|
||||
End Sub
|
||||
|
||||
Sub Guardar2_Click
|
||||
' Log("GuardarVentaOriginal")
|
||||
DateTime.DateFormat = "MM/dd/yyyy"
|
||||
sDate=DateTime.Date(DateTime.Now)
|
||||
sTime=DateTime.Time(DateTime.Now)
|
||||
@@ -484,6 +512,21 @@ Sub Guardar_Click
|
||||
B4XPages.MainPage.productos.prodsMap.Initialize
|
||||
B4XPages.MainPage.promos.promosMap.Initialize
|
||||
B4XPages.ShowPage("Principal")
|
||||
|
||||
Guardar.SendToBack
|
||||
b_inicioFinVenta.Text = "TERMINAR VENTA"
|
||||
' Log("RESPALDO")
|
||||
If la_cuenta.Text <> "0" Then 'Si es ABORDO, no mostramos el boton b_inicioFinVenta y regresamos a Principal.
|
||||
b_inicioFinVenta.Visible = True
|
||||
Else
|
||||
' b_inicioFinVenta.Visible = False
|
||||
Starter.enVenta = False
|
||||
LogColor(">>>>>> ABORDO: " & Starter.enVenta, Colors.red)
|
||||
Subs.bitacora(Subs.fechanormal(DateTime.Now), usuario, Id_Almacen, ruta_tienda, "Venta Abordo", "0", Subs.fechanormal(DateTime.Now), Subs.fechanormal(DateTime.Now), B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, precision, "", "")
|
||||
Subs.iniciaActividad("principal")
|
||||
B4XPages.ShowPageAndRemovePreviousPages("Principal")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Sub NUEVO_Click
|
||||
@@ -769,15 +812,15 @@ End Sub
|
||||
Sub mandaPendientes
|
||||
'PEDIDO_CLIENTE (Pendientes)
|
||||
c=B4XPages.MainPage.skmt.ExecQuery("SELECT PC_CLIENTE, PC_FECHA, PC_USER, PC_NOART, PC_MONTO,PC_LON, PC_LAT, PC_COSTO_SIN, PC_RUTA, PC_ALMACEN, PC_FACTURA FROM PEDIDO_CLIENTE where pc_envio_ok <> 1")
|
||||
Log($"Pedido_Cliente PENDIENTE: ${c.RowCount}"$)
|
||||
' Log($"Pedido_Cliente PENDIENTE: ${c.RowCount}"$)
|
||||
If c.RowCount>0 Then
|
||||
For i=0 To c.RowCount -1
|
||||
c.Position=i
|
||||
Dim cmd As DBCommand
|
||||
cmd.Initialize
|
||||
cmd.Name = "DELETE_PEDIDO_MARDS_PC"
|
||||
cmd.Parameters = Array As Object(ALMACEN, B4XPages.MainPage.principal.l_ruta.text,c.GetString("PC_CLIENTE") )
|
||||
B4XPages.MainPage.reqManager.ExecuteCommand(cmd , "DEL_PC")
|
||||
' cmd.Initialize
|
||||
' cmd.Name = "DELETE_PEDIDO_MARDS_PC"
|
||||
' cmd.Parameters = Array As Object(ALMACEN, B4XPages.MainPage.principal.l_ruta.text,c.GetString("PC_CLIENTE") )
|
||||
' B4XPages.MainPage.reqManager.ExecuteCommand(cmd , "DEL_PC")
|
||||
|
||||
Dim cmd As DBCommand
|
||||
cmd.Initialize
|
||||
@@ -789,16 +832,16 @@ Sub mandaPendientes
|
||||
|
||||
'PEDIDO (Pendientes)
|
||||
c=B4XPages.MainPage.skmt.ExecQuery("SELECT PC_ENVIO_OK, PE_CEDIS, PE_COSTO_TOT, PE_COSTOU, PE_CANT, PE_PRONOMBRE, PE_PROID, PE_CLIENTE, PE_FECHA, PE_USUARIO, PE_COSTO_SIN, PE_RUTA, PE_DESC, PE_FOLIO FROM pedido_cliente left join PEDIDO where pc_cliente = pe_cliente and pc_envio_ok <> 1")
|
||||
Log($"Pedido PENDIENTE: ${c.RowCount}"$)
|
||||
' Log($"Pedido PENDIENTE: ${c.RowCount}"$)
|
||||
If c.RowCount>0 Then
|
||||
For i=0 To c.RowCount -1
|
||||
c.Position=i
|
||||
Dim cmd As DBCommand
|
||||
|
||||
cmd.Initialize
|
||||
cmd.Name = "DELETE_PEDIDO_MARDS_PE"
|
||||
cmd.Parameters = Array As Object(ALMACEN, B4XPages.MainPage.principal.l_ruta.text,c.GetString("PE_CLIENTE") )
|
||||
B4XPages.MainPage.reqManager.ExecuteCommand(cmd , "DEL_PE")
|
||||
' cmd.Initialize
|
||||
' cmd.Name = "DELETE_PEDIDO_MARDS_PE"
|
||||
' cmd.Parameters = Array As Object(ALMACEN, B4XPages.MainPage.principal.l_ruta.text,c.GetString("PE_CLIENTE") )
|
||||
' B4XPages.MainPage.reqManager.ExecuteCommand(cmd , "DEL_PE")
|
||||
|
||||
cmd.Initialize
|
||||
cmd.Name = "insert_pedido_MEDI"
|
||||
@@ -809,7 +852,7 @@ Sub mandaPendientes
|
||||
|
||||
'ABONOS
|
||||
Dim ab As Cursor = B4XPages.MainPage.skmt.ExecQuery($"SELECT * from ABONOS where a_enviado is null"$)
|
||||
Log(ab.RowCount)
|
||||
' Log(ab.RowCount)
|
||||
If ab.RowCount > 0 Then
|
||||
For i=0 To ab.RowCount -1
|
||||
ab.Position = i
|
||||
@@ -889,6 +932,12 @@ Sub JobDone(Job As HttpJob)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
If Job.JobName = "DBRequest" Then
|
||||
Dim resultado As DBResult = reqManager.HandleJob(Job)
|
||||
If resultado.Tag= "mandaBitacora" Then
|
||||
Log("mandaBitacora")
|
||||
End If
|
||||
End If
|
||||
Job.Release
|
||||
End If
|
||||
|
||||
@@ -920,4 +969,39 @@ End Sub
|
||||
|
||||
Private Sub b_abono1_Click
|
||||
p_abono.Visible = True
|
||||
End Sub
|
||||
|
||||
Private Sub b_inicioFinVenta_Click
|
||||
usuario = Subs.traeUsuarioDeBD
|
||||
Id_Almacen = Subs.traeAlmacen
|
||||
|
||||
c = B4XPages.MainPage.skmt.ExecQuery("select CAT_CL_RUTA from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
||||
c.Position = 0
|
||||
ruta_tienda = c.GetString("CAT_CL_RUTA")
|
||||
|
||||
If dentroDeGeocerca Then precision = 1
|
||||
motivoNoVenta = ""
|
||||
motivoNoVisita = ""
|
||||
|
||||
If Starter.enVenta Then
|
||||
b_inicioFinVenta.Visible = True
|
||||
Subs.bitacora(Subs.fechanormal(DateTime.Now), usuario, Id_Almacen, ruta_tienda, "Termina Venta", Subs.traeCliente, "", Subs.fechanormal(DateTime.Now), B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, precision, motivoNoVenta, motivoNoVisita)
|
||||
Starter.enVenta = False
|
||||
LogColor($">>>>>> TERMINA VENTA: ${Starter.enVenta} - ${Subs.traeCliente}"$, Colors.red)
|
||||
Subs.iniciaActividad("principal")
|
||||
B4XPages.ShowPageAndRemovePreviousPages("Principal")
|
||||
Guardar2_Click
|
||||
|
||||
Else
|
||||
|
||||
b_inicioFinVenta.Width = Root.Width
|
||||
Subs.bitacora(Subs.fechanormal(DateTime.Now), usuario, Id_Almacen, ruta_tienda, "Inicia Venta", Subs.traeCliente, Subs.fechanormal(DateTime.Now), "", B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, precision, motivoNoVenta, "")
|
||||
Starter.enVenta = True
|
||||
LogColor($">>>>>> INICIA VENTA: ${Starter.enVenta} - ${Subs.traeCliente}"$, Colors.red)
|
||||
b_inicioFinVenta.Visible = False
|
||||
End If
|
||||
|
||||
|
||||
c.Close
|
||||
|
||||
End Sub
|
||||
Reference in New Issue
Block a user