This commit is contained in:
cvaldes1201
2024-05-16 17:44:55 -06:00
parent eeabd06043
commit 4ce1784e7c
2 changed files with 28 additions and 11 deletions

View File

@@ -661,6 +661,9 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
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=Subs.traeinventario(id) Private inv As String=Subs.traeinventario(id)
Private nombreX As String = Subs.traeProdNombre(id) Private nombreX As String = Subs.traeProdNombre(id)
If(New = "" Or New = Null Or New = "-") Then New = 0 If(New = "" Or New = Null Or New = "-") Then New = 0
' If New < 0 Then New = 0 ' If New < 0 Then New = 0
If(New > invTotal) Then If(New > invTotal) Then
@@ -668,23 +671,37 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
End If End If
' Log($"inventario=${inv}"$) ' Log($"inventario=${inv}"$)
If New = "" Then New = 0
If laCant.Text = "" Then laCant.Text = 0
If Not(Old = "0" And New = "") And laCant.Text <> Null And laCant.Text <> "" And etCantHasFocus Then
Log("actualizamos producto")
Subs.actualizaProducto(Subs.traeAlmacen, precio, laCant.text, Subs.traeProdNombre(id), id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta)
cuentaProds
End If
' If New <> "" And New.SubString2(0,0) = "0" Then
' New.SubString(1)
' End If
' If New <> "" And New.SubString(1) <> "" Then
' Log(New.SubString(1))
' New = New.SubString(1)
' laCant.Text = New.SubString(1)
' Log(laCant.Text)
' End If
If 1 = 1 Then If 1 = 1 Then
Private cs As CSBuilder Private cs As CSBuilder
cs.Initialize cs.Initialize
Private o As Cursor = Starter.skmt.ExecQuery($"select CAT_GP_ALMACEN from ${Starter.tabla} where CAT_GP_ID = '${id}'"$) Private o As Cursor = Starter.skmt.ExecQuery($"select CAT_GP_ALMACEN from ${Starter.tabla} where CAT_GP_ID = '${id}'"$)
Private invActualizado As String = "0" Private invActualizado As String = "0"
If o.RowCount > 0 Then ' If o.RowCount > 0 Then
o.Position = 0 o.Position = 0
invActualizado = o.GetString("CAT_GP_ALMACEN") invActualizado = Subs.traeinventario(id)
End If Log(Subs.traeinventario(id))
If 2 = 2 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
' Log(lProdX.Text)
End If
If Not(Old = "0" And New = "") And laCant.Text <> Null And laCant.Text <> "" And etCantHasFocus Then If New = "" Then New = 0
Log("actualizamos producto") lProdX.Text = cs.Color(Colors.red).append(nombreX).pop.Append(CRLF).Append("Existencias: " & (Subs.traeinventario(id))).Color(0xFF017F01).Append($" $${NumberFormat2(precio, 1, 2, 2, False)}"$).Popall
Subs.actualizaProducto(Subs.traeAlmacen, precio, laCant.text, Subs.traeProdNombre(id), id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, B4XPages.MainPage.tipo_venta)
cuentaProds
End If End If
End If End If
End Sub End Sub

View File

@@ -85,6 +85,6 @@ ModuleClosedNodes6=
ModuleClosedNodes7= ModuleClosedNodes7=
ModuleClosedNodes8= ModuleClosedNodes8=
ModuleClosedNodes9= ModuleClosedNodes9=
NavigationStack=Subs,actualizaProducto,774,1,C_Cliente,MODS,0,0,Subs,guardaProductoSinGestion,770,0,Subs,traeTotalCliente,815,2,C_Principal,Class_Globals,0,0,C_Principal,P_RESUMEN_click,2165,0,Subs,traeTotalClientepreventa,831,1,Subs,traeTotalClienteabordo,817,2,Subs,traeTotalClienteventa,845,0,C_Principal,resdia_Click,2267,5 NavigationStack=C_Principal,resdia_Click,2267,5,C_Cliente,MODS,1,0,C_Productos,Class_Globals,1,0,Subs,actualizaProducto,777,0,C_Productos,et_pCant_FocusChanged,626,0,C_Productos,b_continuar_Click,792,0,C_Productos,clv_prods_ll_VisibleRangeChanged,999,0,C_Productos,b_prodMas_Click,572,0,C_Productos,cuentaProds,710,0,C_Productos,et_pCant_TextChanged,675,6
SelectedBuild=0 SelectedBuild=0
VisibleModules=2,26,13,16,14,4,27,15,9,6 VisibleModules=2,26,13,16,14,4,27,15,9,6