mirror of
https://github.com/KeymonSoft/Durakelo.git
synced 2026-04-20 20:59:26 +00:00
31/10/23 - Cambios en Cliente, Productos y Nota
- Se amplió el campo de la cantidad cuando se agrega un producto. - Se agregó que mande un Toast cuando se hace clic en Back en Cliente para que avise que hay que hacer clic en "Guardar" - Se corrigieron las acciones cuando se hace Back en algunas pantallas. - Se puso código para que en nota muestre de diferente color los productos de Venta y Preventa.
This commit is contained in:
@@ -540,7 +540,7 @@ Sub b_prodMenos_Click
|
||||
' clv_prods_ll.GetValue(index).As(Map).Get("almacen") = clv_prods_ll.GetValue(index).As(Map).Get("almacen") + 1
|
||||
End If
|
||||
If laCant.Text = "" Then laCant.Text = 0
|
||||
laCant.Text = $"$1.0{laCant.Text - 1}"$
|
||||
laCant.Text = $"${NumberFormat2((laCant.Text - 1), 1, 0, 0, False)}"$
|
||||
If laCant.Text < 0 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")
|
||||
@@ -559,6 +559,7 @@ Sub b_prodMenos_Click
|
||||
nombreX = "CAMBIO"&Subs.traeRMINombre(id)
|
||||
precioX = precioX * -1
|
||||
End If
|
||||
Log(">>>>>>> Insertamos prod desde prodMenos")
|
||||
Subs.actualizaProducto(almacenX, precioX, laCant.text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
||||
cuentaProds
|
||||
If Subs.totalPedido < 1 Then laCant.Text = "0"
|
||||
@@ -582,16 +583,16 @@ Sub b_prodMas_Click
|
||||
' 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
|
||||
else If laCant.Text + 1 <= inv And lfila.Text = "PRODUCTOS" Then
|
||||
' LogColor(inv, Colors.blue)
|
||||
laCant.Text = $"$1.0{laCant.Text + 1}"$
|
||||
laCant.Text = $"${NumberFormat2((laCant.Text + 1), 1, 0, 0, False)}"$
|
||||
Log(Subs.totalPedido)
|
||||
else If lfila.Text = "RMI" And laCant.Text + 1 <= inv And (Subs.totalPedido - precio > 1) Then
|
||||
' LogColor(inv, Colors.blue)
|
||||
laCant.Text = $"$1.0{laCant.Text + 1}"$
|
||||
laCant.Text = $"${NumberFormat2((laCant.Text + 1), 1, 0, 0, False)}"$
|
||||
Log(Subs.totalPedido)
|
||||
else if Subs.totalPedido < 1 Then
|
||||
laCant.Text = "0"
|
||||
@@ -605,6 +606,7 @@ Sub b_prodMas_Click
|
||||
nombreX = "CAMBIO"&Subs.traeRMINombre(id)
|
||||
precioX = precioX * -1
|
||||
End If
|
||||
Log(">>>>>>> Insertamos prod desde prodMas")
|
||||
Subs.actualizaProducto(almacenX, precioX, laCant.text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
||||
cuentaProds
|
||||
If Subs.totalPedido < 1 Then
|
||||
@@ -616,6 +618,24 @@ Sub b_prodMas_Click
|
||||
' Log($"Total Prods: ${totalProds}, Total Compra: $$1.2{totalCompra}"$)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub et_pCant_FocusChanged (HasFocus As Boolean)
|
||||
' LogColor($"focus changed=${HasFocus}"$, Colors.Magenta)
|
||||
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)
|
||||
' Log("%%%%%%%%%%%%%%%% - " & Sender.As(EditText).text)
|
||||
Try
|
||||
If Sender.As(EditText).Text = "" Then Sender.As(EditText).Text = "0"
|
||||
Sender.As(EditText).Text = $"${NumberFormat2(Sender.As(EditText).Text, 1, 0, 0, False)}"$
|
||||
cuentaProds
|
||||
Catch
|
||||
Log(LastException)
|
||||
End Try
|
||||
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
|
||||
@@ -627,18 +647,19 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
|
||||
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)
|
||||
' Log(clv_prods_ll.GetValue(index).As(Map))
|
||||
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")
|
||||
Log("++++++++++ " & precio)
|
||||
' Log("++++++++++ " & precio)
|
||||
Dim tempTot As String = Subs.totalPedido
|
||||
Dim disp As String = 0
|
||||
If tempTot > 0 Then disp = (Subs.totalPedido / precio) - 1
|
||||
disp = NumberFormat2(disp, 1, 0, 0, False)
|
||||
|
||||
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")
|
||||
If(New = "" Or New = Null) Then New = 0
|
||||
' If(New = "" Or New = Null) Then New = 0
|
||||
If(New > inv) Then
|
||||
Sender.As(EditText).text = inv
|
||||
End If
|
||||
@@ -654,17 +675,18 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
|
||||
' elProd = Subs.traeProdNombre(id)
|
||||
Log("NO RMI")
|
||||
End If
|
||||
' Log($"inventario=${inv}"$)
|
||||
' Dim tmpCant As String = laCant.text
|
||||
' Log($"inventario=${inv}"$)
|
||||
' Dim tmpCant As String = laCant.text
|
||||
If laCant.Text = "" Then laCant.Text = "0"
|
||||
If laCant.Text > disp Then
|
||||
Log($"Ponemos laCant en: ${disp}"$)
|
||||
' laCant.Text = ""
|
||||
laCant.text = "0"
|
||||
' etCantHasFocus = True
|
||||
End If
|
||||
' If laCant.Text > disp Then
|
||||
' Log($"Ponemos laCant en: ${disp}"$)
|
||||
'' laCant.Text = ""
|
||||
' laCant.text = "0"
|
||||
'' etCantHasFocus = True
|
||||
' 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, B4XPages.MainPage.tipo_venta)
|
||||
Log(">>>>>> Insertamos prod desde et_pCante_TextChanged")
|
||||
Subs.actualizaProducto(almacenX, precioX, laCant.Text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
|
||||
cuentaProds
|
||||
End If
|
||||
Catch
|
||||
@@ -679,12 +701,6 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub et_pCant_FocusChanged (HasFocus As Boolean)
|
||||
' LogColor($"focus changed=${HasFocus}"$, Colors.Magenta)
|
||||
etCantHasFocus = HasFocus
|
||||
cuentaProds
|
||||
End Sub
|
||||
|
||||
Sub cuentaProds
|
||||
'LogColor($"Productos de la orden: ${c_prodsX.GetString("cantProds")}, Total: ${c_prodsX.GetString("costoTotal")}"$, Colors.red)
|
||||
' Log("===========================")
|
||||
@@ -1121,7 +1137,7 @@ Sub Busca_TextChanged (Old As String, New As String)
|
||||
listaProds.Initialize
|
||||
listaHints.Initialize
|
||||
Sleep(0)
|
||||
Dim p As ResultSet = Starter.skmt.ExecQuery($"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD from CAT_GUNAPROD2 where CAT_GP_NOMBRE like '%${New}%' and CAT_GP_PRECIO > 0 AND CAT_GP_ALMACEN > 0 and CAT_GP_CLASIF <> 'PROMOS' order by CAT_GP_NOMBRE"$)
|
||||
Dim p As ResultSet = Starter.skmt.ExecQuery($"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD from ${query} where CAT_GP_NOMBRE like '%${New}%' and CAT_GP_PRECIO > 0 AND CAT_GP_ALMACEN > 0 and CAT_GP_CLASIF <> 'PROMOS' order by CAT_GP_NOMBRE"$)
|
||||
' c2= Starter.skmt.ExecQuery2("select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_PRECIO, CAT_GP_ALMACEN, CAT_GP_IMG from " & query & " where CAT_GP_ALMACEN > 0 AND CAT_GP_TIPO = ? AND CAT_GP_SUBTIPO =? AND CAT_GP_TIPOPROD <> 1 and (length(CAT_GP_CODPROMO) = 1 OR CAT_GP_CODPROMO = CAT_GP_ID) ", Array As String( Value, Value)
|
||||
Log("Llamamos LlenaProdsLL")
|
||||
LlenaProdsLL(p, Null)
|
||||
|
||||
Reference in New Issue
Block a user