--FIX condiciones de credito
This commit is contained in:
@@ -6199,14 +6199,13 @@ Partial Class Ventas
|
||||
End Function
|
||||
|
||||
Private Sub VerificarBtnFacturarCotizacion(CveVendedor As Integer, Optional MostrarGenerarRemision As Boolean = True)
|
||||
If TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") Then
|
||||
If TmpDT.SUM("CantidadFacturadaCot") < TmpDT.SUM("Cantidad") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso TieneBloqueoPorCreditoVencimiento = 0 Then
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(199) Then
|
||||
BtnGenerarRemision.Visible = If(CveEstatus = 10, False, True)
|
||||
Else
|
||||
BtnGenerarRemision.Visible = False
|
||||
End If
|
||||
|
||||
If UsuarioActual.TienePermisoProceso(60) Then BtnsFacturar.Visible = True 'puede facturar
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso UsuarioActual.TienePermisoProceso(60) Then
|
||||
@@ -7635,7 +7634,7 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
'SI EL CLIENTE ES DISTRIBUIDOR Y TIENE FACTURAS VENCIDAS, DEBE BLOQUEAR
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion = 2 Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then
|
||||
Bloqueo = True
|
||||
End If
|
||||
|
||||
@@ -7793,7 +7792,7 @@ Partial Class Ventas
|
||||
BtnGenerarRemision.Visible = False
|
||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then
|
||||
TieneBloqueoPorCreditoVencimiento = 1
|
||||
End If
|
||||
End If
|
||||
@@ -7811,48 +7810,39 @@ Partial Class Ventas
|
||||
End If
|
||||
ObjVentas.Dispose()
|
||||
Case Else 'SI NO TIENE NINGUN TIPO DE AUTORIZACION CONFIGURADO
|
||||
'RMF. codigo temporal para pruebas
|
||||
If Alertas AndAlso UsuarioActual.CveEmpresa = 140 Then
|
||||
'VERIFICAR CANDADOS DE VENTA
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 Then
|
||||
Dim Vta As New ClsVentas
|
||||
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
|
||||
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
|
||||
Vta.Dispose()
|
||||
If Opcion > 0 Then
|
||||
LnkSolicitarCredito.Visible = True
|
||||
BtnsFacturar.Visible = False
|
||||
BtnGenerarRemision.Visible = False
|
||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then
|
||||
TieneBloqueoPorCreditoVencimiento = 1
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
RBLPago.SelectedValue = "2"
|
||||
RBLPago.Items(0).Enabled = False
|
||||
RBLPago_SelectedIndexChanged(Nothing, Nothing)
|
||||
UPCondicionesPago.Update()
|
||||
Else
|
||||
'VERIFICAR CANDADOS DE VENTA
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso CveVenta > 0 Then
|
||||
Dim Vta As New ClsVentas
|
||||
Dim Opcion As Integer = Vta.ObtenerClienteLimitesVenta(CveCliente, UsuarioActual.CveEmpresa)
|
||||
Dim OpcionMsg As String = String.Format("El Cliente se encuentra bloqueado por la siguiente razón: <br> <br> {0}", Vta.SerieVenta)
|
||||
Vta.Dispose()
|
||||
If Opcion > 0 Then
|
||||
BtnsFacturar.Visible = False
|
||||
BtnGenerarRemision.Visible = False
|
||||
Alert(OpcionMsg, TipoMensaje.MsgAdvertencia)
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
TieneBloqueoPorCreditoVencimiento = 1
|
||||
End If
|
||||
'este codigo no es temporal
|
||||
If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
LnkSolicitarCredito.Visible = True
|
||||
DdlTipoAutorizacion.SelectedValueExist("1")
|
||||
|
||||
If Not UsuarioActual.TienePermisoProceso(268) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem", "PA") Then
|
||||
BtnEmitirImprimir.Visible = False
|
||||
TieneBloqueoPorCreditoVencimiento = 1
|
||||
End If
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(558) = "1" Then
|
||||
RBLPago.SelectedValue = "2"
|
||||
RBLPago.Items(0).Enabled = False
|
||||
RBLPago_SelectedIndexChanged(Nothing, Nothing)
|
||||
UPCondicionesPago.Update()
|
||||
Else
|
||||
'este codigo no es temporal
|
||||
If Alertas Then Alert("El cliente tiene su límite de crédito agotado.", TipoMensaje.MsgAdvertencia)
|
||||
If UsuarioActual.CveEmpresa = 140 Then
|
||||
LnkSolicitarCredito.Visible = True
|
||||
DdlTipoAutorizacion.SelectedValueExist("1")
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End Select
|
||||
|
||||
@@ -7877,7 +7867,7 @@ Partial Class Ventas
|
||||
ValidaCondicionesCredito = True
|
||||
End If
|
||||
|
||||
If (ValidaRemision AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then
|
||||
If (ValidaRemision AndAlso DdlTipoComprobante.SelectedValue = "Rem") AndAlso RBLPago.SelectedValue = "1" Then
|
||||
ValidaCondicionesCredito = True
|
||||
End If
|
||||
End If
|
||||
@@ -7919,7 +7909,7 @@ Partial Class Ventas
|
||||
BtnsFacturar.Visible = False
|
||||
BtnGenerarRemision.Visible = False
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then
|
||||
TieneBloqueoPorCreditoVencimiento = 1
|
||||
End If
|
||||
End If
|
||||
@@ -7930,7 +7920,7 @@ Partial Class Ventas
|
||||
BtnsFacturar.Visible = False
|
||||
BtnGenerarRemision.Visible = False
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso ClienteEsDistribuidor AndAlso Opcion.Contiene(2, 3) Then
|
||||
TieneBloqueoPorCreditoVencimiento = 1
|
||||
End If
|
||||
End If
|
||||
@@ -18000,7 +17990,7 @@ Partial Class Ventas
|
||||
TrAlmacenOrigen.Visible = False
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" And UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then
|
||||
Alert("Se ocupa una autorización.", TipoMensaje.MsgAdvertencia)
|
||||
Alert("Se requiere una autorización.", TipoMensaje.MsgAdvertencia)
|
||||
TrDireccion.Visible = False
|
||||
TrCiudad.Visible = False
|
||||
TrRFC.Visible = False
|
||||
@@ -18395,14 +18385,14 @@ Partial Class Ventas
|
||||
If Not CveEmpresaCRM > 0 Then
|
||||
'SI ES UNA REMISION EXISTENTE, NO MOSTRAR LOS BOTONES
|
||||
If Not (CveVenta > 0 AndAlso DdlTipoComprobante.SelectedValue = "Rem") Then
|
||||
BtnCrearApartirDe.Enabled = EstatusCliente
|
||||
BtnEmitirImprimir.Visible = EstatusCliente
|
||||
BtnCrearApartirDe.Enabled = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0
|
||||
BtnEmitirImprimir.Visible = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0
|
||||
TrVistaPrevia.Visible = EstatusCliente
|
||||
End If
|
||||
Else
|
||||
If TipoDoctoConsulta.Contiene("Ing", "Egs", "Ant", "Dev") Then
|
||||
BtnCrearApartirDe.Enabled = EstatusCliente
|
||||
BtnEmitirImprimir.Visible = EstatusCliente
|
||||
BtnCrearApartirDe.Enabled = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0
|
||||
BtnEmitirImprimir.Visible = EstatusCliente AndAlso TieneBloqueoPorCreditoVencimiento = 0
|
||||
TrVistaPrevia.Visible = EstatusCliente
|
||||
Else
|
||||
BtnCrearApartirDe.Enabled = True
|
||||
|
||||
Reference in New Issue
Block a user