mirror of
https://github.com/KeymonSoft/Kelloggs_v4.git
synced 2026-04-22 04:10:07 +00:00
- Se hicieron cambios en el codigo de boton mas y menos y textChanged de las cantidades de productos
This commit is contained in:
@@ -467,35 +467,36 @@ Sub B4XPage_Appear
|
|||||||
S1=Starter.skmt.ExecQuery("select count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")
|
S1=Starter.skmt.ExecQuery("select count(*) as CUANTOS FROM PEDIDO WHERE PE_CLIENTE IN (Select CUENTA from cuentaa)")
|
||||||
S1.Position=0
|
S1.Position=0
|
||||||
c.Position=0
|
c.Position=0
|
||||||
la_cuenta.Text = c.GetString("CAT_CL_CODIGO")
|
If c.RowCount > 0 Then
|
||||||
La_nombre.Text = c.GetString("CAT_CL_NOMBRE")
|
la_cuenta.Text = c.GetString("CAT_CL_CODIGO")
|
||||||
la_Calle.Text = "N/A"
|
La_nombre.Text = c.GetString("CAT_CL_NOMBRE")
|
||||||
|
la_Calle.Text = "N/A"
|
||||||
' Log("|"&c.GetString("CAT_CL_CALLE")&"|")
|
' Log("|"&c.GetString("CAT_CL_CALLE")&"|")
|
||||||
If c.GetString("CAT_CL_CALLE") <> Null And c.GetString("CAT_CL_CALLE") <> "null" Then la_Calle.Text = c.GetString("CAT_CL_CALLE") & c.GetString("CAT_CL_NOEXT")
|
If c.GetString("CAT_CL_CALLE") <> Null And c.GetString("CAT_CL_CALLE") <> "null" Then la_Calle.Text = c.GetString("CAT_CL_CALLE") & c.GetString("CAT_CL_NOEXT")
|
||||||
la_col.Text = "N/A"
|
la_col.Text = "N/A"
|
||||||
If c.GetString("CAT_CL_COLONIA") <> Null And c.GetString("CAT_CL_COLONIA") <> "null" Then la_col.Text = c.GetString("CAT_CL_COLONIA")
|
If c.GetString("CAT_CL_COLONIA") <> Null And c.GetString("CAT_CL_COLONIA") <> "null" Then la_col.Text = c.GetString("CAT_CL_COLONIA")
|
||||||
la_edo.Text = "N/A"
|
la_edo.Text = "N/A"
|
||||||
If c.GetString("CAT_CL_EDO") <> Null And c.GetString("CAT_CL_EDO") <>"null" Then la_edo.Text = c.GetString("CAT_CL_EDO")
|
If c.GetString("CAT_CL_EDO") <> Null And c.GetString("CAT_CL_EDO") <>"null" Then la_edo.Text = c.GetString("CAT_CL_EDO")
|
||||||
la_cp.Text = c.GetString("CAT_CL_CP")
|
la_cp.Text = c.GetString("CAT_CL_CP")
|
||||||
l_entre1.Text = "N/A"
|
l_entre1.Text = "N/A"
|
||||||
If c.GetString("CAT_CL_CALLE1") <> Null And c.GetString("CAT_CL_CALLE1") <>"null" Then l_entre1.Text = c.GetString("CAT_CL_CALLE1")
|
If c.GetString("CAT_CL_CALLE1") <> Null And c.GetString("CAT_CL_CALLE1") <>"null" Then l_entre1.Text = c.GetString("CAT_CL_CALLE1")
|
||||||
l_entre2.Text = "N/A"
|
l_entre2.Text = "N/A"
|
||||||
If c.GetString("CAT_CL_CALLE2") <> Null And c.GetString("CAT_CL_CALLE2") <> "null" Then l_entre2.Text = c.GetString("CAT_CL_CALLE2")
|
If c.GetString("CAT_CL_CALLE2") <> Null And c.GetString("CAT_CL_CALLE2") <> "null" Then l_entre2.Text = c.GetString("CAT_CL_CALLE2")
|
||||||
l_atiende.Text = "N/A"
|
l_atiende.Text = "N/A"
|
||||||
If c.GetString("CAT_CL_ATIENDE1") <> Null And c.GetString("CAT_CL_ATIENDE1") <> "null" Then l_atiende.Text = c.GetString("CAT_CL_ATIENDE1")
|
If c.GetString("CAT_CL_ATIENDE1") <> Null And c.GetString("CAT_CL_ATIENDE1") <> "null" Then l_atiende.Text = c.GetString("CAT_CL_ATIENDE1")
|
||||||
l_atiende2.Text = c.GetString("CAT_CL_ATIENTE2")
|
l_atiende2.Text = c.GetString("CAT_CL_ATIENTE2")
|
||||||
|
|
||||||
b_inicioFinVenta.Text = "INICIAR VENTA"
|
b_inicioFinVenta.Text = "INICIAR VENTA"
|
||||||
b_inicioFinVenta.BringToFront
|
b_inicioFinVenta.BringToFront
|
||||||
' LogColor(">>>>>> EN VENTA: " & Starter.enVenta, Colors.red)
|
' LogColor(">>>>>> EN VENTA: " & Starter.enVenta, Colors.red)
|
||||||
If Not(Starter.enVenta) And la_cuenta.Text <> "0" Then
|
If Not(Starter.enVenta) And la_cuenta.Text <> "0" Then
|
||||||
b_inicioFinVenta.Visible = True
|
b_inicioFinVenta.Visible = True
|
||||||
' Log("EnVenta Visible")
|
' Log("EnVenta Visible")
|
||||||
Else
|
Else
|
||||||
' Log("EnVenta NO Visible")
|
' Log("EnVenta NO Visible")
|
||||||
b_inicioFinVenta.Visible = False
|
b_inicioFinVenta.Visible = False
|
||||||
End If
|
End If
|
||||||
' LogColor(">>>>>> EN VENTA: " & Starter.enVenta, Colors.red)
|
' LogColor(">>>>>> EN VENTA: " & Starter.enVenta, Colors.red)
|
||||||
|
|
||||||
' LONGITUD = 0
|
' LONGITUD = 0
|
||||||
' If c.GetString("CAT_CL_LONG") <> Null And c.GetString("CAT_CL_LONG") <> "null" And IsNumber(c.GetString("CAT_CL_LONG")) Then LONGITUD = c.GetString("CAT_CL_LONG")
|
' If c.GetString("CAT_CL_LONG") <> Null And c.GetString("CAT_CL_LONG") <> "null" And IsNumber(c.GetString("CAT_CL_LONG")) Then LONGITUD = c.GetString("CAT_CL_LONG")
|
||||||
@@ -506,33 +507,37 @@ Sub B4XPage_Appear
|
|||||||
' l_segmento2.text = "N/A"
|
' l_segmento2.text = "N/A"
|
||||||
' If c.GetString("CAT_CL_SEGMENTO") <> Null Then l_segmento2.text = c.GetString("CAT_CL_SEGMENTO")
|
' If c.GetString("CAT_CL_SEGMENTO") <> Null Then l_segmento2.text = c.GetString("CAT_CL_SEGMENTO")
|
||||||
|
|
||||||
l_total.Text = kh.traeTotalCliente
|
l_total.Text = kh.traeTotalCliente
|
||||||
total_cliente = s.GetString("TOTAL_CLIE")
|
total_cliente = s.GetString("TOTAL_CLIE")
|
||||||
' Log(Subs.sumaPedido(Subs.traeCliente) & " - " & total_cliente)
|
' Log(Subs.sumaPedido(Subs.traeCliente) & " - " & total_cliente)
|
||||||
m_lat =c.GetString("CAT_CL_LAT")
|
m_lat =c.GetString("CAT_CL_LAT")
|
||||||
m_lon =c.GetString("CAT_CL_LONG")
|
m_lon =c.GetString("CAT_CL_LONG")
|
||||||
CREDITO_DISPONIBLE = c.GetString("CAT_CL_BFACTURA")
|
CREDITO_DISPONIBLE = c.GetString("CAT_CL_BFACTURA")
|
||||||
CREDITO = c.GetString("CAT_CL_BCREDITO")
|
CREDITO = c.GetString("CAT_CL_BCREDITO")
|
||||||
ruta_tienda = c.GetString("CAT_CL_RUTA")
|
ruta_tienda = c.GetString("CAT_CL_RUTA")
|
||||||
YA_IMPRIMIO2 = c.GetString("IMPRESION")
|
YA_IMPRIMIO2 = c.GetString("IMPRESION")
|
||||||
' If c.GetString("CAT_CL_EMAIL") = "1" Then
|
' If c.GetString("CAT_CL_EMAIL") = "1" Then
|
||||||
' l_doe.Visible = True
|
' l_doe.Visible = True
|
||||||
' Else
|
' Else
|
||||||
' l_doe.Visible = False
|
' l_doe.Visible = False
|
||||||
' End If
|
' End If
|
||||||
If kh.clienteConDOE And l_doe.IsInitialized Then
|
If kh.clienteConDOE And l_doe.IsInitialized Then
|
||||||
l_doe.Visible = True
|
l_doe.Visible = True
|
||||||
Else
|
Else
|
||||||
If l_doe.IsInitialized Then l_doe.Visible = False
|
If l_doe.IsInitialized Then l_doe.Visible = False
|
||||||
End If
|
End If
|
||||||
LONGITUD = 0
|
LONGITUD = 0
|
||||||
If c.GetString("CAT_CL_LONG") <> Null And c.GetString("CAT_CL_LONG") <> "null" And IsNumber(c.GetString("CAT_CL_LONG")) Then LONGITUD = c.GetString("CAT_CL_LONG")
|
If c.GetString("CAT_CL_LONG") <> Null And c.GetString("CAT_CL_LONG") <> "null" And IsNumber(c.GetString("CAT_CL_LONG")) Then LONGITUD = c.GetString("CAT_CL_LONG")
|
||||||
LATITUD = 0
|
LATITUD = 0
|
||||||
If c.GetString("CAT_CL_LAT") <> Null And c.GetString("CAT_CL_LAT") <> "null" And IsNumber(c.GetString("CAT_CL_LAT")) Then LATITUD = c.GetString("CAT_CL_LAT")
|
If c.GetString("CAT_CL_LAT") <> Null And c.GetString("CAT_CL_LAT") <> "null" And IsNumber(c.GetString("CAT_CL_LAT")) Then LATITUD = c.GetString("CAT_CL_LAT")
|
||||||
' LogColor($"${c.GetString("CAT_CL_LAT")}, ${c.GetString("CAT_CL_LONG")}"$, Colors.red)
|
' LogColor($"${c.GetString("CAT_CL_LAT")}, ${c.GetString("CAT_CL_LONG")}"$, Colors.red)
|
||||||
If logger Then Log($"Lat: ${LATITUD}, Lon: ${LONGITUD}"$)
|
If logger Then Log($"Lat: ${LATITUD}, Lon: ${LONGITUD}"$)
|
||||||
NOMBRE = c.GetString("CAT_CL_NOMBRE")
|
NOMBRE = c.GetString("CAT_CL_NOMBRE")
|
||||||
' Log($"TOTAL DE LA VENTA: ${kh.traeTotalCliente}"$)
|
' Log($"TOTAL DE LA VENTA: ${kh.traeTotalCliente}"$)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If kh.traeTotalCliente < 0.01 And kh.traeTotalClienteDOE < 0.01 Then
|
If kh.traeTotalCliente < 0.01 And kh.traeTotalClienteDOE < 0.01 Then
|
||||||
If Not(clienteId.StartsWith("N")) And la_cuenta.Text <> "0" Then b_noVenta.Visible = True 'Ni cliente nuevo, ni abordo.
|
If Not(clienteId.StartsWith("N")) And la_cuenta.Text <> "0" Then b_noVenta.Visible = True 'Ni cliente nuevo, ni abordo.
|
||||||
Else
|
Else
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ Sub Class_Globals
|
|||||||
Private l_avisoAbordo As Label
|
Private l_avisoAbordo As Label
|
||||||
Private l_infoPedido As Label
|
Private l_infoPedido As Label
|
||||||
Dim promosC As Promociones
|
Dim promosC As Promociones
|
||||||
|
Dim invTotal As Int
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'You can add more parameters here.
|
'You can add more parameters here.
|
||||||
@@ -549,6 +550,7 @@ Sub CreateListItem(Text As String, precioU As String, inv As Int, Width As Int,
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub b_prodMenos_Click
|
Sub b_prodMenos_Click
|
||||||
|
Root.RequestFocus
|
||||||
etCantHasFocus = False
|
etCantHasFocus = False
|
||||||
' Log(Sender.As(Button).text & "|" & Sender.As(Button).tag)
|
' Log(Sender.As(Button).text & "|" & Sender.As(Button).tag)
|
||||||
Private buttonTag As String = Sender.As(Button).tag
|
Private buttonTag As String = Sender.As(Button).tag
|
||||||
@@ -604,9 +606,13 @@ Sub b_prodMenos_Click
|
|||||||
End If
|
End If
|
||||||
If Subs.totalPedido < 1 Then laCant.Text = "0"
|
If Subs.totalPedido < 1 Then laCant.Text = "0"
|
||||||
' Log($"Total Prods: ${totalProds}, Total Compra: $$1.2{totalCompra}"$)
|
' Log($"Total Prods: ${totalProds}, Total Compra: $$1.2{totalCompra}"$)
|
||||||
|
Sleep(300)
|
||||||
|
invTotal = laCant.Text + Subs.traeinventario(id)
|
||||||
|
LogColor("InvTotal PRODMAS: " & invTotal, Colors.Red)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub b_prodMas_Click
|
Sub b_prodMas_Click
|
||||||
|
Root.RequestFocus
|
||||||
etCantHasFocus = False
|
etCantHasFocus = False
|
||||||
Private buttonTag As String = Sender.As(Button).tag
|
Private buttonTag As String = Sender.As(Button).tag
|
||||||
Dim index As Int = clv_prods_ll.GetItemFromView(Sender)
|
Dim index As Int = clv_prods_ll.GetItemFromView(Sender)
|
||||||
@@ -666,7 +672,8 @@ Sub b_prodMas_Click
|
|||||||
precioX = precioX * -1
|
precioX = precioX * -1
|
||||||
End If
|
End If
|
||||||
Subs.actualizaProducto(almacenX, precioX, laCant.text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
Subs.actualizaProducto(almacenX, precioX, laCant.text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
||||||
If Subs.totalPedido < 1 Then
|
Log($"TotalPedido: ${NumberFormat2(Subs.totalPedido,1,2,2,False)}"$)
|
||||||
|
If Subs.totalPedido < 0.01 Then
|
||||||
etCantHasFocus = False
|
etCantHasFocus = False
|
||||||
Log("A CERO")
|
Log("A CERO")
|
||||||
laCant.Text = "0"
|
laCant.Text = "0"
|
||||||
@@ -706,6 +713,9 @@ Sub b_prodMas_Click
|
|||||||
If Starter.tipov <> "ABORDO" 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
|
If Starter.tipov <> "ABORDO" 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
|
||||||
End If
|
End If
|
||||||
Log($"Total Prods: ${totalProds}, Total Compra: $$1.2{totalCompra}"$)
|
Log($"Total Prods: ${totalProds}, Total Compra: $$1.2{totalCompra}"$)
|
||||||
|
Sleep(300)
|
||||||
|
invTotal = laCant.Text + Subs.traeinventario(id)
|
||||||
|
LogColor("InvTotal PRODMAS: " & invTotal, Colors.Red)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub et_pCant_TextChanged (Old As String, New As String)
|
Private Sub et_pCant_TextChanged (Old As String, New As String)
|
||||||
@@ -718,7 +728,6 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
|
|||||||
Dim pnl0 As B4XView = clv_prods_ll.GetPanel(index)
|
Dim pnl0 As B4XView = clv_prods_ll.GetPanel(index)
|
||||||
Dim pnl As B4XView = pnl0.GetView(0)
|
Dim pnl As B4XView = pnl0.GetView(0)
|
||||||
Private existencias 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($"ExistenciasX: ${existencias}"$)
|
|
||||||
Dim laCant As B4XView = pnl.GetView(2).GetView(2)
|
Dim laCant As B4XView = pnl.GetView(2).GetView(2)
|
||||||
Private id As String=clv_prods_ll.GetValue(index).As(Map).Get("id")
|
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 precio As String=clv_prods_ll.GetValue(index).As(Map).Get("precio")
|
||||||
@@ -729,13 +738,12 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
|
|||||||
disp = NumberFormat2(disp, 1, 0, 0, False)
|
disp = NumberFormat2(disp, 1, 0, 0, False)
|
||||||
If existencias = "" Then existencias = 0
|
If existencias = "" Then existencias = 0
|
||||||
existencias = NumberFormat2(existencias, 1, 0, 0, False)
|
existencias = NumberFormat2(existencias, 1, 0, 0, False)
|
||||||
|
|
||||||
Log($"${laCant.text}, ${precio}, DISPONIBLES: ${disp}"$)
|
Log($"${laCant.text}, ${precio}, DISPONIBLES: ${disp}"$)
|
||||||
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")
|
||||||
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 = "" Or New = Null) Then New = 0
|
||||||
If(New > inv) Then
|
If(New > invTotal) Then
|
||||||
Sender.As(EditText).text = inv
|
Sender.As(EditText).text = invTotal
|
||||||
End If
|
End If
|
||||||
Private almacenX As String = Subs.traeAlmacen
|
Private almacenX As String = Subs.traeAlmacen
|
||||||
Private nombreX As String = Subs.traeProdNombre(id)
|
Private nombreX As String = Subs.traeProdNombre(id)
|
||||||
@@ -763,7 +771,9 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
|
|||||||
' End If
|
' End If
|
||||||
Log("REVISAMOS ABORDO DISP")
|
Log("REVISAMOS ABORDO DISP")
|
||||||
dispAbordo = kh.traeDisponibleAbordo
|
dispAbordo = kh.traeDisponibleAbordo
|
||||||
|
LogColor($"traeCliente = ${Subs.traeCliente}, dispAbordo = ${dispAbordo}"$, Colors.red)
|
||||||
If Subs.traeCliente = 0 And dispAbordo < 1 Then
|
If Subs.traeCliente = 0 And dispAbordo < 1 Then
|
||||||
|
ToastMessageShow("Sobrepasa el limite disponible para el abordo!", False)
|
||||||
Log("######### "& NumberFormat2((kh.traeLimiteAbordoWeb - (kh.traeLimiteAbordoXInventario - kh.traeVenta) - kh.traeVentaAbordo), 0, 2, 2, False))
|
Log("######### "& NumberFormat2((kh.traeLimiteAbordoWeb - (kh.traeLimiteAbordoXInventario - kh.traeVenta) - kh.traeVentaAbordo), 0, 2, 2, False))
|
||||||
laCant.Text = NumberFormat2(Old, 1, 0, 0, False)
|
laCant.Text = NumberFormat2(Old, 1, 0, 0, False)
|
||||||
Subs.actualizaProducto(almacenX, precioX, laCant.text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
Subs.actualizaProducto(almacenX, precioX, laCant.text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
||||||
@@ -785,6 +795,13 @@ End Sub
|
|||||||
Private Sub et_pCant_FocusChanged (HasFocus As Boolean)
|
Private Sub et_pCant_FocusChanged (HasFocus As Boolean)
|
||||||
' LogColor($"focus changed=${HasFocus}"$, Colors.Magenta)
|
' LogColor($"focus changed=${HasFocus}"$, Colors.Magenta)
|
||||||
etCantHasFocus = HasFocus
|
etCantHasFocus = HasFocus
|
||||||
|
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)
|
||||||
|
Private id As String=clv_prods_ll.GetValue(index).As(Map).Get("id")
|
||||||
|
invTotal = laCant.Text + Subs.traeinventario(id)
|
||||||
|
LogColor("InvTotal PRODMAS: " & invTotal, Colors.Red)
|
||||||
cuentaProds
|
cuentaProds
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -1102,6 +1119,7 @@ Sub l_prodX_Click
|
|||||||
'Traemos el inventario de abordo de este producto.
|
'Traemos el inventario de abordo de este producto.
|
||||||
Private i As Cursor = Starter.skmt.ExecQuery($"select CAT_GP_ALMACEN from cat_gunaprod2 where CAT_GP_ID = '${Sender.as(Label).tag}'"$)
|
Private i As Cursor = Starter.skmt.ExecQuery($"select CAT_GP_ALMACEN from cat_gunaprod2 where CAT_GP_ID = '${Sender.as(Label).tag}'"$)
|
||||||
Private abordo As String = "0"
|
Private abordo As String = "0"
|
||||||
|
Log("TAG: " & Sender.As(Label).tag)
|
||||||
If i.RowCount > 0 Then
|
If i.RowCount > 0 Then
|
||||||
i.Position = 0
|
i.Position = 0
|
||||||
abordo = i.GetString("CAT_GP_ALMACEN")
|
abordo = i.GetString("CAT_GP_ALMACEN")
|
||||||
|
|||||||
@@ -888,7 +888,7 @@ Version=12.8
|
|||||||
#Region Project Attributes
|
#Region Project Attributes
|
||||||
#ApplicationLabel: Kelloggs Venta
|
#ApplicationLabel: Kelloggs Venta
|
||||||
#VersionCode: 3000
|
#VersionCode: 3000
|
||||||
#VersionName: 4.05.12
|
#VersionName: 4.05.14
|
||||||
#SupportedOrientations: portrait
|
#SupportedOrientations: portrait
|
||||||
#CanInstallToExternalStorage: False
|
#CanInstallToExternalStorage: False
|
||||||
#BridgeLogger:true
|
#BridgeLogger:true
|
||||||
|
|||||||
@@ -91,6 +91,6 @@ ModuleClosedNodes6=
|
|||||||
ModuleClosedNodes7=
|
ModuleClosedNodes7=
|
||||||
ModuleClosedNodes8=
|
ModuleClosedNodes8=
|
||||||
ModuleClosedNodes9=
|
ModuleClosedNodes9=
|
||||||
NavigationStack=C_Promos,B4XPage_Appear,70,0,C_Promos,b_terminar1_Click,490,0,C_Promos,revisaInvProdsVariables,456,0,C_Promos,muestraPromo,111,6,C_Promos,Class_Globals,0,0,C_Promos,et_promoCant_TextChanged,518,0,Promociones,traeListaDePromo,457,0,C_Clientes,Class_Globals,0,0,C_Productos,b_rechazar_Click,1004,0,C_Productos,lv_catalogos_ItemClick,304,0,C_Productos,PCLV_AddProds,279,0
|
NavigationStack=Subs,traeinventario,1780,1,C_Productos,l_prodX_Click,1093,6,C_Productos,CreateListItem,543,0,Subs,hayPedido,1566,0,C_Productos,Class_Globals,97,0,Subs,totalPedido,1569,0,C_Productos,b_prodMas_Click,708,6,C_Productos,b_prodMenos_Click,606,0,C_Productos,et_pCant_FocusChanged,797,0,C_Productos,et_pCant_TextChanged,733,6
|
||||||
SelectedBuild=0
|
SelectedBuild=0
|
||||||
VisibleModules=1,28,11,3,26,29,12,4,13
|
VisibleModules=1,28,11,3,26,29,12,4,13
|
||||||
|
|||||||
36
B4A/Subs.bas
36
B4A/Subs.bas
@@ -1573,6 +1573,7 @@ End Sub
|
|||||||
'Regresa el total del pedido en la tabla "PEDIDO" del cliente actual.
|
'Regresa el total del pedido en la tabla "PEDIDO" del cliente actual.
|
||||||
Sub totalPedido As String
|
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 cT As Cursor = Starter.skmt.ExecQuery($"select sum(PE_COSTO_TOT) as total from PEDIDO where PE_CLIENTE = '${traeCliente}'"$)
|
||||||
|
Log($"select sum(PE_COSTO_TOT) as total from PEDIDO where PE_CLIENTE = '${traeCliente}'"$)
|
||||||
Private pTotal As String = "0"
|
Private pTotal As String = "0"
|
||||||
If cT.RowCount > 0 Then
|
If cT.RowCount > 0 Then
|
||||||
cT.Position = 0
|
cT.Position = 0
|
||||||
@@ -1697,7 +1698,7 @@ Sub bitacora(fechab As String, usuariob As String, almacenb As String, rutab As
|
|||||||
Starter.skmt.ExecNonQuery($"INSERT INTO BITACORAGPS (fechab, usuariob , almacenb , rutab , eventob , clienteb , iniciob , finb , latitudb, longitudb , precision , motivonoventa , motivonovisita) VALUES ('${fechab}' ,'${usuariob}' , '${almacenb}' , '${rutab}' , '${eventob}' , '${clienteb}' , '${iniciob}' , '${finb}' , '${latitudb}' , '${longitudb}' , '${precision}' , '${motivonoventa}' , '${motivonovisita}')"$)
|
Starter.skmt.ExecNonQuery($"INSERT INTO BITACORAGPS (fechab, usuariob , almacenb , rutab , eventob , clienteb , iniciob , finb , latitudb, longitudb , precision , motivonoventa , motivonovisita) VALUES ('${fechab}' ,'${usuariob}' , '${almacenb}' , '${rutab}' , '${eventob}' , '${clienteb}' , '${iniciob}' , '${finb}' , '${latitudb}' , '${longitudb}' , '${precision}' , '${motivonoventa}' , '${motivonovisita}')"$)
|
||||||
Private cmd As DBCommand
|
Private cmd As DBCommand
|
||||||
cmd.Initialize
|
cmd.Initialize
|
||||||
If eventob <> "Termina Venta" Then
|
If eventob <> "Termina Venta" And eventob <> "No Venta" Then
|
||||||
cmd.Name = "mandaBitacora3"
|
cmd.Name = "mandaBitacora3"
|
||||||
Log("BITACORA3")
|
Log("BITACORA3")
|
||||||
Private nombreCliente As String = traeNombreCliente(clienteb)
|
Private nombreCliente As String = traeNombreCliente(clienteb)
|
||||||
@@ -1713,12 +1714,20 @@ Sub bitacora(fechab As String, usuariob As String, almacenb As String, rutab As
|
|||||||
Private e As Cursor = Starter.skmt.ExecQuery($"select fechab from BITACORAGPS where usuariob = '${usuariob}' and almacenb = '${almacenb}' and rutab = '${rutab}' and clienteb = '${clienteb}' and eventob = 'Inicia Venta' order by fechab desc"$)
|
Private e As Cursor = Starter.skmt.ExecQuery($"select fechab from BITACORAGPS where usuariob = '${usuariob}' and almacenb = '${almacenb}' and rutab = '${rutab}' and clienteb = '${clienteb}' and eventob = 'Inicia Venta' order by fechab desc"$)
|
||||||
If e.RowCount > 0 Then
|
If e.RowCount > 0 Then
|
||||||
e.Position = 0
|
e.Position = 0
|
||||||
Log("ACTUALIX¡ZA BITACORA")
|
Log("ACTUALIZA BITACORA")
|
||||||
cmd.Name = "actualizaSalidaBitacora"
|
If eventob = "Termina Venta" Then
|
||||||
' TMP_FINAL = to_date((?),'YYYY/MM/DD HH24:MI:ss') where TMP_RUTA = (?) and tmp_almacen = (?) and tmp_usuario = (?) and tmp_id_cliente = (?) and tmp_evento = (?) and tmp_fecha_movil = to_date((?),'YYYY/MM/DD HH24:MI:ss');
|
cmd.Name = "actualizaSalidaBitacora"
|
||||||
cmd.Parameters = Array As Object(finb, rutab, almacenb, usuariob, clienteb, "Inicia Venta", e.GetString("fechab"))
|
' TMP_FINAL = to_date((?),'YYYY/MM/DD HH24:MI:ss') where TMP_RUTA = (?) and tmp_almacen = (?) and tmp_usuario = (?) and tmp_id_cliente = (?) and tmp_evento = (?) and tmp_fecha_movil = to_date((?),'YYYY/MM/DD HH24:MI:ss');
|
||||||
Log($"${finb}, ${rutab}, ${almacenb}, ${usuariob}, ${clienteb}, 'Inicia Venta', ${e.GetString("fechab")}, "$)
|
cmd.Parameters = Array As Object(finb, rutab, almacenb, usuariob, clienteb, "Inicia Venta", e.GetString("fechab"))
|
||||||
Starter.reqManager.ExecuteCommand(cmd , "mandaBitacora")
|
Log($"${finb}, ${rutab}, ${almacenb}, ${usuariob}, ${clienteb}, 'Inicia Venta', ${e.GetString("fechab")}, "$)
|
||||||
|
Starter.reqManager.ExecuteCommand(cmd , "mandaBitacora")
|
||||||
|
else if eventob = "No Venta" Then
|
||||||
|
cmd.Name = "actualizaNoVentaBitacora"
|
||||||
|
' TMP_FINAL = to_date((?),'YYYY/MM/DD HH24:MI:ss') where TMP_RUTA = (?) and tmp_almacen = (?) and tmp_usuario = (?) and tmp_id_cliente = (?) and tmp_evento = (?) and tmp_fecha_movil = to_date((?),'YYYY/MM/DD HH24:MI:ss');
|
||||||
|
cmd.Parameters = Array As Object(finb, motivonoventa, motivonovisita, rutab, almacenb, usuariob, clienteb, "Inicia Venta", e.GetString("fechab"))
|
||||||
|
Log($"${finb}, ${rutab}, ${almacenb}, ${usuariob}, ${clienteb}, 'Inicia Venta', ${e.GetString("fechab")}, "$)
|
||||||
|
Starter.reqManager.ExecuteCommand(cmd , "mandaBitacora")
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Log("Mandamos bitacora")
|
Log("Mandamos bitacora")
|
||||||
@@ -1771,4 +1780,17 @@ Sub logJobDoneResultados(resultado As DBResult)
|
|||||||
LogColor(k & " = " & records(resultado.Columns.Get(k)), Colors.RGB(215,37,0))
|
LogColor(k & " = " & records(resultado.Columns.Get(k)), Colors.RGB(215,37,0))
|
||||||
Next
|
Next
|
||||||
Next
|
Next
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Sub traeinventario(id As String) As String
|
||||||
|
Dim c As Cursor
|
||||||
|
Dim inventario As String = "0"
|
||||||
|
c=Starter.skmt.ExecQuery($"select CAT_GP_ALMACEN from ${traeTablaProds(Starter.tipov)} 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
|
End Sub
|
||||||
Reference in New Issue
Block a user