mirror of
https://github.com/KeymonSoft/Kelloggs_v4.git
synced 2026-04-19 19:19:14 +00:00
- VERSION 5.03.25
- Se corrigio un error en productos cuando se modiifcaba la cantidad directamente.
This commit is contained in:
@@ -634,16 +634,18 @@ Sub b_prodMas_Click
|
||||
Dim pnl0 As B4XView = clv_prods_ll.GetPanel(index)
|
||||
Dim pnl As B4XView = pnl0.GetView(0)
|
||||
Dim lProdX As B4XView = pnl.GetView(1)
|
||||
' Log("========= " & pnl0.Tag)
|
||||
' Log("========= " & pnl.Tag)
|
||||
' Log("========= " & pnl.GetView(1).Tag)
|
||||
Log("========= " & pnl0.Tag)
|
||||
Log("========= " & pnl.Tag)
|
||||
Log("========= " & pnl.GetView(1).Tag)
|
||||
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)
|
||||
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 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")}'"$)
|
||||
If iq.RowCount > 0 Then
|
||||
@@ -689,7 +691,10 @@ Sub b_prodMas_Click
|
||||
nombreX = "CAMBIO"&Subs.traeRMINombre(id)
|
||||
precioX = precioX * -1
|
||||
End If
|
||||
|
||||
|
||||
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)}"$)
|
||||
If kh.totalPedido < 0.01 Then
|
||||
etCantHasFocus = False
|
||||
@@ -737,7 +742,6 @@ Sub b_prodMas_Click
|
||||
End Sub
|
||||
|
||||
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 etCantHasFocus = True Then
|
||||
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 pnl0 As B4XView = clv_prods_ll.GetPanel(index)
|
||||
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)
|
||||
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")
|
||||
Log("++++++++++ " & precio)
|
||||
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)
|
||||
If existencias = "" Then existencias = 0
|
||||
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")
|
||||
If(New = "" Or New = Null) Then New = 0
|
||||
If(New > invTotal) Then
|
||||
Sender.As(EditText).text = invTotal
|
||||
End If
|
||||
Log($"Nuevo: ${New}, InvTotal: ${invTotal}"$)
|
||||
' If(New >= invTotal) Then
|
||||
' Log("Se pasa!!")
|
||||
' etCantHasFocus = False
|
||||
' Sender.As(EditText).text = invTotal
|
||||
' End If
|
||||
Private almacenX As String = Subs.traeAlmacen
|
||||
Private nombreX As String = Subs.traeProdNombre(id)
|
||||
Private precioX As String = precio
|
||||
@@ -771,38 +780,33 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
|
||||
precioX = precioX * -1
|
||||
Log("RMI")
|
||||
Else
|
||||
' elProd = Subs.traeProdNombre(id)
|
||||
' elProd = Subs.traeProdNombre(id)
|
||||
Log("NO RMI")
|
||||
End If
|
||||
' Log($"inventario=${inv}"$)
|
||||
' Dim tmpCant As String = laCant.text
|
||||
If laCant.Text = "" Then laCant.Text = "0"
|
||||
Log("======== " & Sender.As(EditText).text & "|" & laCant.text & "|" & New & "|" & existencias)
|
||||
If laCant.Text > existencias Or New > existencias Then
|
||||
Log(888)
|
||||
Log($"Ponemos laCant en: ${existencias}"$)
|
||||
' laCant.Text = ""
|
||||
laCant.text = existencias
|
||||
Log($">>>>> LACANT=${laCant.Text}"$)
|
||||
Log("======== laCant: " & Sender.As(EditText).text & " | New: " & New & " | Existencias: " & existencias & " ========")
|
||||
If laCant.Text > invTotal Or New > invTotal Then
|
||||
Log("Se pasa!!")
|
||||
Log($"Ponemos laCant en: ${invTotal}"$)
|
||||
laCant.text = invTotal
|
||||
' etCantHasFocus = True
|
||||
End If
|
||||
|
||||
' If New < existencias Then
|
||||
Log(999)
|
||||
Private limCred As Double = kh.traeLimiteCredito(Subs.traeCliente)
|
||||
' Log($"${NumberFormat(limCred,1,2)} < ${kh.totalPedido + (precio*laCant.text)}"$)
|
||||
' Log(NumberFormat2(limCred,1,0,0,False))
|
||||
' limCred = NumberFormat2(limCred,1,0,0,False)
|
||||
Log((kh.totalPedido + (precio*laCant.text)))
|
||||
Log("|" & (limCred < (kh.totalPedido + (precio*laCant.text))) & "|")
|
||||
Log("TotalPedido + actual: " &( 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
|
||||
Log($"#######################${CRLF}#### LIMITE CREDITO SUPERADO${CRLF}#######################"$)
|
||||
ToastMessageShow("LIMITE DE CREDITO SUPERADO", False)
|
||||
laCant.text = 0
|
||||
Else
|
||||
Log("#### LIMITE DE CREDITO")
|
||||
' Else
|
||||
' Log("#### LIMITE DE CREDITO")
|
||||
End If
|
||||
' End If
|
||||
|
||||
' 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)
|
||||
|
||||
@@ -907,7 +907,7 @@ Version=12.8
|
||||
#Region Project Attributes
|
||||
#ApplicationLabel: Kelloggs Venta
|
||||
#VersionCode: 3000
|
||||
#VersionName: 5.03.20
|
||||
#VersionName: 5.03.25
|
||||
#SupportedOrientations: portrait
|
||||
#CanInstallToExternalStorage: False
|
||||
#BridgeLogger:true
|
||||
|
||||
@@ -91,6 +91,6 @@ ModuleClosedNodes6=
|
||||
ModuleClosedNodes7=
|
||||
ModuleClosedNodes8=
|
||||
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
|
||||
VisibleModules=1,28,11,3,29,12,7,9,22
|
||||
VisibleModules=1,28,11,3,29,12,7,9
|
||||
|
||||
@@ -1964,7 +1964,7 @@ Sub revisaHora As Boolean
|
||||
Private hr As Int = h.GetString("CAT_VA_VALOR")
|
||||
DateTime.DateFormat = "HH"
|
||||
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
|
||||
horaCorrecta = True
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user