mirror of
https://github.com/KeymonSoft/Durakelo.git
synced 2026-04-17 19:36:12 +00:00
Codigo de Cuestionario
This commit is contained in:
@@ -150,6 +150,7 @@ Sub Class_Globals
|
||||
Dim pregunta7 As String
|
||||
Dim bandera As Int
|
||||
Dim errorImpresora As Int = 0
|
||||
Dim cuest As C_Cuestionario
|
||||
End Sub
|
||||
|
||||
Sub initialize
|
||||
@@ -162,6 +163,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
Root = Root1
|
||||
Root.RemoveAllViews
|
||||
Root.LoadLayout("Cliente")
|
||||
cuest.Initialize(Me, "cuest", Root, Starter.skmt)
|
||||
c= Starter.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_BFACTURA,CAT_CL_BCREDITO from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
|
||||
s = Starter.skmt.ExecQuery("select sum(pe_costo_tot) as TOTAL_CLIE, SUM(PE_CANT) AS CANT_CLIE FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")
|
||||
If c.RowCount > 0 Then
|
||||
@@ -385,6 +387,11 @@ Sub ListView1_ItemLongClick (Position As Int, Value As Object)
|
||||
End Sub
|
||||
|
||||
Sub gest_Click
|
||||
Log($"${cuest.encuestaIniciada} - ${cuest.clienteConCuestionario(Subs.traeCliente)}"$)
|
||||
If Not(cuest.encuestaIniciada) 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
|
||||
' If la_cuenta.Text <> "0" Then
|
||||
' Dim queenc As String
|
||||
' ' 1=1 ----> si no esta en el historico que se descargue del web ver si esta contestada de manera local
|
||||
@@ -463,6 +470,8 @@ Sub Tels_Click
|
||||
End Sub
|
||||
|
||||
Private Sub B4XPage_CloseRequest As ResumableSub
|
||||
cuest.encuestaIniciada = False
|
||||
cuest.ocultPanelPregunta
|
||||
If sv_encuesta.Visible = True Then
|
||||
Return False
|
||||
Else If Subs.hayPedido Then
|
||||
@@ -1184,6 +1193,11 @@ Sub B_INV_Click
|
||||
End Sub
|
||||
|
||||
Sub B_VENTA_Click
|
||||
Log($"${cuest.encuestaIniciada} - ${cuest.clienteConCuestionario(Subs.traeCliente)}"$)
|
||||
If Not(cuest.encuestaIniciada) 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
|
||||
' If la_cuenta.Text <> "0" Then
|
||||
' Dim queenc As String
|
||||
' ' 1=1 ----> si no esta en el historico que se descargue del web ver si esta contestada de manera local
|
||||
@@ -1698,4 +1712,70 @@ End Sub
|
||||
|
||||
Private Sub rb_p7no_CheckedChange(Checked As Boolean)
|
||||
pregunta7 = "No"
|
||||
End Sub
|
||||
End Sub
|
||||
|
||||
|
||||
Sub cuest_preguntaContestada(m As Map)
|
||||
' Recibimos el id de la pregunta, el id de la respuesta, el texto de la respuesta y el objeto del panelSombra para poder ocultarlo.
|
||||
Log(m)
|
||||
' If q.IsInitialized Then Log($"${q.encuestaIniciada}|${q.preguntaActual}"$)
|
||||
' m.Get("panel").As(Panel).Visible = False 'Ocultamos el panel de la pregunta.
|
||||
m.Get("panel").As(Panel).RemoveView 'Quitamos le panel de la pregunta
|
||||
DateTime.DateFormat = "yyyyMMdd"
|
||||
Starter.skmt.ExecNonQuery($"delete from CUESTIONARIO where Q_IDCLIENTE = '${Subs.traeCliente}' and Q_IDPREGUNTA = '${m.Get("idPregunta")}'"$)
|
||||
Starter.skmt.ExecNonQuery($"insert into CUESTIONARIO (Q_IDCLIENTE, Q_IDPREGUNTA, Q_PREGUNTA, Q_IDRESPUESTA, Q_RESPUESTA, Q_FECHA) values ('${Subs.traeCliente}', '${m.Get("idPregunta")}', '${m.Get("pregunta")}', '${m.Get("idRespuesta")}', '${m.Get("respuesta")}', '${DateTime.Date(DateTime.now)}')"$)
|
||||
Select Case m.Get("idPregunta")
|
||||
Case "1"
|
||||
If m.Get("respuesta") = "No, está enrejado o no se tiene acceso" Then
|
||||
Log("Tiendajon / Ventana / Kiosko")
|
||||
ToastMessageShow("Tiendajon / Ventana / Kiosko", False)
|
||||
cuest.agregaPregunta("6", "¿Cuenta con caja de salida para cobro con sistema de computo?", Array As String("Si, tiene sistema de computo para cobro", "No"))
|
||||
Else if m.Get("respuesta") = "Si se pude acceder" Then
|
||||
cuest.agregaPregunta("2", "¿Tiene al menos 2 pasillos con acceso directo a la mercancía?", Array As String("Si tiene al menos 2 pasillos con acceso directo a la mercancía", "No tiene pasillos o solo uno central"))
|
||||
End If
|
||||
Case "2"
|
||||
If m.Get("respuesta") = "Si tiene al menos 2 pasillos con acceso directo a la mercancía" Then
|
||||
Log("Mini-Super")
|
||||
ToastMessageShow("Mini-Super", False)
|
||||
cuest.agregaPregunta("6", "¿Cuenta con caja de salida para cobro con sistema de computo?", Array As String("Si, tiene sistema de computo para cobro", "No"))
|
||||
else If m.Get("respuesta") = "No tiene pasillos o solo uno central" Then
|
||||
cuest.agregaPregunta("3", "¿Cuenta con enfriador horizontal para venta de perecederos como queso, jamon, crema, etc.?", Array As String("Si", "No tiene enfriador horizontal."))
|
||||
End If
|
||||
Case "3"
|
||||
Log("|"&m.Get("respuesta")&"|")
|
||||
If m.Get("respuesta") = "Si" Then
|
||||
Log("Miscelanea")
|
||||
ToastMessageShow("Miscelanea", False)
|
||||
cuest.agregaPregunta("6", "¿Cuenta con caja de salida para cobro con sistema de computo?", Array As String("Si, tiene sistema de computo para cobro", "No"))
|
||||
else If m.Get("respuesta") = "No tiene enfriador horizontal." Then
|
||||
cuest.agregaPregunta("4", "¿El local esta enfocado a venta especializada?", Array As String("No", "Si"))
|
||||
End If
|
||||
Case "4"
|
||||
If m.Get("respuesta") = "No" Then
|
||||
Log("Abarrotera")
|
||||
ToastMessageShow("Abarrotera", False)
|
||||
cuest.agregaPregunta("6", "¿Cuenta con caja de salida para cobro con sistema de computo?", Array As String("Si, tiene sistema de computo para cobro", "No"))
|
||||
else If m.Get("respuesta") = "Si" Then
|
||||
cuest.agregaPregunta("5", "¿Cual venta especializada?", Array As String("Carnicería / Pollería", "Cremería", "Depósito / Vinateria", "Dulcería", "Farmacia", "Fonda / Restaurante / Cafetería", "Verdulería"))
|
||||
End If
|
||||
Case "5"
|
||||
Log(m.Get("respuesta"))
|
||||
ToastMessageShow(m.Get("respuesta"), False)
|
||||
' If m.Get("respuesta") = "No" Then
|
||||
' Log("Abarrotera")
|
||||
' q.agregaPregunta("5", "¿Cuenta con caja de salida para cobro con sistema de computo?", Array As String("Si, tiene sistema de computo para cobro", "No"))
|
||||
' else If m.Get("respuesta") = "Si" Then
|
||||
cuest.agregaPregunta("6", "¿Cuenta con caja de salida para cobro con sistema de computo?", Array As String("Si, tiene sistema de computo para cobro", "No"))
|
||||
' End If
|
||||
Case "6"
|
||||
Log(m.Get("respuesta"))
|
||||
ToastMessageShow(m.Get("respuesta"), False)
|
||||
Log(">>>>>>>>>> " & cuest.encuestaIniciada)
|
||||
cuest.encuestaIniciada = False
|
||||
Log(">>>>>>>>>> " & cuest.encuestaIniciada)
|
||||
' refrescarCliente = True
|
||||
' Log($"#### REFRESCAR CLIENTE -> ${refrescarCliente}"$)
|
||||
B4XPage_Appear
|
||||
' Case 6
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user