- Se puso la misam fecha en inicio y fin de los eventos del "Motivo de no venta"

This commit is contained in:
Jose Alberto Guerra Ugalde
2024-06-27 20:26:42 -06:00
parent 2739051f7e
commit c05d8282f9
13 changed files with 229 additions and 37 deletions

View File

@@ -591,6 +591,11 @@ Sub centraPanel(elemento As Panel, anchoElementoSuperior As Int) 'ignore
elemento.Left = Round(anchoElementoSuperior/2)-(elemento.Width/2)
End Sub
'Centra un boton horizontalmente dentro de un elemento superior
Sub centraBoton(elemento As Button, anchoElementoSuperior As Int) 'ignore
elemento.Left = Round(anchoElementoSuperior/2)-(elemento.Width/2)
End Sub
'Centra un panel verticalmente dentro de un elemento superior
Sub centraPanelV(elemento As Panel, altoElementoSuperior As Int) 'ignore
elemento.Top = Round(altoElementoSuperior/2)-(elemento.Height/2)
@@ -1153,8 +1158,9 @@ End Sub
'Trae el limite de credito para el cliente especificado.
Sub traeLimiteCredito(idCliente As String) As Double
Private limite As Double = 10000000
Private c As ResultSet = khdb.ExecQuery($"select CAT_CL_BFACTURA from kmt_info where CAT_CL_CODIGO = '${idCliente}' and CAT_CL_BCREDITO = 0 "$)
Private c As ResultSet = khdb.ExecQuery($"select ifnull(CAT_CL_BFACTURA,10000000) as CAT_CL_BFACTURA from kmt_info where CAT_CL_CODIGO = '${idCliente}' and CAT_CL_BCREDITO = 0"$)
Do While c.NextRow
Log($"|${c.GetString("CAT_CL_BFACTURA")}|"$)
limite = c.GetString("CAT_CL_BFACTURA")
Loop
Log($"Limite: ${NumberFormat2(limite, 1, 0, 0, True)}"$)
@@ -1163,20 +1169,33 @@ End Sub
'Regresa el total del pedido en la tabla "PEDIDO" del cliente actual.
'Utiliza la columna PE_COSTO_TOT para hacer la suma.
Sub totalPedido As String 'ignore
Sub totalPedido As Long 'ignore
Private cT As Cursor = Starter.skmt.ExecQuery($"select sum(PE_COSTO_TOT) as total from PEDIDO where PE_CLIENTE = '${traeCliente}'"$)
Log($"select sum(PE_COSTO_TOT) as total from PEDIDO where PE_CLIENTE = '${traeCliente}'"$)
Private pTotal As String = "0"
' Log($"select sum(PE_COSTO_TOT) as total from PEDIDO where PE_CLIENTE = '${traeCliente}'"$)
Private pTotal As Long = 0
If cT.RowCount > 0 Then
cT.Position = 0
' Log("|"&cT.GetLong("total")&"|"&pTotal)
Private tempT As String = cT.GetLong("total")
If tempT <> "null" And tempT <> Null Then
' Log("|"&cT.GetLong("total")&"|")
Log("|"&cT.GetLong("total")&"|")
pTotal = tempT
End If
' Log($"Cliente actual=${traeCliente}, hayPedido=${hay}"$)
End If
cT.Close
Return pTotal
End Sub
'Revisa si esta activo el MOTIVO NO VISITA y regresa verdadero o falso
Sub motivoNoVisitaActivo As Boolean
Private rnv As Boolean = False
Private nv As Cursor = khdb.ExecQuery($"select ifnull(CAT_VA_VALOR, 0) as valor from CAT_VARIABLES where CAT_VA_DESCRIPCION = 'NOVISITA_ACTIVA'"$)
Log(nv.RowCount)
If nv.RowCount > 0 Then
nv.Position = 0
Log(nv.GetString("valor"))
If nv.GetString("valor") = "1" Then rnv = True
End If
Return rnv
End Sub