mirror of
https://github.com/KeymonSoft/Durakelo.git
synced 2026-04-20 20:59:26 +00:00
12/1/24 - Cambios para la lista de precios de SuperQ
This commit is contained in:
@@ -95,7 +95,9 @@ Sub Class_Globals
|
||||
Dim list_prodsPedido As List
|
||||
' Private b_rmi As Button
|
||||
Private l_mDisponible As Label
|
||||
dim nuevaCantRMI as int
|
||||
Dim nuevaCantRMI As Int
|
||||
Private lv_precio2 As ListView
|
||||
Private cb_precio2 As B4XComboBox
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -110,7 +112,7 @@ Private Sub B4XPage_Created (Root1 As B4XView)
|
||||
' Activity.RemoveAllViews
|
||||
Root.LoadLayout("productos")
|
||||
ruta = File.DirInternal
|
||||
kh.Initialize(Me, "kh")
|
||||
kh.Initialize(Me, "kh", Starter.skmt)
|
||||
If File.Exists(ruta, "kmt.db") = False Then
|
||||
File.Copy(File.DirAssets, "kmt.db", ruta, "kmt.db")
|
||||
End If
|
||||
@@ -152,8 +154,8 @@ Sub B4XPage_Appear
|
||||
' clv_prods_ll.Initialize(Me, "clv_prods_ll")
|
||||
' list_prodsPedido.Initialize
|
||||
' Log("list_prodsPedido.Initialize")
|
||||
clienteId = kh.traeCliente(Starter.skmt)
|
||||
rutaUsuario = kh.traeRuta(Starter.skmt)
|
||||
clienteId = kh.traeCliente
|
||||
rutaUsuario = kh.traeRuta
|
||||
If p_rmi.Visible Then p_rmi.Visible = False
|
||||
' l_mDisponible.Visible = False
|
||||
' Starter.skmt.ExecNonQuery2("UPDATE CAT_GUNAPROD SET CAT_GP_TIPOPROD = (?) WHERE CAT_GP_TIPOPROD = (?) ",Array As Object("PRIORITARIO","1"))
|
||||
@@ -208,7 +210,7 @@ Sub B4XPage_Appear
|
||||
c = Starter.skmt.ExecQuery("select count(*) as hayPromos from promos_comp")
|
||||
c.Position = 0
|
||||
' Log(Subs.revisaImpresa)
|
||||
If c.GetInt("hayPromos") > 0 And clienteId <> 0 And kh.revisaImpresa(Starter.skmt) = False Then
|
||||
If c.GetInt("hayPromos") > 0 And clienteId <> 0 And kh.revisaImpresa = False Then
|
||||
lv_catalogos.AddSingleLine("PROMOS")
|
||||
End If
|
||||
Sleep(100)
|
||||
@@ -223,7 +225,7 @@ Sub B4XPage_Appear
|
||||
Dim m As Map = Subs.traeTotalesClienteActual
|
||||
prodsPedidoActual = m.Get("productos")
|
||||
montoPedidoActual = m.Get("monto")
|
||||
hayPedido = kh.hayPedido(Starter.skmt)
|
||||
hayPedido = kh.hayPedido
|
||||
' LogColor("Pedido ant? - "&hayPedido, Colors.Magenta)
|
||||
If reiniciarlistaProds Then
|
||||
' Log("Llamamos LlenaProdsLL")
|
||||
@@ -442,6 +444,8 @@ Private Sub B4XPage_CloseRequest As ResumableSub
|
||||
If p_rmi.Visible Then p_rmi.Visible = False
|
||||
If l_info.Visible Then
|
||||
l_info.Visible = False
|
||||
lv_precio2.Visible = False
|
||||
cb_precio2.mBase.Visible = False
|
||||
Return False
|
||||
else if p_vistaPreviaTrans.Visible Then
|
||||
p_vistaPreviaTrans.Visible = False
|
||||
@@ -531,6 +535,7 @@ Sub b_prodMenos_Click
|
||||
Dim pnl0 As B4XView = clv_prods_ll.GetPanel(index)
|
||||
Dim pnl As B4XView = pnl0.GetView(0)
|
||||
Dim laCant As B4XView = pnl.GetView(2).GetView(2)
|
||||
Private precio2 As String=clv_prods_ll.GetValue(index).As(Map).Get("precio")
|
||||
' Log($"precio|stock:${laCant.tag}"$)
|
||||
' Log("lacant.text="&laCant.text & "|" & buttonTag)
|
||||
If buttonTag = "vendido" And laCant.Text > 0 Then
|
||||
@@ -560,7 +565,7 @@ Sub b_prodMenos_Click
|
||||
precioX = precioX * -1
|
||||
End If
|
||||
Log(">>>>>>> Insertamos prod desde prodMenos")
|
||||
Subs.actualizaProducto(almacenX, precioX, laCant.text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
||||
Subs.actualizaProducto(almacenX, precioX, precio2, laCant.text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
||||
cuentaProds
|
||||
If Subs.totalPedido < 1 Then laCant.Text = "0"
|
||||
' Log($"Total Prods: ${totalProds}, Total Compra: $$1.2{totalCompra}"$)
|
||||
@@ -577,7 +582,9 @@ Sub b_prodMas_Click
|
||||
If laCant.Text = "" Then laCant.Text = 0
|
||||
' Private tmpMap As Map = clv_prods_ll.GetValue(index).As(Map)
|
||||
Private precio As String=clv_prods_ll.GetValue(index).As(Map).Get("precio")
|
||||
Private precio2 As String = precio
|
||||
Private inv As Int = clv_prods_ll.GetValue(index).As(Map).Get("almacen")
|
||||
Log(clv_prods_ll.GetValue(index))
|
||||
If buttonTag = "vendido" Then
|
||||
If inv > 0 And (laCant.Text + 1 <= inv) And (Subs.totalPedido - precio > 1) Then
|
||||
' Log(clv_prods_ll.GetValue(index).As(Map))
|
||||
@@ -607,7 +614,7 @@ Sub b_prodMas_Click
|
||||
precioX = precioX * -1
|
||||
End If
|
||||
Log(">>>>>>> Insertamos prod desde prodMas")
|
||||
Subs.actualizaProducto(almacenX, precioX, laCant.text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
||||
Subs.actualizaProducto(almacenX, precioX, precio2, laCant.text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
||||
cuentaProds
|
||||
If Subs.totalPedido < 1 Then
|
||||
etCantHasFocus = True
|
||||
@@ -649,6 +656,7 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
|
||||
' Log(clv_prods_ll.GetValue(index).As(Map))
|
||||
Private id As String=clv_prods_ll.GetValue(index).As(Map).Get("id")
|
||||
Private precio As String=clv_prods_ll.GetValue(index).As(Map).Get("precio")
|
||||
private precio2 as string = precio
|
||||
' Log("++++++++++ " & precio)
|
||||
Dim tempTot As String = Subs.totalPedido
|
||||
Dim disp As String = 0
|
||||
@@ -685,7 +693,7 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
|
||||
' End If
|
||||
If Not(Old = "0" And New = "") And laCant.Text <> Null And laCant.Text <> "" And etCantHasFocus Then
|
||||
Log(">>>>>> Insertamos prod desde et_pCante_TextChanged")
|
||||
Subs.actualizaProducto(almacenX, precioX, laCant.Text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
||||
Subs.actualizaProducto(almacenX, precioX, precio2, laCant.Text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
||||
cuentaProds
|
||||
End If
|
||||
Catch
|
||||
@@ -708,7 +716,7 @@ Sub cuentaProds
|
||||
' LogColor(prodsMap, Colors.Magenta)
|
||||
p_botonesVenta.Visible = True
|
||||
p_botonesVenta.BringToFront
|
||||
c.Position=0
|
||||
c.Position = 0
|
||||
' If Subs.totalPedido > 1 And lfila.Text <> "RMI" And Starter.tipov <> "ABORDO" Then b_rmi.Visible = True Else b_rmi.Visible = False
|
||||
Log(Subs.totalPedido)
|
||||
If lfila.Text = "RMI" Then l_mDisponible.Visible = True Else l_mDisponible.Visible = False
|
||||
@@ -812,6 +820,8 @@ End Sub
|
||||
|
||||
Private Sub l_info_Click
|
||||
l_info.Visible = False
|
||||
lv_precio2.Visible = False
|
||||
cb_precio2.mBase.Visible = False
|
||||
End Sub
|
||||
|
||||
Private Sub lv_promos_ItemLongClick (Position As Int, Value As Object)
|
||||
@@ -991,8 +1001,42 @@ Sub l_prodX_Click
|
||||
Log("l_prodx clicked")
|
||||
l_info.Text = Sender.as(Label).text
|
||||
Log(Sender.as(Label).tag)
|
||||
Private x() As String
|
||||
x = Regex.Split(CRLF, Sender.as(Label).text)
|
||||
Log(x(0))
|
||||
|
||||
Private id As String = kh.traeProdIdConNombre(x(0), Starter.tipov)
|
||||
|
||||
Private c As Cursor = Starter.skmt.ExecQuery($"select PRECIO, NLISTA FROM LISTA_PRECIOS WHERE NLISTA IN ('1','10') AND CAT_GP_ID = '${id}' ORDER BY NLISTA ASC"$)
|
||||
|
||||
Log(c.RowCount)
|
||||
lv_precio2.Clear
|
||||
|
||||
Dim Label1, Label2 As Label
|
||||
Label1 = lv_precio2.SingleLineLayout.Label
|
||||
Label1.TextSize = 14
|
||||
Label1.TextColor = Colors.black
|
||||
' Label2 = lv_precio2.TwoLinesLayout.SecondLabel
|
||||
' Label2.TextSize = 14
|
||||
' Label2.TextColor = Colors.DarkGray
|
||||
|
||||
If c.RowCount > 0 Then
|
||||
Private losPreciosList As List
|
||||
losPreciosList.Initialize
|
||||
' l_info.Height = 250dip
|
||||
' lv_precio2.Visible = True
|
||||
cb_precio2.mBase.Visible = True
|
||||
losPreciosList.Add("-= Seleccione Precio =-")
|
||||
For i = 0 To c.RowCount - 1
|
||||
c.Position = i
|
||||
losPreciosList.Add(c.GetString("NLISTA") & " - " & c.GetString("PRECIO"))
|
||||
lv_precio2.AddSingleLine2(c.GetString("NLISTA") & " - " & c.GetString("PRECIO"), c.GetString("PRECIO"))
|
||||
Next
|
||||
cb_precio2.SetItems(losPreciosList)
|
||||
End If
|
||||
l_info.BringToFront
|
||||
l_info.Visible = True
|
||||
cb_precio2.mbase.BringToFront
|
||||
' Dim index As Int = clv_prods_ll.GetItemFromView(Sender)
|
||||
' Private p0 As B4XView = clv_prods_ll.GetPanel(index)
|
||||
' Private p As B4XView = p0.GetView(0)
|
||||
@@ -1304,3 +1348,16 @@ Private Sub b_rmi_Click
|
||||
clv_prods_ll.AsView.Visible = True
|
||||
l_mDisponible.Visible = True
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub lv_precio2_ItemClick (Position As Int, Value As Object)
|
||||
Log(Value)
|
||||
End Sub
|
||||
|
||||
Private Sub cb_precio2_SelectedIndexChanged (Index As Int)
|
||||
Log(cb_precio2.SelectedItem.Trim)
|
||||
Log(cb_precio2.Tag)
|
||||
l_info.Visible = False
|
||||
lv_precio2.Visible = False
|
||||
cb_precio2.mBase.Visible = False
|
||||
End Sub
|
||||
Reference in New Issue
Block a user