This commit is contained in:
cvaldes1201
2024-05-15 18:19:36 -06:00
parent d47c993975
commit 6679e33d4a
7 changed files with 169 additions and 30 deletions

View File

@@ -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