- VERSION 5.03.25

- Se corrigio un error en productos cuando se modiifcaba la cantidad directamente.
This commit is contained in:
2025-03-28 13:19:06 -06:00
parent 48c0a9294c
commit 7211852abf
4 changed files with 33 additions and 29 deletions

View File

@@ -634,16 +634,18 @@ Sub b_prodMas_Click
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)
Dim lProdX As B4XView = pnl.GetView(1) Dim lProdX As B4XView = pnl.GetView(1)
' Log("========= " & pnl0.Tag) Log("========= " & pnl0.Tag)
' Log("========= " & pnl.Tag) Log("========= " & pnl.Tag)
' Log("========= " & pnl.GetView(1).Tag) Log("========= " & pnl.GetView(1).Tag)
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($"Existencias: ${existencias}"$)
Dim laCant As B4XView = pnl.GetView(2).GetView(2) Dim laCant As B4XView = pnl.GetView(2).GetView(2)
If laCant.Text = "" Then laCant.Text = 0 If laCant.Text = "" Then laCant.Text = 0
Private tmpMap As Map = clv_prods_ll.GetValue(index).As(Map) 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 precio As String=clv_prods_ll.GetValue(index).As(Map).Get("precio")
Private inv As Int = clv_prods_ll.GetValue(index).As(Map).Get("almacen") Private inv As Int = clv_prods_ll.GetValue(index).As(Map).Get("almacen")
Log($"Existencias: ${inv}, inv: ${Subs.traeinventario(pnl.GetView(1).Tag)}"$)
inv = Subs.traeinventario(pnl.GetView(1).Tag)
Private iq As Cursor = Starter.skmt.ExecQuery($"select cat_gp_almacen from ${Subs.traeTablaProds(Starter.tipov)} where cat_gp_id = '${clv_prods_ll.GetValue(index).As(Map).Get("id")}'"$) Private iq As Cursor = Starter.skmt.ExecQuery($"select cat_gp_almacen from ${Subs.traeTablaProds(Starter.tipov)} where cat_gp_id = '${clv_prods_ll.GetValue(index).As(Map).Get("id")}'"$)
If iq.RowCount > 0 Then If iq.RowCount > 0 Then
@@ -689,7 +691,10 @@ Sub b_prodMas_Click
nombreX = "CAMBIO"&Subs.traeRMINombre(id) nombreX = "CAMBIO"&Subs.traeRMINombre(id)
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)
Log($"Existencias: ${inv}, inv: ${Subs.traeinventario(pnl.GetView(1).Tag)}"$)
Log($"TotalPedido: ${NumberFormat2(kh.totalPedido,1,2,2,False)}"$) Log($"TotalPedido: ${NumberFormat2(kh.totalPedido,1,2,2,False)}"$)
If kh.totalPedido < 0.01 Then If kh.totalPedido < 0.01 Then
etCantHasFocus = False etCantHasFocus = False
@@ -737,7 +742,6 @@ Sub b_prodMas_Click
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)
' LogColor($"txt changed: ${Old}|${New}, hasfocus=${etCantHasFocus}"$,Colors.Magenta)
' If Not(Old = "0" And New = "") And etCantHasFocus Then cuentaProds ' If Not(Old = "0" And New = "") And etCantHasFocus Then cuentaProds
If etCantHasFocus = True Then If etCantHasFocus = True Then
Try Try
@@ -745,9 +749,11 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
Dim index As Int = clv_prods_ll.GetItemFromView(Sender) Dim index As Int = clv_prods_ll.GetItemFromView(Sender)
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")
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")
existencias = Subs.traeinventario(id)
Log($"Existencias: ${Subs.traeinventario(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")
Log("++++++++++ " & precio) Log("++++++++++ " & precio)
Dim tempTot As String = kh.totalPedido Dim tempTot As String = kh.totalPedido
@@ -756,12 +762,15 @@ 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: ${laCant.text}, Precio: ${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")
If(New = "" Or New = Null) Then New = 0 If(New = "" Or New = Null) Then New = 0
If(New > invTotal) Then Log($"Nuevo: ${New}, InvTotal: ${invTotal}"$)
Sender.As(EditText).text = invTotal ' If(New >= invTotal) Then
End If ' Log("Se pasa!!")
' etCantHasFocus = False
' Sender.As(EditText).text = invTotal
' 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)
Private precioX As String = precio Private precioX As String = precio
@@ -771,38 +780,33 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
precioX = precioX * -1 precioX = precioX * -1
Log("RMI") Log("RMI")
Else Else
' elProd = Subs.traeProdNombre(id) ' elProd = Subs.traeProdNombre(id)
Log("NO RMI") Log("NO RMI")
End If End If
' Log($"inventario=${inv}"$) ' Log($"inventario=${inv}"$)
' Dim tmpCant As String = laCant.text ' Dim tmpCant As String = laCant.text
If laCant.Text = "" Then laCant.Text = "0" If laCant.Text = "" Then laCant.Text = "0"
Log("======== " & Sender.As(EditText).text & "|" & laCant.text & "|" & New & "|" & existencias) Log("======== laCant: " & Sender.As(EditText).text & " | New: " & New & " | Existencias: " & existencias & " ========")
If laCant.Text > existencias Or New > existencias Then If laCant.Text > invTotal Or New > invTotal Then
Log(888) Log("Se pasa!!")
Log($"Ponemos laCant en: ${existencias}"$) Log($"Ponemos laCant en: ${invTotal}"$)
' laCant.Text = "" laCant.text = invTotal
laCant.text = existencias
Log($">>>>> LACANT=${laCant.Text}"$)
' etCantHasFocus = True ' etCantHasFocus = True
End If End If
' If New < existencias Then
Log(999)
Private limCred As Double = kh.traeLimiteCredito(Subs.traeCliente) Private limCred As Double = kh.traeLimiteCredito(Subs.traeCliente)
' Log($"${NumberFormat(limCred,1,2)} < ${kh.totalPedido + (precio*laCant.text)}"$) ' Log($"${NumberFormat(limCred,1,2)} < ${kh.totalPedido + (precio*laCant.text)}"$)
' Log(NumberFormat2(limCred,1,0,0,False)) ' Log(NumberFormat2(limCred,1,0,0,False))
' limCred = NumberFormat2(limCred,1,0,0,False) ' limCred = NumberFormat2(limCred,1,0,0,False)
Log((kh.totalPedido + (precio*laCant.text))) Log("TotalPedido + actual: " &( kh.totalPedido + (precio*laCant.text)))
Log("|" & (limCred < (kh.totalPedido + (precio*laCant.text))) & "|") Log("| Limite de crédito superado: " & (limCred < (kh.totalPedido + (precio*laCant.text))) & " |")
If limCred < (kh.totalPedido + (precio*laCant.text)) Then If limCred < (kh.totalPedido + (precio*laCant.text)) Then
Log($"#######################${CRLF}#### LIMITE CREDITO SUPERADO${CRLF}#######################"$) Log($"#######################${CRLF}#### LIMITE CREDITO SUPERADO${CRLF}#######################"$)
ToastMessageShow("LIMITE DE CREDITO SUPERADO", False) ToastMessageShow("LIMITE DE CREDITO SUPERADO", False)
laCant.text = 0 laCant.text = 0
Else ' Else
Log("#### LIMITE DE CREDITO") ' Log("#### LIMITE DE CREDITO")
End If End If
' End If
' If Not(Old = "0" And New = "") And laCant.Text <> Null And laCant.Text <> "" And etCantHasFocus Then ' If Not(Old = "0" And New = "") And laCant.Text <> Null And laCant.Text <> "" And etCantHasFocus Then
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)

View File

@@ -907,7 +907,7 @@ Version=12.8
#Region Project Attributes #Region Project Attributes
#ApplicationLabel: Kelloggs Venta #ApplicationLabel: Kelloggs Venta
#VersionCode: 3000 #VersionCode: 3000
#VersionName: 5.03.20 #VersionName: 5.03.25
#SupportedOrientations: portrait #SupportedOrientations: portrait
#CanInstallToExternalStorage: False #CanInstallToExternalStorage: False
#BridgeLogger:true #BridgeLogger:true

View File

@@ -91,6 +91,6 @@ ModuleClosedNodes6=
ModuleClosedNodes7= ModuleClosedNodes7=
ModuleClosedNodes8= ModuleClosedNodes8=
ModuleClosedNodes9= ModuleClosedNodes9=
NavigationStack=Subs,bitacora,1714,0,C_Principal,JobDone,2095,1,Main,Globals,30,0,C_Cliente,Class_Globals,0,0,C_Cliente,B4XPage_Appear,488,1,foto,Globals,25,0,foto,Camera1_Ready,47,0,foto,btnTakePicture_Click,169,0,foto,b_guardar_Click,158,0,Main,Activity_Create,32,0 NavigationStack=foto,btnTakePicture_Click,166,0,Main,Process_Globals,21,0,C_Cliente,B4XPage_Appear,758,1,Subs,revisaPromoPorMonto,1928,0,Subs,generaGUID_EnExterno,1912,0,Subs,parseHTTPError,1924,0,Subs,revisaHora,1960,0,C_Productos,b_prodMenos_Click,617,0,C_Productos,b_prodMas_Click,639,6,C_Productos,et_pCant_TextChanged,748,6,C_Productos,et_pCant_FocusChanged,846,0
SelectedBuild=0 SelectedBuild=0
VisibleModules=1,28,11,3,29,12,7,9,22 VisibleModules=1,28,11,3,29,12,7,9

View File

@@ -1964,7 +1964,7 @@ Sub revisaHora As Boolean
Private hr As Int = h.GetString("CAT_VA_VALOR") Private hr As Int = h.GetString("CAT_VA_VALOR")
DateTime.DateFormat = "HH" DateTime.DateFormat = "HH"
Private ahora As String = DateTime.Date(DateTime.Now) Private ahora As String = DateTime.Date(DateTime.Now)
Log($"${hr} >= ${(ahora - 2)} and ${hr} <= ${(ahora + 2)}"$) ' Log($"${hr} >= ${(ahora - 2)} and ${hr} <= ${(ahora + 2)}"$)
If hr >= ahora - 2 And hr <= ahora + 2 Then If hr >= ahora - 2 And hr <= ahora + 2 Then
horaCorrecta = True horaCorrecta = True
End If End If