- Se agregó código para que descargue los clientes que ya hayan contstado el cuestionario y al iniciar venta, valide si el cliente actual ya tenia o no contestado el cuestionario

This commit is contained in:
2024-02-27 03:10:12 -06:00
parent c5b0278c8d
commit f228fe7567
4 changed files with 27 additions and 13 deletions

View File

@@ -415,8 +415,11 @@ End Sub
Sub gest_Click
B4XPages.MainPage.tipo_venta = "PREVENTA"
Log($"${cuest.encuestaIniciada} - ${cuest.clienteConCuestionario(Subs.traeCliente)}"$)
If Not(cuest.encuestaIniciada) And Not(cuest.clienteConCuestionario(Subs.traeCliente)) Then
'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
@@ -931,9 +934,6 @@ Sub mandaPendientes
Next
End If
c.Close
End If
End Sub