30/11/23 - Cambios para limite abordo.

- Se agregó codigo para que si se modifica la cantidad diractamente (sin botones de mas/menos) se respete el limite de abordo
This commit is contained in:
2023-11-30 12:15:58 -06:00
parent 128855a742
commit 528847606f
6 changed files with 22 additions and 12 deletions

View File

@@ -611,10 +611,6 @@ Sub b_prodMas_Click
laCant.Text = NumberFormat2((laCant.Text + 1), 1, 0, 0, False) laCant.Text = NumberFormat2((laCant.Text + 1), 1, 0, 0, False)
Log(clv_prods_ll.GetValue(index).As(Map)) Log(clv_prods_ll.GetValue(index).As(Map))
End If End If
dispAbordo = NumberFormat2((kh.traeLimiteAbordoWeb - (kh.traeLimiteAbordoXInventario - kh.traeVenta) - kh.traeVentaAbordo), 0, 2, 2, False)
If dispAbordo < 1 Then
laCant.Text = NumberFormat2((laCant.Text - 1), 1, 0, 0, False)
End If
else If laCant.Text + 1 <= inv And lfila.Text = "PRODUCTOS" Then else If laCant.Text + 1 <= inv And lfila.Text = "PRODUCTOS" Then
LogColor(inv, Colors.blue) LogColor(inv, Colors.blue)
' laCant.Text = $"$1.0{laCant.Text + 1}"$ ' laCant.Text = $"$1.0{laCant.Text + 1}"$
@@ -644,6 +640,13 @@ Sub b_prodMas_Click
laCant.Text = "0" laCant.Text = "0"
et_pCant_TextChanged(100, 0) et_pCant_TextChanged(100, 0)
End If End If
dispAbordo = NumberFormat2((kh.traeLimiteAbordoWeb - (kh.traeLimiteAbordoXInventario - kh.traeVenta) - kh.traeVentaAbordo), 0, 2, 2, False)
If Subs.traeCliente = 0 And dispAbordo < 1 Then
Log("######### "& NumberFormat2((kh.traeLimiteAbordoWeb - (kh.traeLimiteAbordoXInventario - kh.traeVenta) - kh.traeVentaAbordo), 0, 2, 2, False))
laCant.Text = NumberFormat2((laCant.Text - 1), 1, 0, 0, False)
Subs.actualizaProducto(almacenX, precioX, laCant.text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
Log("######### "& NumberFormat2((kh.traeLimiteAbordoWeb - (kh.traeLimiteAbordoXInventario - kh.traeVenta) - kh.traeVentaAbordo), 0, 2, 2, False))
End If
cuentaProds cuentaProds
Log($"Total Prods: ${totalProds}, Total Compra: $$1.2{totalCompra}"$) Log($"Total Prods: ${totalProds}, Total Compra: $$1.2{totalCompra}"$)
End Sub End Sub
@@ -651,7 +654,6 @@ 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) ' 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
' LogColor($"txt changed: ${Old}|${New}, hasfocus=${etCantHasFocus}"$,Colors.Magenta) ' LogColor($"txt changed: ${Old}|${New}, hasfocus=${etCantHasFocus}"$,Colors.Magenta)
@@ -701,6 +703,14 @@ Private Sub et_pCant_TextChanged (Old As String, New As String)
' 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)
' End If ' End If
Log("REVISAMOS ABORDO DISP")
dispAbordo = NumberFormat2((kh.traeLimiteAbordoWeb - (kh.traeLimiteAbordoXInventario - kh.traeVenta) - kh.traeVentaAbordo), 0, 2, 2, False)
If Subs.traeCliente = 0 And dispAbordo < 1 Then
Log("######### "& NumberFormat2((kh.traeLimiteAbordoWeb - (kh.traeLimiteAbordoXInventario - kh.traeVenta) - kh.traeVentaAbordo), 0, 2, 2, False))
laCant.Text = NumberFormat2(Old, 1, 0, 0, False)
Subs.actualizaProducto(almacenX, precioX, laCant.text, nombreX, id, clienteId, Subs.traeFecha, Subs.traeUsuarioDeBD, rutaUsuario, 0, Starter.tipov)
Log("######### "& NumberFormat2((kh.traeLimiteAbordoWeb - (kh.traeLimiteAbordoXInventario - kh.traeVenta) - kh.traeVentaAbordo), 0, 2, 2, False))
End If
Catch Catch
Log(LastException) Log(LastException)
End Try End Try
@@ -1085,7 +1095,7 @@ Private Sub clv_prods_ll_VisibleRangeChanged (FirstIndex As Int, LastIndex As In
b_prodMenos.Tag = "vendido" b_prodMenos.Tag = "vendido"
b_prodMas.Tag = "vendido" b_prodMas.Tag = "vendido"
If Subs.revisaImpresa Then If Subs.revisaImpresa Then
Log("YA IMPRESO") ' Log("YA IMPRESO")
et_pCant.Enabled = False et_pCant.Enabled = False
' b_prodMas.Enabled = False ' b_prodMas.Enabled = False
b_prodMenos.Enabled = False b_prodMenos.Enabled = False
@@ -1180,7 +1190,7 @@ Sub LlenaProdsLL(p As ResultSet, extra As String)
Else Else
' Log("NO HAY RESULTSET") ' Log("NO HAY RESULTSET")
Dim p As ResultSet = Starter.skmt.ExecQuery($"select CAT_GP_ID, CAT_GP_NOMBRE, CAT_GP_ALMACEN, CAT_GP_PRECIO, CAT_GP_TIPOPROD from ${Subs.traeTablaProds(Starter.tipov)} where CAT_GP_PRECIO > 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 ${Subs.traeTablaProds(Starter.tipov)} where CAT_GP_PRECIO > 0 And CAT_GP_CLASIF <> 'PROMOS' order by CAT_GP_NOMBRE"$)
Log(p.RowCount & " - " & Subs.traeTablaProds(Starter.tipov)) ' Log(p.RowCount & " - " & Subs.traeTablaProds(Starter.tipov))
End If End If
Do While p.NextRow Do While p.NextRow

Binary file not shown.

Binary file not shown.

View File

@@ -870,7 +870,7 @@ Version=12.5
#Region Project Attributes #Region Project Attributes
#ApplicationLabel: Kelloggs Venta #ApplicationLabel: Kelloggs Venta
#VersionCode: 3000 #VersionCode: 3000
#VersionName: 3.11.23 PRUEBA V4 #VersionName: 3.11.29 PRUEBA V4
#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=kms_helperSubs,RD_restaura_cat_rmi,400,2,Visual Designer,cliente.bal,-100,1,C_Cliente,B4XPage_Appear,463,0,C_Principal,B4XPage_Appear,266,2,kms_helperSubs,respaldoBatch,401,0,C_Cliente,Guardar_Click,871,6,C_Principal,e_ruta_EnterPressed,2030,0,C_Principal,B4XPage_Created,252,0,C_Cliente,B4XPage_Created,301,0,C_Cliente,Initialize,285,0 NavigationStack=C_Productos,LlenaProdsLL,1181,0,Visual Designer,cliente.bal,-100,1,Visual Designer,checklist.bal,-100,1,Visual Designer,checks.bal,-100,2,C_Productos,et_pCant_FocusChanged,720,0,Visual Designer,foto.bal,-100,3,C_Productos,cuentaProds,735,0,C_Productos,b_prodMas_Click,636,4,kms_helperSubs,traeVentaAbordo,711,0,C_Productos,et_pCant_TextChanged,698,6
SelectedBuild=0 SelectedBuild=0
VisibleModules=1,28,11,24,3,29,14,12,9,21 VisibleModules=1,28,11,24,3,29,14,12,9

View File

@@ -715,14 +715,14 @@ End Sub
'Regresa el total de la venta de abordo en la tabla pedido. 'Regresa el total de la venta de abordo en la tabla pedido.
Sub traeVentaAbordo As Double Sub traeVentaAbordo As Double
Log("Venta abordo") ' Log("Venta abordo")
Private va As Double = 0 Private va As Double = 0
Private c As Cursor = khdb.ExecQuery("select sum(PE_COSTO_TOT) as ventaAbordo from pedido where PE_TIPO = 'ABORDO'") Private c As Cursor = khdb.ExecQuery("select sum(PE_COSTO_TOT) as ventaAbordo from pedido where PE_TIPO = 'ABORDO'")
If c.RowCount > 0 Then If c.RowCount > 0 Then
c.Position = 0 c.Position = 0
va = c.GetDouble("ventaAbordo") va = c.GetDouble("ventaAbordo")
End If End If
Log("VENTA ABORDO: " & va) ' Log("VENTA ABORDO: " & va)
Return va Return va
End Sub End Sub