mirror of
https://github.com/KeymonSoft/ADM.git
synced 2026-04-17 19:36:18 +00:00
- VERSION 5.08.22
- Cambios para que desde clienets y mapa aparezcan losbotones de inicio y fin venta
This commit is contained in:
@@ -39,6 +39,25 @@ Sub Class_Globals
|
||||
Private l_baseodia As Label
|
||||
|
||||
Private CREDITO As Label
|
||||
Private p_transparenciaIniciaInicioFinVenta As Panel
|
||||
Private p_inicioFinVenta As Panel
|
||||
Private b_inicioVenta As Button
|
||||
Private b_finVenta As Button
|
||||
Private p_guardarPeso As Panel
|
||||
Private et_guardarPeso As EditText
|
||||
Private p_botonesGuardarPeso As Panel
|
||||
Private b_noVenta As Button
|
||||
Private b_guardarPeso As Button
|
||||
Private p_noVenta As Panel
|
||||
Private b_cancelaNoVenta As Button
|
||||
Private b_guardaNoVenta As Button
|
||||
Private p_botonesNoVenta As Panel
|
||||
Private et_comentarioNoVenta As EditText
|
||||
Private r_opcion4 As RadioButton
|
||||
Private r_opcion3 As RadioButton
|
||||
Private r_opcion2 As RadioButton
|
||||
Private r_opcion1 As RadioButton
|
||||
Dim motivo As String
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -59,6 +78,12 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
' Else
|
||||
ruta = File.DirInternal
|
||||
' End If
|
||||
|
||||
p_transparenciaIniciaInicioFinVenta.top = 0 : p_transparenciaIniciaInicioFinVenta.Left = 0
|
||||
p_transparenciaIniciaInicioFinVenta.Height = Root.Height : p_transparenciaIniciaInicioFinVenta.Width = Root.Width
|
||||
Subs.centraPanel(p_inicioFinVenta, Root.Width)
|
||||
p_guardarPeso.Top = p_inicioFinVenta.top : p_guardarPeso.left = p_inicioFinVenta.left
|
||||
Subs.centraPanel(p_noVenta, Root.Width)
|
||||
|
||||
' se crea o no el archivo de la base de ddatos de kmt
|
||||
'NOTAS SI SE MODIFICA LA ESTRUCTURA SE QUITA EL IF Y SE VA DIRECTO A LA SENTENCIA FILE.COPY PARA QUE
|
||||
@@ -76,7 +101,7 @@ Sub B4XPage_Appear
|
||||
busca.Text = ""
|
||||
entro ="2"
|
||||
colonia = 0
|
||||
c=B4XPages.MainPage.skmt.ExecQuery($"select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info where gestion = 0 AND CAT_CL_CODIGO <> ${"0"} AND CAT_CL_CODIGO <> ${"1"} ORDER BY CAST(CAT_CL_NUM_SERIEFISICO AS INTEGER) ASC"$)
|
||||
c = B4XPages.MainPage.skmt.ExecQuery($"select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info where gestion = 0 AND CAT_CL_CODIGO <> ${"0"} AND CAT_CL_CODIGO <> ${"1"} ORDER BY CAST(CAT_CL_NUM_SERIEFISICO AS INTEGER) ASC"$)
|
||||
ListView1.Clear
|
||||
lfila.Text = "NOMBRE"
|
||||
|
||||
@@ -90,8 +115,7 @@ Sub B4XPage_Appear
|
||||
Else
|
||||
cxc.Visible = True
|
||||
End If
|
||||
|
||||
|
||||
|
||||
d = B4XPages.MainPage.skmt.ExecQuery($"select IFNULL(CAT_CL_BCREDITO,0) AS CAT_CL_BCREDITO FROM kmt_info WHERE CAT_CL_CODIGO = '${c.GetString("CAT_CL_CODIGO")}'"$)
|
||||
' LogColor(d.RowCount,Colors.Blue)
|
||||
If d.RowCount > 0 Then
|
||||
@@ -122,19 +146,36 @@ Sub B4XPage_Appear
|
||||
End If
|
||||
c.Close
|
||||
entro = "4"
|
||||
|
||||
If Subs.nosQuedamosEnVenta Then
|
||||
Dim enVentaUsuario As String = ""
|
||||
Dim enVentaPagina As String = ""
|
||||
Private ev As Cursor = Starter.skmt.ExecQuery("select * from cat_variables where cat_va_descripcion = 'EN_VENTA_USUARIO' or cat_va_descripcion = 'EN_VENTA_PAGINA'")
|
||||
If ev.RowCount > 0 Then
|
||||
For i = 0 To ev.RowCount - 1
|
||||
ev.Position = i
|
||||
If ev.GetString("CAT_VA_DESCRIPCION") = "EN_VENTA_USUARIO" Then
|
||||
enVentaUsuario = ev.GetString("CAT_VA_VALOR")
|
||||
Else If ev.GetString("CAT_VA_DESCRIPCION") = "EN_VENTA_PAGINA" Then
|
||||
enVentaPagina = ev.GetString("CAT_VA_VALOR")
|
||||
End If
|
||||
Next
|
||||
ventaIniciada
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub CreateListItem(mostrar As String, mostrar1 As String, mostrar2 As String) As Panel
|
||||
Sub CreateListItem(nombre As String, direccion0 As String, cliente As String) As Panel
|
||||
Dim p As B4XView = xui.CreatePanel("")
|
||||
p.SetLayoutAnimated(0, 0, 0, 1, 220)
|
||||
p.LoadLayout("datoscliente")
|
||||
p.Height= 60dip
|
||||
' p.LoadLayout("datoscliente")
|
||||
p.LoadLayout("datosclienteBotones")
|
||||
p.Height= 100dip
|
||||
b_inicioVenta.Tag = cliente
|
||||
' p.Width = clv_orden.GetBase.Width
|
||||
nombrecliente.Text = mostrar
|
||||
direccion.Text = mostrar1
|
||||
numerocliente.Text = mostrar2
|
||||
p_datosclie.Tag = mostrar2
|
||||
nombrecliente.Text = nombre
|
||||
direccion.Text = direccion0
|
||||
numerocliente.Text = cliente
|
||||
p_datosclie.Tag = cliente
|
||||
' cxc.Text = mostrar3
|
||||
' Log(p.Width)
|
||||
Return p
|
||||
@@ -196,6 +237,10 @@ Private Sub B4XPage_CloseRequest As ResumableSub
|
||||
' StartActivity(seleccion)
|
||||
' Return False
|
||||
' End If
|
||||
If p_transparenciaIniciaInicioFinVenta.Visible Then
|
||||
ToastMessageShow($"Es necesario ingresar "Peso" o "No Venta" para poder continuar"$, True)
|
||||
Return False
|
||||
End If
|
||||
Return True
|
||||
End Sub
|
||||
|
||||
@@ -271,7 +316,7 @@ Sub BUSCA_TextChanged (Old As String, New As String)
|
||||
' LogColor(d.RowCount,Colors.Blue)
|
||||
If d.RowCount > 0 Then
|
||||
d.Position = 0
|
||||
LogColor(d.GetString("CAT_CL_BCREDITO"),Colors.Blue)
|
||||
' LogColor(d.GetString("CAT_CL_BCREDITO"),Colors.Blue)
|
||||
If d.GetString("CAT_CL_BCREDITO") = "1" Then
|
||||
CREDITO.Visible = True
|
||||
Else
|
||||
@@ -405,14 +450,14 @@ Private Sub p_datosclie_Click
|
||||
End Sub
|
||||
|
||||
Private Sub b_buscar_Click
|
||||
Log(CHECK)
|
||||
' Log(CHECK)
|
||||
If CHECK = 0 Then
|
||||
l_baseodia.Text = "Clientes de base de datos"
|
||||
CHECK = 1
|
||||
busca.Text = ""
|
||||
entro ="2"
|
||||
colonia = 0
|
||||
c=B4XPages.MainPage.skmt.ExecQuery($"select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info2 where gestion = 0 AND CAT_CL_CODIGO <> ${"0"} AND CAT_CL_CODIGO <> ${"1"} ORDER BY CAT_CL_CODIGO"$)
|
||||
c = B4XPages.MainPage.skmt.ExecQuery($"select CAT_CL_NOMBRE, CAT_CL_CALLE, CAT_CL_CODIGO from kmt_info2 where gestion = 0 AND CAT_CL_CODIGO <> ${"0"} AND CAT_CL_CODIGO <> ${"1"} ORDER BY CAT_CL_CODIGO"$)
|
||||
ListView1.Clear
|
||||
lfila.Text = "NOMBRE"
|
||||
ListView1.Clear
|
||||
@@ -511,6 +556,113 @@ Private Sub b_buscar_Click
|
||||
End If
|
||||
c.Close
|
||||
entro = "4"
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub b_inicioVenta_Click
|
||||
' b_inicioVenta.Enabled = False
|
||||
Private cliente As String = Sender.As(Button).tag
|
||||
Starter.skmt.ExecNonQuery($"delete from cuentaa"$)
|
||||
Starter.skmt.ExecNonQuery($"insert into cuentaa (cuenta) values ('${cliente}')"$)
|
||||
Log($"insert into cuentaa (cuenta) values ('${cliente}')"$)
|
||||
p_transparenciaIniciaInicioFinVenta.Visible = True
|
||||
b_finVenta.Enabled = True
|
||||
Subs.bitacora(Subs.fechanormal(DateTime.Now), Subs.traeUsuarioDeBD, Subs.traeAlmacen, Subs.traeRuta, "Inicia Venta", cliente, Subs.fechanormal(DateTime.Now), "", Starter.lat_gps, Starter.lon_gps, "2", "", "", "")
|
||||
Starter.enVenta = True
|
||||
Subs.enVenta(1, "CLIENTES")
|
||||
|
||||
LogColor($">>>>>> INICIA VENTA: ${Starter.enVenta} - ${cliente}"$, Colors.red)
|
||||
Log(Subs.traeRuta2(Subs.traeCliente))
|
||||
End Sub
|
||||
|
||||
Private Sub ventaIniciada
|
||||
' b_inicioVenta.Enabled = False
|
||||
' Private cliente As String = Sender.As(Button).tag
|
||||
' Starter.skmt.ExecNonQuery($"delete from cuentaa"$)
|
||||
' Starter.skmt.ExecNonQuery($"insert into cuentaa (cuenta) values ('${cliente}')"$)
|
||||
' Log($"insert into cuentaa (cuenta) values ('${cliente}')"$)
|
||||
p_transparenciaIniciaInicioFinVenta.Visible = True
|
||||
b_finVenta.Enabled = True
|
||||
Subs.bitacora(Subs.fechanormal(DateTime.Now), Subs.traeUsuarioDeBD, Subs.traeAlmacen, Subs.traeRuta, "Inicia Venta", Subs.traeCliente, Subs.fechanormal(DateTime.Now), "", Starter.lat_gps, Starter.lon_gps, "2", "", "", "")
|
||||
Starter.enVenta = True
|
||||
Subs.enVenta(1, "CLIENTES")
|
||||
LogColor($">>>>>> INICIA VENTA: ${Starter.enVenta} - ${Subs.traeCliente}"$, Colors.red)
|
||||
Log(Subs.traeRuta2(Subs.traeCliente))
|
||||
End Sub
|
||||
|
||||
Private Sub b_finVenta_Click
|
||||
et_guardarPeso.Text = ""
|
||||
p_guardarPeso.Visible = True
|
||||
' b_inicioVenta.Enabled = True
|
||||
' b_finVenta.Enabled = False
|
||||
End Sub
|
||||
|
||||
Private Sub p_transparenciaIniciaInicioFinVenta_Click
|
||||
Log("Fondo clicked")
|
||||
If b_finVenta.Enabled = False Then
|
||||
p_transparenciaIniciaInicioFinVenta.Visible = False
|
||||
Else
|
||||
ToastMessageShow($"Es necesario ingresar "Peso" o "No Venta" para poder continuar"$, True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub b_guardarPeso_Click
|
||||
If et_guardarPeso.Text <> "" And et_guardarPeso.Text <> "0" And IsNumber(et_guardarPeso.Text) Then
|
||||
Private peso As Double = et_guardarPeso.Text
|
||||
et_guardarPeso.Text = peso
|
||||
|
||||
Subs.guardaPeso("VENTA", Subs.traeAlmacen, Subs.traeRuta2(Subs.traeCliente), Subs.traeUsuarioDeBD, Subs.traeCliente, peso, "", "")
|
||||
Subs.bitacora(Subs.fechanormal(DateTime.Now), Subs.traeUsuarioDeBD, Subs.traeAlmacen, Subs.traeRuta2(Subs.traeCliente), "Termina Venta", Subs.traeCliente, "", Subs.fechanormal(DateTime.Now), Starter.lat_gps, Starter.lon_gps, 2, "", "", $"Venta:${et_guardarPeso.text}"$)
|
||||
Starter.skmt.ExecNonQuery("UPDATE kmt_info set gestion = 2 where CAT_CL_CODIGO In (select cuenta from cuentaa)")
|
||||
Starter.enVenta = False
|
||||
Subs.enVenta(0, "")
|
||||
p_guardarPeso.Visible = False
|
||||
p_transparenciaIniciaInicioFinVenta.Visible = False
|
||||
' b_inicioVenta.Enabled = True
|
||||
b_finVenta.Enabled = False
|
||||
B4XPages.MainPage.clientes.B4XPage_Appear
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub p_guardarPeso_Click
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub et_guardarPeso_TextChanged (Old As String, New As String)
|
||||
If Old <> New And IsNumber(New.trim) And New.trim <> "0" Then
|
||||
b_guardarPeso.Enabled = True
|
||||
Else
|
||||
b_guardarPeso.Enabled = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub b_noVenta_Click
|
||||
p_noVenta.Visible = True
|
||||
End Sub
|
||||
|
||||
Private Sub b_guardaNoVenta_Click
|
||||
If r_opcion1.Checked Then
|
||||
motivo = "CERRADO"
|
||||
Else If r_opcion2.Checked Then
|
||||
motivo = "NO COMPRA"
|
||||
Else If r_opcion3.Checked Then
|
||||
motivo = "CON PRODUCTO"
|
||||
Else
|
||||
motivo = "NO ESTA EL ENCARGADO"
|
||||
End If
|
||||
DateTime.DateFormat="yy-MM-dd HH:mm:ss"
|
||||
Dim fecha As String=DateTime.Date(DateTime.Now)
|
||||
|
||||
Subs.guardaPeso("NO VENTA", Subs.traeAlmacen, Subs.traeRuta2(Subs.traeCliente), Subs.traeUsuarioDeBD, Subs.traeCliente, "0", motivo, et_comentarioNoVenta.text)
|
||||
Subs.bitacora(Subs.fechanormal(DateTime.Now), Subs.traeUsuarioDeBD, Subs.traeAlmacen, Subs.traeRuta, "No Venta", Subs.traeCliente, "", Subs.fechanormal(DateTime.Now), Starter.lat_gps, Starter.lon_gps, 2, motivo, et_comentarioNoVenta.text, $"Venta:${et_guardarPeso.text}"$)
|
||||
Starter.enVenta = False
|
||||
Subs.enVenta(0, "")
|
||||
Starter.skmt.ExecNonQuery("UPDATE kmt_info set gestion = 3 where CAT_CL_CODIGO In (select cuenta from cuentaa)")
|
||||
p_noVenta.Visible = False
|
||||
p_guardarPeso.Visible = False
|
||||
p_transparenciaIniciaInicioFinVenta.Visible = False
|
||||
End Sub
|
||||
|
||||
Private Sub b_cancelaNoVenta_Click
|
||||
p_noVenta.Visible = False
|
||||
End Sub
|
||||
Reference in New Issue
Block a user