diff --git a/B4A/C_Productos.bas b/B4A/C_Productos.bas index ae3ca42..eae901a 100644 --- a/B4A/C_Productos.bas +++ b/B4A/C_Productos.bas @@ -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=Subs.traeinventario(id) Private nombreX As String = Subs.traeProdNombre(id) + + + If(New = "" Or New = Null Or New = "-") Then New = 0 ' If New < 0 Then New = 0 If(New > invTotal) Then @@ -668,23 +671,37 @@ Private Sub et_pCant_TextChanged (Old As String, New As String) End If ' 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 Private cs As CSBuilder cs.Initialize Private o As Cursor = Starter.skmt.ExecQuery($"select CAT_GP_ALMACEN from ${Starter.tabla} where CAT_GP_ID = '${id}'"$) Private invActualizado As String = "0" - If o.RowCount > 0 Then +' If o.RowCount > 0 Then o.Position = 0 - invActualizado = o.GetString("CAT_GP_ALMACEN") - End If - 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 -' Log(lProdX.Text) - End If + invActualizado = Subs.traeinventario(id) + Log(Subs.traeinventario(id)) +' End If - 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 + If New = "" Then New = 0 + 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 End If End If End Sub diff --git a/B4A/INTMEX.b4a.meta b/B4A/INTMEX.b4a.meta index a0d7713..05a5b76 100644 --- a/B4A/INTMEX.b4a.meta +++ b/B4A/INTMEX.b4a.meta @@ -85,6 +85,6 @@ ModuleClosedNodes6= ModuleClosedNodes7= ModuleClosedNodes8= 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 VisibleModules=2,26,13,16,14,4,27,15,9,6