8/12/23 - Cambios a poductos para que solo paarezca el mensaje del limite abordo cuando el cliete sea CERO

This commit is contained in:
2023-12-08 11:09:06 -06:00
parent 854a9e8c43
commit 1911003145
8 changed files with 33 additions and 16 deletions

View File

@@ -293,6 +293,7 @@ Sub Class_Globals
Private r_4 As RadioButton
Private R_5 As RadioButton
Private e_comm As EditText
Private p_infoGral2 As Panel
End Sub
'You can add more parameters here.
@@ -310,11 +311,10 @@ Private Sub B4XPage_Created (Root1 As B4XView)
'load the layout to Root
Root.LoadLayout("cliente")
ruta = File.DirInternal
' Subs.panelAnchoAlto(P_INF_GENERAL, Root.Width, Root.Height)
' Subs.centraPanel(P_INF_GENERAL, Root.Width)
Panel6.Width = Root.Width
p_promowhats.Width = Root.Width
p_promowhats.visible = False
kh.centraPanel(p_infoGral2, Root.Width)
If Starter.boleta = 0 Then
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, "& _
@@ -398,7 +398,7 @@ End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Sub B4XPage_Appear
clienteId = kh.traeCliente(Starter.skmt)
clienteId = kh.traeCliente
P_DOE.Visible = False
If clienteId.StartsWith("N") Then b_noVenta.Visible = False
' Log($"TOTAL VENTA: ${kh.traeTotalCliente}"$)
@@ -417,8 +417,6 @@ Sub B4XPage_Appear
reqManager.Initialize(Me, Starter.DBReqServer)
usarGeocerca = kh.traeUsarGeocerca
' Log(Subs.traeUltimaActividadBD)
' P_INF_GENERAL.Height = Root.Height
' P_INF_GENERAL.Width = Root.Width
c = Starter.skmt.ExecQuery2("select CAT_VA_VALOR from CAT_VARIABLES WHERE CAT_VA_DESCRIPCION = ?", Array As String ("MACIMP"))
c.Position = 0
If c.RowCount > 0 Then
@@ -772,14 +770,31 @@ Sub GPS_LocationChanged (Location1 As Location)
Starter.lat_gps = "19.432568527069805"
Starter.lon_gps = "-99.13335030112772"
End If
'Revisamos si el cliente es candidato a la promo DOE
c=Starter.skmt.ExecQuery("select CAT_CL_EMAIL from kmt_info where CAT_CL_CODIGO In (Select cuenta from cuentaa)")
c.Position = 0
If c.RowCount > 0 Then
gps_boton_doe = c.GetString("CAT_CL_EMAIL")
End If
' gest.Visible = True
' gps_boton_doe ="1"
' LogColor($"Distancia actual: ${distance}"$, Colors.Blue)
'Si no estamos usando la geocerca o ya estanos dentro de la geocerca o el usuario es KMTS1 o es abordo ...
If Not(usarGeocerca) Or dentroDeGeocerca Or usuario = "KMTSKLL1" Or la_cuenta.Text = "0" Then
Private x As Cursor = Starter.skmt.ExecQuery("select count(HIST_CLIENTE) as clienteConPromo from HIST_PROMO_WHATS where HIST_CLIENTE in (Select CUENTA from cuentaa)")
If x.RowCount > 0 Then
x.Position = 0
clienteConPromo = x.GetString("clienteConPromo")
' Log($"${x.GetString("clienteConPromo")}"$)
End If
' If pgs_boton_noventa = "1" Then b_noVenta.Visible = True
' If gps_boton_doe ="1" Then b_whats.Visible = True
' Log($"${gps_boton_doe}|${clienteConPromo}"$)
If gps_boton_doe = "1" And clienteConPromo = "0" Then b_whats.Visible = True
If Not(clienteDeudor) Then B_VENTA.Visible = True 'Si el cliente no tiene adeudo, habilitamos el boton de venta
pedido_doe_muestra
@@ -1104,7 +1119,7 @@ Sub B_IMP2_Click
'printer.Initialize(cmp20.OutputStream)
Printer1.Reset
Dim bmp As Bitmap
bmp.InitializeResize(File.DirAssets, "kelloggs.png", 376, 129, True) 'ignore
bmp.InitializeResize(File.DirAssets, "kellanova_borde.png", 376, 129, True) 'ignore
Dim myimage As AnImage = Printer1.ImageToBWIMage(bmp)
myimage = Printer1.DitherImage2D(myimage, 128)
myimage= Printer1.PackImage(myimage)
@@ -1311,9 +1326,10 @@ Sub B_IMP2_Click
s.Position = 0
Private sTotal2 As Double
Log(sTotal2)
LogColor(s.GetString("TOTAL"),Colors.Magenta)
If s.GetString("TOTAL") <> Null And IsNumber(s.GETSTRING("TOTAL")) Then
sTotal2 = s.GetString("TOTAL")
sTotal2 = Subs.sumaPedido(Subs.traeCliente)
' sTotal2 = Subs.sumaPedido(Subs.traeCliente)
Printer1.WriteString( $"Sub Total : $${NumberFormat2(sTotal2, 1, 2, 2, False)}"$ & CRLF)
Else
sTotal2 = 0