mirror of
https://github.com/KeymonSoft/Intmex_Preventa.git
synced 2026-04-18 05:09:25 +00:00
moficiacion de venta y preventa y abordo.
This commit is contained in:
@@ -150,6 +150,8 @@ Sub Class_Globals
|
||||
Dim h As Cursor
|
||||
Dim distance As Long
|
||||
Dim cuest As C_Cuestionario
|
||||
Private b_ventaabordo As Button
|
||||
Private l_factura As Label
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -373,7 +375,16 @@ Sub B4XPage_Appear
|
||||
' End If
|
||||
' h.Close
|
||||
' j.Close
|
||||
'
|
||||
|
||||
If la_cuenta.Text = "0" Then
|
||||
p_cbFactura.Visible = False
|
||||
l_factura.Visible = False
|
||||
b_ventaabordo.Visible = False
|
||||
Else
|
||||
p_cbFactura.Visible = True
|
||||
l_factura.Visible = True
|
||||
b_ventaabordo.Visible = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub GPS_LocationChanged (Location1 As Location)
|
||||
@@ -414,18 +425,25 @@ Sub ListView1_ItemLongClick (Position As Int, Value As Object)
|
||||
End Sub
|
||||
|
||||
Sub gest_Click
|
||||
If la_cuenta.Text = "0" Then
|
||||
B4XPages.MainPage.tipo_venta = "ABORDO"
|
||||
Else
|
||||
|
||||
B4XPages.MainPage.tipo_venta = "PREVENTA"
|
||||
End If
|
||||
|
||||
'Buscamos en el historial de cuestionarios si el cliente ya tiene cuestionario contestado.
|
||||
Private hc As Cursor = Starter.skmt.ExecQuery($"select count(HC_CLIENTE) as cuantos from HIST_CUESTIONARIO where HC_CLIENTE = '${Subs.traeCliente}'"$)
|
||||
hc.Position = 0
|
||||
Log($"${cuest.encuestaIniciada} - ${hc.GetString("cuantos")} - ${cuest.clienteConCuestionario(Subs.traeCliente)}"$)
|
||||
If Not(cuest.encuestaIniciada) And hc.GetString("cuantos") = 0 And Not(cuest.clienteConCuestionario(Subs.traeCliente)) Then
|
||||
|
||||
If la_cuenta.Text <> "0" And Not(cuest.encuestaIniciada) And hc.GetString("cuantos") = 0 And Not(cuest.clienteConCuestionario(Subs.traeCliente)) Then
|
||||
cuest.agregaPregunta("1", "¿Se puede acceder al negocio o está enrejado?", Array As String("No, está enrejado o no se tiene acceso", "Si se pude acceder"))
|
||||
Return False
|
||||
End If
|
||||
Private x As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select tienda_id from COORDENADAS_GPS where tienda_id = '${la_cuenta.text}'"$)
|
||||
' Log("+++++++++++++ " & x.RowCount)
|
||||
If distance > 50 And x.RowCount = 0 Then
|
||||
If la_cuenta.Text<> "0" And distance > 50 And x.RowCount = 0 Then
|
||||
Private res As String = Msgbox2("¿Estas en la tienda, para guardar la nueva ubicación?", "AVISO", "Si","" ,"No", Null) 'ignore
|
||||
If res = DialogResponse.POSITIVE Then
|
||||
DateTime.DateFormat = "MM/dd/yyyy"
|
||||
@@ -454,6 +472,7 @@ Private Sub B4XPage_CloseRequest As ResumableSub
|
||||
' BACK key pressed
|
||||
' Return True To close, False To cancel
|
||||
' Log($"venimosDeTicketsDia=${venimosDeTicketsDia}"$)
|
||||
If la_cuenta.Text <> "0" Then
|
||||
cuest.encuestaIniciada = False
|
||||
cuest.ocultPanelPregunta
|
||||
If IsNumber(l_total.text) And Not(Subs.pedidoGuardado) Then
|
||||
@@ -473,6 +492,8 @@ Private Sub B4XPage_CloseRequest As ResumableSub
|
||||
End If
|
||||
' venimosDeTicketsDia = False
|
||||
B4XPages.ShowPage("Clientes")
|
||||
Else
|
||||
End If
|
||||
' Return True
|
||||
Return False
|
||||
End Sub
|
||||
@@ -540,8 +561,8 @@ Sub Guardar_Click
|
||||
Subs.actualizaTET(la_cuenta.text)
|
||||
DateTime.TimeFormat = "HH:mm:ss"
|
||||
|
||||
mandaPendientes 'LO COMENTAMOS PARA PRUEBAS, ACTIVAR AL FINAL!!!
|
||||
mandapiezas
|
||||
' mandaPendientes 'LO COMENTAMOS PARA PRUEBAS, ACTIVAR AL FINAL!!!
|
||||
' mandapiezas
|
||||
B4XPages.MainPage.productos.reiniciarlistaProds = True
|
||||
B4XPages.MainPage.productos.prodsMap.Initialize
|
||||
B4XPages.MainPage.promos.promosMap.Initialize
|
||||
@@ -1266,3 +1287,43 @@ Sub cuest_preguntaContestada(m As Map)
|
||||
' Case 6
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub b_ventaabordo_Click
|
||||
B4XPages.MainPage.tipo_venta = "VENTA"
|
||||
' If B4XPages.MainPage.productos.clv_prods_ll.Size = 0 Then
|
||||
' B4XPages.MainPage.productos.LlenaProdsLL(Null)
|
||||
' Else
|
||||
'
|
||||
' B4XPages.MainPage.productos.clv_prods_ll.Clear
|
||||
' End If
|
||||
'Buscamos en el historial de cuestionarios si el cliente ya tiene cuestionario contestado.
|
||||
Private hc As Cursor = Starter.skmt.ExecQuery($"select count(HC_CLIENTE) as cuantos from HIST_CUESTIONARIO where HC_CLIENTE = '${Subs.traeCliente}'"$)
|
||||
hc.Position = 0
|
||||
Log($"${cuest.encuestaIniciada} - ${hc.GetString("cuantos")} - ${cuest.clienteConCuestionario(Subs.traeCliente)}"$)
|
||||
If Not(cuest.encuestaIniciada) And hc.GetString("cuantos") = 0 And Not(cuest.clienteConCuestionario(Subs.traeCliente)) Then
|
||||
cuest.agregaPregunta("1", "¿Se puede acceder al negocio o está enrejado?", Array As String("No, está enrejado o no se tiene acceso", "Si se pude acceder"))
|
||||
Return False
|
||||
End If
|
||||
Private x As Cursor = B4XPages.MainPage.skmt.ExecQuery($"select tienda_id from COORDENADAS_GPS where tienda_id = '${la_cuenta.text}'"$)
|
||||
' Log("+++++++++++++ " & x.RowCount)
|
||||
If distance > 50 And x.RowCount = 0 Then
|
||||
Private res As String = Msgbox2("¿Estas en la tienda, para guardar la nueva ubicación?", "AVISO", "Si","" ,"No", Null) 'ignore
|
||||
If res = DialogResponse.POSITIVE Then
|
||||
DateTime.DateFormat = "MM/dd/yyyy"
|
||||
sDate=DateTime.Date(DateTime.Now)
|
||||
sTime=DateTime.Time(DateTime.Now)
|
||||
B4XPages.MainPage.skmt.ExecNonQuery($"insert into COORDENADAS_GPS (tienda_id, ruta, almacen, latitud, longitud, fecha) values ('${la_cuenta.Text}', '${Subs.traeRuta}', '${Subs.traeAlmacen}', '${B4XPages.MainPage.lat_gps}', '${B4XPages.MainPage.lon_gps}', '${sDate} ${sTime}')"$)
|
||||
|
||||
Dim cmd As DBCommand
|
||||
cmd.Initialize
|
||||
cmd.Name = "insert_coords_nuevas_INTMEX"
|
||||
cmd.Parameters = Array As Object(la_cuenta.text, Subs.traeRuta, Subs.traeAlmacen, sDate & " " & sTime, B4XPages.MainPage.lat_gps, B4XPages.MainPage.lon_gps, usuario)
|
||||
' Log($"${la_cuenta.text}, ${Subs.traeRuta}, ${Subs.traeAlmacen}, ${sDate} ${sTime}, ${m_lat}, ${m_lon}"$)
|
||||
reqManager.ExecuteCommand(cmd , "ins_coords_nuevas")
|
||||
End If
|
||||
End If
|
||||
'Si hay mapa de productos es que hay venta en proceso, entonces borramos la actual para meter la nueva.
|
||||
' If B4XPages.MainPage.productos.prodsMap.IsInitialized And B4XPages.MainPage.productos.prodsMap.Size > 0 Then Subs.borraPedidoClienteActual
|
||||
B4XPages.ShowPage("productos")
|
||||
End Sub
|
||||
Reference in New Issue
Block a user