mirror of
https://github.com/KeymonSoft/Intmex_Preventa.git
synced 2026-04-18 05:09:25 +00:00
...
This commit is contained in:
@@ -1293,12 +1293,11 @@ End Sub
|
||||
|
||||
|
||||
Private Sub b_ventaabordo_Click
|
||||
' c=B4XPages.MainPage.skmt.ExecQuery("Select * From CAT_GUNAPROD2")
|
||||
c=B4XPages.MainPage.skmt.ExecQuery2("Select * From CAT_GUNAPROD2 where cat_gp_tipo <> ? " , Array As String ("PROMOS"))
|
||||
|
||||
If c.RowCount = 0 Then
|
||||
If c.RowCount > 0 Then
|
||||
|
||||
|
||||
MsgboxAsync("No puedes hacer venta porque no tienes inventario abordo","Atención")
|
||||
Else If c.RowCount > 0 Then
|
||||
|
||||
B4XPages.MainPage.tipo_venta = "VENTA"
|
||||
' If B4XPages.MainPage.productos.clv_prods_ll.Size = 0 Then
|
||||
@@ -1337,6 +1336,11 @@ Private Sub b_ventaabordo_Click
|
||||
' If B4XPages.MainPage.productos.prodsMap.IsInitialized And B4XPages.MainPage.productos.prodsMap.Size > 0 Then Subs.borraPedidoClienteActual
|
||||
B4XPages.ShowPage("productos")
|
||||
|
||||
|
||||
Else If c.RowCount = 0 Then
|
||||
|
||||
MsgboxAsync("No puedes hacer venta porque no tienes inventario abordo","Atención")
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
@@ -36,6 +36,7 @@ Sub Class_Globals
|
||||
Private p_nota As Panel
|
||||
Dim vamoaver As List
|
||||
Dim c2 As Cursor
|
||||
Dim j3 As Cursor
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -175,6 +176,7 @@ Sub borra_Click
|
||||
End Sub
|
||||
|
||||
Sub ListView1_ItemLongClick (Position As Int, Value As Object)
|
||||
Log(Value)
|
||||
If Not(Subs.pedidoGuardado) Then
|
||||
result = Msgbox2("Seguro que desea borrar este articulo?","Borrar Articulo", "Si", "", "No",LoadBitmap(File.DirAssets,"alert2.png")) 'ignore
|
||||
If result = DialogResponse.POSITIVE Then
|
||||
@@ -192,13 +194,24 @@ Sub ListView1_ItemLongClick (Position As Int, Value As Object)
|
||||
Log(Value)
|
||||
Starter.tabla = "CAT_GUNAPROD"
|
||||
End If
|
||||
B4XPages.MainPage.skmt.ExecNonQuery2($"update ${Starter.tabla} set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?"$, Array As Object(c.GetString("PE_CANT"),c.GetString("PE_PROID")))
|
||||
' B4XPages.MainPage.skmt.ExecNonQuery2($"update ${Starter.tabla} set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?"$, Array As Object(c.GetString("PE_CANT"),c.GetString("PE_PROID")))
|
||||
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO INVENT_X_ENVIAR (ALMACEN , PROID , CANTIDAD ) VALUES(?,?,?) ", Array As Object (Subs.traeAlmacen,c.GetString("PE_PROID"),c.GetString("PE_CANT")* -1))
|
||||
c2=B4XPages.MainPage.skmt.ExecQuery2($"select count(*) AS CUANTOS from ${Starter.tabla} where CAT_GP_ID in (select pe_cedis from pedido where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa)) and CAT_GP_CLASIF = 'PROMOS' AND CAT_GP_TIPO = 'PROMOS' AND CAT_GP_SUBTIPO = 'PROMOS'"$, Array As String(Value))
|
||||
c2.Position=0
|
||||
Log(c2.GetString("CUANTOS"))
|
||||
If c2.GetString("CUANTOS") > 0 Then
|
||||
B4XPages.MainPage.skmt.ExecNonQuery($"update ${Starter.tabla} set cat_gp_almacen = cat_gp_almacen + ${c.GetString("PE_CANT")} where cat_gp_id = '${c.Getstring("PE_PROID")}'"$)
|
||||
B4XPages.MainPage.skmt.ExecNonQuery2("delete from pedido where pe_cedis in (select pe_cedis from pedido where pe_pronombre = ?) and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?", Array As Object(Value, c.GetString("PE_FOLIO")))
|
||||
j3 = B4XPages.MainPage.skmt.ExecQuery2("SELECT PE_CEDIS, PE_CANT,PE_PROID, PE_PRONOMBRE FROM PEDIDO WHERE PE_CEDIS IN (SELECT PE_CEDIS FROM PEDIDO WHERE PE_PRONOMBRE = ?)",Array As String(Value))
|
||||
Log(j3.RowCount)
|
||||
If j3.RowCount > 0 Then
|
||||
Log("estoy aqui")
|
||||
For i = 0 To j3.RowCount -1
|
||||
Log("aqui tronare?")
|
||||
j3.Position = i
|
||||
B4XPages.MainPage.skmt.ExecNonQuery($"update ${Starter.tabla} set cat_gp_almacen = cat_gp_almacen + ${j3.GetString("PE_CANT")} where cat_gp_id = '${j3.Getstring("PE_PROID")}'"$)
|
||||
B4XPages.MainPage.skmt.ExecNonQuery2("delete from pedido where pe_cedis in (select pe_cedis from pedido where pe_pronombre = ?) and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?", Array As Object(j3.GetString("PE_PRONOMBRE"), c.GetString("PE_FOLIO")))
|
||||
Next
|
||||
End If
|
||||
j3.Close
|
||||
Else
|
||||
B4XPages.MainPage.skmt.ExecNonQuery($"update ${Starter.tabla} set cat_gp_almacen = cat_gp_almacen + ${c.GetString("PE_CANT")} where cat_gp_id = '${c.Getstring("PE_PROID")}'"$)
|
||||
B4XPages.MainPage.skmt.ExecNonQuery2("delete from pedido where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?", Array As Object(Value, c.GetString("PE_FOLIO")))
|
||||
|
||||
@@ -83,6 +83,8 @@ Sub Class_Globals
|
||||
Dim listaHints As List
|
||||
Dim r As Cursor
|
||||
Dim vamoaver As List
|
||||
Dim j3 As Cursor
|
||||
Dim invtotal As Int
|
||||
End Sub
|
||||
|
||||
'You can add more parameters here.
|
||||
@@ -515,11 +517,13 @@ End Sub
|
||||
|
||||
Sub b_prodMenos_Click
|
||||
etCantHasFocus = False
|
||||
Root.RequestFocus
|
||||
' LogColor("b_prodMenos_Click", Colors.Magenta)
|
||||
Dim index As Int = clv_prods_ll.GetItemFromView(Sender)
|
||||
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)
|
||||
Dim lProdX As B4XView = pnl.GetView(1)
|
||||
' Log($"precio|stock:${laCant.tag}"$)
|
||||
If laCant.Text = "" Then laCant.Text = 0
|
||||
' Log("lacant.text="&laCant.text)
|
||||
@@ -529,6 +533,7 @@ Sub b_prodMenos_Click
|
||||
Private precio As String=clv_prods_ll.GetValue(index).As(Map).Get("precio")
|
||||
Private id As String=clv_prods_ll.GetValue(index).As(Map).Get("id")
|
||||
Private tmpMap As Map = CreateMap("precio":precio, "cant":laCant.Text, "almacen":Subs.traeAlmacen)
|
||||
Private nombreX As String = Subs.traeProdNombre(id)
|
||||
Log(tmpMap)
|
||||
' prodsMap.Put(id, tmpMap)
|
||||
If laCant.Text = 0 Then prodsMap.Remove(id)
|
||||
@@ -539,53 +544,123 @@ Sub b_prodMenos_Click
|
||||
cuentaProds
|
||||
LogColor("prodsMap="&prodsMap, Colors.blue)
|
||||
Log($"Total Prods: ${totalProds}, Total Compra: $$1.2{totalCompra}"$)
|
||||
If 1 = 1 Then
|
||||
Private cs As CSBuilder
|
||||
cs.Initialize
|
||||
Private o As Cursor = Starter.skmt.ExecQuery($"select CAT_GP_ALMACEN from ${Starter.tabla} where CAT_GP_ID = '${id}'"$)
|
||||
Private invActualizado As String = "0"
|
||||
If o.RowCount > 0 Then
|
||||
o.Position = 0
|
||||
invActualizado = o.GetString("CAT_GP_ALMACEN")
|
||||
End If
|
||||
If 2 = 2 Then lProdX.Text = cs.Color(Colors.red).append(nombreX).pop.Append(CRLF).Append("Existencias: " & invActualizado).Color(0xFF017F01).Append($" $${NumberFormat2(precio, 1, 2, 2, False)}"$).Popall
|
||||
' Log(lProdX.Text)
|
||||
End If
|
||||
If Subs.totalPedido < 1 Then laCant.Text = "0"
|
||||
End Sub
|
||||
|
||||
Sub b_prodMas_Click
|
||||
etCantHasFocus = False
|
||||
Root.RequestFocus
|
||||
' LogColor("b_prodMas_Click", Colors.Magenta)
|
||||
|
||||
Dim index As Int = clv_prods_ll.GetItemFromView(Sender)
|
||||
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)
|
||||
Dim lProdX As B4XView = pnl.GetView(1)
|
||||
|
||||
' 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 inv As String=clv_prods_ll.GetValue(index).As(Map).Get("almacen")
|
||||
Private existencias As String = clv_prods_ll.GetValue(index).As(Map).Get("almacen")
|
||||
Log($"Existencias: ${existencias}"$)
|
||||
If laCant.Text = "" Then laCant.Text = 0
|
||||
Private id As String=clv_prods_ll.GetValue(index).As(Map).Get("id")
|
||||
' If laCant.Text + 1 <= inv Then
|
||||
'' Log(NumberFormat2(laCant.Text+1,0,0,0,False))
|
||||
' laCant.Text = $"${NumberFormat2(laCant.Text+1,0,0,0,False)}"$
|
||||
'' Private precio As String=clv_prods_ll.GetValue(index).As(Map).Get("precio")
|
||||
' Private id As String=clv_prods_ll.GetValue(index).As(Map).Get("id")
|
||||
'' Private tmpMap As Map = CreateMap("precio":precio, "cant":laCant.Text, "almacen":Subs.traeAlmacen)
|
||||
'' Log(tmpMap)
|
||||
'' prodsMap.Put(id, tmpMap)
|
||||
'' LogColor(prodsMap, Colors.blue)
|
||||
' End If
|
||||
Log("Cantidad + exis " & (laCant.Text + existencias))
|
||||
Log( (laCant.Text + 1 <= (laCant.Text + existencias)))
|
||||
Log("inventario "&Subs.traeinventario(id))
|
||||
Log((Subs.totalPedido - precio > 1))
|
||||
Log((Subs.totalPedido))
|
||||
Log(precio)
|
||||
|
||||
If laCant.Text + 1 <= inv Then
|
||||
' Log(NumberFormat2(laCant.Text+1,0,0,0,False))
|
||||
laCant.Text = $"${NumberFormat2(laCant.Text+1,0,0,0,False)}"$
|
||||
' Private precio As String=clv_prods_ll.GetValue(index).As(Map).Get("precio")
|
||||
Private id As String=clv_prods_ll.GetValue(index).As(Map).Get("id")
|
||||
' Private tmpMap As Map = CreateMap("precio":precio, "cant":laCant.Text, "almacen":Subs.traeAlmacen)
|
||||
' Log(tmpMap)
|
||||
' prodsMap.Put(id, tmpMap)
|
||||
' LogColor(prodsMap, Colors.blue)
|
||||
If Subs.traeinventario(id) > 0 And (laCant.Text <= (laCant.Text + Subs.traeinventario(id))) Then 'And (Subs.totalPedido - precio > 1)
|
||||
Log(clv_prods_ll.GetValue(index).As(Map))
|
||||
clv_prods_ll.GetValue(index).As(Map).Put("almacen", (inv - 1))
|
||||
inv = inv - 1
|
||||
' laCant.Text = $"$1.0{laCant.Text+1}"$
|
||||
laCant.Text = NumberFormat2((laCant.Text + 1), 1, 0, 0, False)
|
||||
' Log(clv_prods_ll.GetValue(index).As(Map))
|
||||
End If
|
||||
Private nombreX As String = Subs.traeProdNombre(id)
|
||||
' Subs.actualizaProducto(Subs.traeAlmacen, laCant.text, id, clienteId)
|
||||
|
||||
|
||||
|
||||
Subs.actualizaProducto(Subs.traeAlmacen, precio, laCant.text, Subs.traeProdNombre(id), id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta)
|
||||
cuentaProds
|
||||
' Log($"Total Prods: ${totalProds}, Total Compra: $$1.2{totalCompra}"$)
|
||||
If 1 = 1 Then
|
||||
Private cs As CSBuilder
|
||||
cs.Initialize
|
||||
Private o As Cursor = Starter.skmt.ExecQuery($"select CAT_GP_ALMACEN from ${Starter.tabla} where CAT_GP_ID = '${id}'"$)
|
||||
Private invActualizado As String = "0"
|
||||
If o.RowCount > 0 Then
|
||||
o.Position = 0
|
||||
invActualizado = o.GetString("CAT_GP_ALMACEN")
|
||||
End If
|
||||
If 2 = 2 Then lProdX.Text = cs.Color(Colors.red).append(nombreX).pop.Append(CRLF).Append("Existencias: " & invActualizado).Color(0xFF017F01).Append($" $${NumberFormat2(precio, 1, 2, 2, False)}"$).Popall
|
||||
' Log(lProdX.Text)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub et_pCant_TextChanged (Old As String, New As String)
|
||||
Log(etCantHasFocus)
|
||||
|
||||
If etCantHasFocus = True Then
|
||||
' LogColor($"txt changed: ${Old}|${New}, hasfocus=${etCantHasFocus}"$,Colors.Magenta)
|
||||
LogColor($"txt changed: ${Old}|${New}, hasfocus=${etCantHasFocus}"$,Colors.Magenta)
|
||||
Dim index As Int = clv_prods_ll.GetItemFromView(Sender)
|
||||
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)
|
||||
' Dim lProdX As B4XView = pnl.GetView(1)
|
||||
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 inv As String=clv_prods_ll.GetValue(index).As(Map).Get("almacen")
|
||||
Private inv As String=clv_prods_ll.GetValue(index).As(Map).Get("almacen")
|
||||
If(New = "" Or New = Null) Then New = 0
|
||||
If(New > inv) Then
|
||||
Sender.As(EditText).text = inv
|
||||
Private inv As String=Subs.traeinventario(id)
|
||||
' Private nombreX As String = Subs.traeProdNombre(id)
|
||||
If(New = "" Or New = Null Or New = "-") Then New = 0
|
||||
' If New < 0 Then New = 0
|
||||
If(New > invtotal) Then
|
||||
Sender.As(EditText).text = invtotal
|
||||
End If
|
||||
' Log($"inventario=${inv}"$)
|
||||
|
||||
' If 1 = 1 Then
|
||||
' Private cs As CSBuilder
|
||||
' cs.Initialize
|
||||
' Private o As Cursor = Starter.skmt.ExecQuery($"select CAT_GP_ALMACEN from ${Starter.tabla} where CAT_GP_ID = '${id}'"$)
|
||||
' Private invActualizado As String = "0"
|
||||
' If o.RowCount > 0 Then
|
||||
' o.Position = 0
|
||||
' invActualizado = o.GetString("CAT_GP_ALMACEN")
|
||||
' End If
|
||||
' If 2 = 2 Then lProdX.Text = cs.Color(Colors.red).append(nombreX).pop.Append(CRLF).Append("Existencias: " & invActualizado).Color(0xFF017F01).Append($" $${NumberFormat2(precio, 1, 2, 2, False)}"$).Popall
|
||||
'' Log(lProdX.Text)
|
||||
' End If
|
||||
|
||||
If Not(Old = "0" And New = "") And laCant.Text <> Null And laCant.Text <> 0 And laCant.Text <> "" And etCantHasFocus Then
|
||||
Log("actualizamos producto")
|
||||
Subs.actualizaProducto(Subs.traeAlmacen, precio, laCant.text, Subs.traeProdNombre(id), id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta)
|
||||
cuentaProds
|
||||
End If
|
||||
@@ -608,6 +683,9 @@ End Sub
|
||||
|
||||
Private Sub et_pCant_FocusChanged (HasFocus As Boolean)
|
||||
LogColor($"focus changed=${HasFocus}"$, Colors.Magenta)
|
||||
Dim index As Int = clv_prods_ll.GetItemFromView(Sender)
|
||||
Private id As String=clv_prods_ll.GetValue(index).As(Map).Get("id")
|
||||
invtotal = et_pCant.Text + Subs.traeinventario(id)
|
||||
etCantHasFocus = HasFocus
|
||||
cuentaProds
|
||||
End Sub
|
||||
@@ -815,13 +893,24 @@ Private Sub lv_prodsPedido_ItemLongClick (Position As Int, Value As Object)
|
||||
Log(Value)
|
||||
Starter.tabla = "CAT_GUNAPROD"
|
||||
End If
|
||||
B4XPages.MainPage.skmt.ExecNonQuery2($"update ${Starter.tabla} set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?"$, Array As Object(c.GetString("PE_CANT"),c.GetString("PE_PROID")))
|
||||
' B4XPages.MainPage.skmt.ExecNonQuery2($"update ${Starter.tabla} set cat_gp_almacen = cat_gp_almacen + ? where cat_gp_id = ?"$, Array As Object(c.GetString("PE_CANT"),c.GetString("PE_PROID")))
|
||||
' Log(c.GetString("PE_CANT"))
|
||||
B4XPages.MainPage.skmt.ExecNonQuery2("INSERT INTO INVENT_X_ENVIAR (ALMACEN , PROID , CANTIDAD ) VALUES(?,?,?) ", Array As Object (Subs.traeAlmacen,c.GetString("PE_PROID"),c.GetString("PE_CANT")* -1))
|
||||
c2=B4XPages.MainPage.skmt.ExecQuery2($"select count(*) AS CUANTOS from ${Starter.tabla} where CAT_GP_ID in (select pe_cedis from pedido where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa)) and CAT_GP_CLASIF = 'PROMOS' AND CAT_GP_TIPO = 'PROMOS' AND CAT_GP_SUBTIPO = 'PROMOS'"$, Array As String(Value))
|
||||
c2.Position=0
|
||||
If c2.GetString("CUANTOS") > 0 Then
|
||||
B4XPages.MainPage.skmt.ExecNonQuery($"update ${Starter.tabla} set cat_gp_almacen = cat_gp_almacen + ${c.GetString("PE_CANT")} where cat_gp_id = '${c.Getstring("PE_PROID")}'"$)
|
||||
B4XPages.MainPage.skmt.ExecNonQuery2("delete from pedido where pe_cedis in (select pe_cedis from pedido where pe_pronombre = ?) and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?", Array As Object(Value, c.GetString("PE_FOLIO")))
|
||||
j3 = B4XPages.MainPage.skmt.ExecQuery2("SELECT PE_CEDIS, PE_CANT,PE_PROID, PE_PRONOMBRE FROM PEDIDO WHERE PE_CEDIS IN (SELECT PE_CEDIS FROM PEDIDO WHERE PE_PRONOMBRE = ?)",Array As String(Value))
|
||||
Log(j3.RowCount)
|
||||
If j3.RowCount > 0 Then
|
||||
Log("estoy aqui")
|
||||
For i = 0 To j3.RowCount -1
|
||||
Log("aqui tronare?")
|
||||
j3.Position = i
|
||||
B4XPages.MainPage.skmt.ExecNonQuery($"update ${Starter.tabla} set cat_gp_almacen = cat_gp_almacen + ${j3.GetString("PE_CANT")} where cat_gp_id = '${j3.Getstring("PE_PROID")}'"$)
|
||||
B4XPages.MainPage.skmt.ExecNonQuery2("delete from pedido where pe_cedis in (select pe_cedis from pedido where pe_pronombre = ?) and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?", Array As Object(j3.GetString("PE_PRONOMBRE"), c.GetString("PE_FOLIO")))
|
||||
Next
|
||||
End If
|
||||
j3.Close
|
||||
Else
|
||||
B4XPages.MainPage.skmt.ExecNonQuery($"update ${Starter.tabla} set cat_gp_almacen = cat_gp_almacen + ${c.GetString("PE_CANT")} where cat_gp_id = '${c.Getstring("PE_PROID")}'"$)
|
||||
B4XPages.MainPage.skmt.ExecNonQuery2("delete from pedido where pe_pronombre = ? and pe_cliente in (Select CUENTA from cuentaa) AND PE_FOLIO = ?", Array As Object(Value, c.GetString("PE_FOLIO")))
|
||||
@@ -981,7 +1070,8 @@ Sub LlenaProdsLL(p As ResultSet)
|
||||
Else
|
||||
' Log("NO HAY RESULSET")
|
||||
LogColor(Starter.tabla,Colors.blue)
|
||||
Dim p As ResultSet = B4XPages.MainPage.skmt.ExecQuery($"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD from ${Starter.tabla} where CAT_GP_PRECIO > 0 And CAT_GP_ALMACEN > 0 And CAT_GP_CLASIF <> 'PROMOS' order by CAT_GP_NOMBRE"$)
|
||||
' Dim p As ResultSet = B4XPages.MainPage.skmt.ExecQuery($"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD from ${Starter.tabla} where CAT_GP_PRECIO > 0 And CAT_GP_ALMACEN > 0 And CAT_GP_CLASIF <> 'PROMOS' order by CAT_GP_NOMBRE"$)
|
||||
Dim p As ResultSet = B4XPages.MainPage.skmt.ExecQuery($"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD from ${Starter.tabla} where CAT_GP_PRECIO > 0 And CAT_GP_ALMACEN > 0 And CAT_GP_CLASIF <> 'PROMOS' union all select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD from ${Starter.tabla} where CAT_GP_PRECIO > 0 And CAT_GP_ALMACEN = 0 And CAT_GP_CLASIF <> 'PROMOS' and cat_gp_id in (select pe_proid from pedido where pe_cliente in (select cuenta from cuentaa)) order by 2"$)
|
||||
End If
|
||||
|
||||
Do While p.NextRow
|
||||
|
||||
@@ -442,7 +442,7 @@ Sub cuentaProds
|
||||
Private p0 As B4XView = clv_prodsVariabes.GetPanel(i)
|
||||
Private p As B4XView = p0.GetView(0)
|
||||
Private cant1 As B4XView = p.GetView(2).GetView(4)
|
||||
' If cant1.Text = "" Then cant1.Text = 0
|
||||
If cant1.Text = "" Then cant1.Text = 0
|
||||
totalProds = totalProds + cant1.Text
|
||||
prodsVar1 = prodsVar1 + cant1.Text
|
||||
Private esteTag As List = Regex.Split("\|", cant1.Tag)
|
||||
|
||||
@@ -158,12 +158,12 @@ Module9=C_Nota
|
||||
NumberOfFiles=46
|
||||
NumberOfLibraries=34
|
||||
NumberOfModules=28
|
||||
Version=12.8
|
||||
Version=12.5
|
||||
@EndOfDesignText@
|
||||
#Region Project Attributes
|
||||
#ApplicationLabel: Intmex
|
||||
#VersionCode: 1
|
||||
#VersionName: 4.05.05
|
||||
#VersionName: 4.05.10
|
||||
'SupportedOrientations possible values: unspecified, landscape or portrait.
|
||||
#SupportedOrientations: portrait
|
||||
#CanInstallToExternalStorage: False
|
||||
|
||||
@@ -76,7 +76,7 @@ ModuleClosedNodes23=2
|
||||
ModuleClosedNodes24=
|
||||
ModuleClosedNodes25=1
|
||||
ModuleClosedNodes26=
|
||||
ModuleClosedNodes27=52,53,55,58,61
|
||||
ModuleClosedNodes27=
|
||||
ModuleClosedNodes28=
|
||||
ModuleClosedNodes3=
|
||||
ModuleClosedNodes4=
|
||||
@@ -85,6 +85,6 @@ ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=
|
||||
ModuleClosedNodes8=
|
||||
ModuleClosedNodes9=
|
||||
NavigationStack=C_Productos,b_terminar1_Click,635,0,C_Nota,B4XPage_Appear,94,6,C_Principal,resdia_Click,2270,6,Diseñador Visual,resdia.bal,-100,6,Diseñador Visual,clientes.bal,-100,1,C_Cliente,MODS,0,0,C_Cliente,B4XPage_Appear,382,6,Diseñador Visual,cliente.bal,-100,2,C_Cliente,cuest_preguntaContestada,1281,0,C_Cliente,b_ventaabordo_Click,1335,6
|
||||
NavigationStack=Subs,traeinventario,1401,6,C_Productos,cuentaProds,640,0,C_Cliente,MODS,0,0,Subs,actualizaProducto,782,2,Subs,guardaProductoSinGestion,764,3,C_Productos,b_prodMenos_Click,512,1,C_Productos,b_prodMas_Click,617,6,C_Productos,Class_Globals,80,5,C_Productos,et_pCant_FocusChanged,677,6,C_Productos,et_pCant_TextChanged,637,6
|
||||
SelectedBuild=0
|
||||
VisibleModules=2,26,13,16,14,4,27,15,9,6
|
||||
|
||||
32
B4A/Subs.bas
32
B4A/Subs.bas
@@ -689,6 +689,24 @@ Sub traeProdNombre(id As String) As String
|
||||
Return n
|
||||
End Sub
|
||||
|
||||
'Regresa el total del pedido en la tabla "PEDIDO" del cliente actual.
|
||||
Sub totalPedido As String
|
||||
Private cT As Cursor = Starter.skmt.ExecQuery($"select sum(PE_COSTO_TOT) as total from PEDIDO where PE_CLIENTE = '${traeCliente}'"$)
|
||||
Private pTotal As String = "0"
|
||||
If cT.RowCount > 0 Then
|
||||
cT.Position = 0
|
||||
' Log("|"&cT.GetLong("total")&"|"&pTotal)
|
||||
Private tempT As String = cT.GetLong("total")
|
||||
If tempT <> "null" And tempT <> Null Then
|
||||
' Log("|"&cT.GetLong("total")&"|")
|
||||
pTotal = tempT
|
||||
End If
|
||||
' Log($"Cliente actual=${traeCliente}, hayPedido=${hay}"$)
|
||||
End If
|
||||
cT.Close
|
||||
Return pTotal
|
||||
End Sub
|
||||
|
||||
'Regresa la ruta actual de la base de datos.
|
||||
Sub traeRuta As String 'ignore
|
||||
Private c As Cursor
|
||||
@@ -763,6 +781,7 @@ End Sub
|
||||
Sub actualizaProducto(cedis As String, costoU As String, cant As String, nombre As String, prodId As String, clienteId As String, fecha As String, usuario As String, rutaV As String, precioSin As String, tipoVenta As String)
|
||||
Private c As Cursor=B4XPages.MainPage.skmt.ExecQuery($"select * from pedido where pe_cedis = '${cedis}' and pe_proid = '${prodId}' and pe_cliente = '${clienteId}' AND PE_FOLIO = '${B4XPages.MainPage.tipo_venta}'"$)
|
||||
' Log($"ROWCOUNT: ${c.RowCount}, ${cant}"$)
|
||||
LogColor($"actualizaProducto, c=${clienteId}, p=${prodId}, nombre=${nombre}, cant=${cant}, cedis=${cedis}, tipo=${tipoVenta}"$, Colors.Magenta)
|
||||
If c.RowCount > 0 Then
|
||||
c.Position=0
|
||||
Private antCant As Int = 0
|
||||
@@ -1380,4 +1399,17 @@ Sub guardaAppInfo(skmt As SQL)
|
||||
skmt.ExecNonQuery("delete from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'EMPRESA' or CAT_VA_DESCRIPCION = 'APP_NAME' or CAT_VA_DESCRIPCION = 'APP_VERSION'")
|
||||
skmt.ExecNonQuery($"insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('APP_NAME', '${Application.LabelName}')"$)
|
||||
skmt.ExecNonQuery($"insert into CAT_VARIABLES (CAT_VA_DESCRIPCION, CAT_VA_VALOR) values ('APP_VERSION', '${Application.VersionName}')"$)
|
||||
End Sub
|
||||
|
||||
Sub traeinventario(id As String) As String
|
||||
Dim c As Cursor
|
||||
Dim inventario As String = "0"
|
||||
c=B4XPages.MainPage.skmt.ExecQuery($"select CAT_GP_ALMACEN from ${Starter.tabla} where CAT_GP_ID = '${id}'"$)
|
||||
' Log($"select CAT_GP_ALMACEN from ${Starter.tabla} where CAT_GP_NOMBRE = '${id}'"$)
|
||||
If c.RowCount > 0 Then
|
||||
c.Position = 0
|
||||
inventario = c.GetString("CAT_GP_ALMACEN")
|
||||
End If
|
||||
c.Close
|
||||
Return inventario
|
||||
End Sub
|
||||
Reference in New Issue
Block a user