ultima sin encuestas

This commit is contained in:
cvaldes1201
2024-02-01 18:27:37 -06:00
parent 766f2e0f6d
commit e6cea606e6
914 changed files with 1032 additions and 385 deletions

View File

@@ -1424,4 +1424,27 @@ Sub traeInventario(prodId As String, tipoVenta As String) As Int
Else
Return 0
End If
End Sub
'Borra los RMIs del pedido mayores que los productos del pedido y si borro RMIs regresa FALSE.
Sub revisaRMIs(clienteId As String) As Boolean 'ignore
Private validos As Boolean = True
Private cr As Cursor = Starter.skmt.ExecQuery($"select sum(pe_cant) as cuantos from pedido where pe_cedis = 'DUR' and pe_cliente = '${clienteId}'"$)
Private cp As Cursor = Starter.skmt.ExecQuery($"select sum(pe_cant) as cuantos from pedido where pe_cedis <> 'DUR' and pe_cliente = '${clienteId}'"$)
cr.Position = 0
cp.Position = 0
Log($"${cr.GetInt("cuantos")} > ${cp.GetInt("cuantos")}"$)
If cr.GetInt("cuantos") > cp.GetInt("cuantos") Then validos = False
Log(validos)
If validos = False Then
Private x As Cursor = Starter.skmt.ExecQuery($"select * from pedido where pe_cliente = '${traeCliente}' and pe_cedis = 'DUR'"$)
If x.RowCount > 0 Then
For o = 0 To x.RowCount - 1
x.Position = o
Log(x.GetString("PE_PROID"))
actualizaProducto("DUR", 0, 0, 0, x.GetString("PE_PRONOMBRE"), x.GetString("PE_PROID"), traeCliente, x.GetString("PE_FECHA"), x.GetString("PE_USUARIO"), "", 0, x.GetString("PE_TIPO"))
Next
End If
End If
Return validos
End Sub