Cambios Cotizaciones
This commit is contained in:
@@ -3981,7 +3981,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
Dim TipoEstatus As Integer = GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {CveEstatus}").ToEntero()
|
Dim TipoEstatus As Integer = GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {CveEstatus}").ToEntero()
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(135) = "1" AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso TipoEstatus = 5 Then
|
If UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") AndAlso DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso TipoEstatus = 5 Then
|
||||||
If UsuarioActual.TienePermisoProceso(159) Then
|
If UsuarioActual.TienePermisoProceso(159) Then
|
||||||
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
|
Dim TienePermiso As String = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, -1).FiltroPrimeroValor("CveSubProyecto", String.Format("CveSubProyecto = {0}", DbRowVenta("CveSubProyecto")))
|
||||||
If TienePermiso <> "" Then
|
If TienePermiso <> "" Then
|
||||||
@@ -4087,7 +4087,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
'SI LA AUTORIZACION ES POR SUPERVISOR, BUSCA EL SUPERVISOR QUE TIENE EL VENDEDOR
|
||||||
If UsuarioActual.Empresa.Funcionalidad(135) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(135) = "1" Then
|
||||||
'Reviso cuales son los supervisores
|
'Reviso cuales son los supervisores
|
||||||
Dim Objeto As New ClsVtaVendedores
|
Dim Objeto As New ClsVtaVendedores
|
||||||
@@ -4104,7 +4104,7 @@ Partial Class Ventas
|
|||||||
|
|
||||||
If TipoEstatus = 2 Then
|
If TipoEstatus = 2 Then
|
||||||
LkCotizacionAutorizar.Visible = False
|
LkCotizacionAutorizar.Visible = False
|
||||||
ElseIf TipoEstatus = 2 Then
|
ElseIf TipoEstatus = 5 Then
|
||||||
LkCotizacionAutorizar.Visible = False
|
LkCotizacionAutorizar.Visible = False
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -4113,8 +4113,18 @@ Partial Class Ventas
|
|||||||
Objeto.Dispose()
|
Objeto.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString())
|
'SI LA AUTORIZACION ES POR PERMISO, BUSCA QUE EL USUARIO TENGA EL PERMISO PARA AUTORIZAR
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(135) = "2" Then
|
||||||
|
'Reviso cuales son los supervisores
|
||||||
|
If UsuarioActual.TienePermisoProceso(116) Then
|
||||||
|
LkCotizacionAutorizar.Visible = True
|
||||||
|
If TipoEstatus = 2 Then
|
||||||
|
LkCotizacionAutorizar.Visible = False
|
||||||
|
ElseIf TipoEstatus = 5 Then
|
||||||
|
LkCotizacionAutorizar.Visible = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
Case "Ant"
|
Case "Ant"
|
||||||
Trsaldo.Visible = True
|
Trsaldo.Visible = True
|
||||||
@@ -4872,30 +4882,47 @@ Partial Class Ventas
|
|||||||
|
|
||||||
|
|
||||||
'Verifico si tiene la funcionalidad (135)
|
'Verifico si tiene la funcionalidad (135)
|
||||||
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135) = "1" Then
|
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then
|
||||||
'Reviso cuales son los supervisores
|
|
||||||
Dim ObjVendedores As New ClsVtaVendedores
|
|
||||||
|
|
||||||
If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then
|
Select Case UsuarioActual.Empresa.Funcionalidad(135)
|
||||||
Dim DTVendedores As New DataTable
|
Case "1" ' POR SUPERVISOR
|
||||||
If DbRowVenta("CveVendedor").ToString().ToEntero() > 0 AndAlso UsuarioActual.CveVendedor > 0 Then
|
Dim ObjVendedores As New ClsVtaVendedores
|
||||||
DTVendedores = ObjVendedores.DtResultados.FiltraParametros(String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString())).FiltraParametros(String.Format("CveSupervisor = {0}", UsuarioActual.CveVendedor))
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Verifico si es su supervisor asignado
|
If ObjVendedores.GetVendedores(UsuarioActual.CveEmpresa) Then
|
||||||
If DTVendedores.Rows.Count > 0 Then
|
Dim DTVendedores As New DataTable
|
||||||
If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then
|
If DbRowVenta("CveVendedor").ToString().ToEntero() > 0 AndAlso UsuarioActual.CveVendedor > 0 Then
|
||||||
BtnsFacturar.Visible = True
|
DTVendedores = ObjVendedores.DtResultados.FiltraParametros(String.Format("CveVendedor = {0}", DbRowVenta("CveVendedor").ToString())).FiltraParametros(String.Format("CveSupervisor = {0}", UsuarioActual.CveVendedor))
|
||||||
BtnGenerarRemision.Visible = True
|
End If
|
||||||
Else
|
|
||||||
BtnsFacturar.Visible = False
|
'Verifico si es su supervisor asignado
|
||||||
BtnGenerarRemision.Visible = False
|
If DTVendedores.Rows.Count > 0 Then
|
||||||
|
If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then
|
||||||
|
BtnsFacturar.Visible = True
|
||||||
|
BtnGenerarRemision.Visible = True
|
||||||
|
Else
|
||||||
|
BtnsFacturar.Visible = False
|
||||||
|
BtnGenerarRemision.Visible = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
DTVendedores.Dispose()
|
||||||
End If
|
End If
|
||||||
End If
|
ObjVendedores.Dispose()
|
||||||
|
|
||||||
|
Case "2" ' POR PERMISO
|
||||||
|
If UsuarioActual.TienePermisoProceso(116) Then
|
||||||
|
If GlobalDTEstatusFactura().FiltroPrimeroValor("TipoEstatus", $"CveEstatusFactura = {Me.CveEstatus}").ToEntero() = 2 Then
|
||||||
|
BtnsFacturar.Visible = True
|
||||||
|
BtnGenerarRemision.Visible = True
|
||||||
|
Else
|
||||||
|
BtnsFacturar.Visible = False
|
||||||
|
BtnGenerarRemision.Visible = False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Select
|
||||||
|
|
||||||
|
|
||||||
DTVendedores.Dispose()
|
|
||||||
End If
|
|
||||||
ObjVendedores.Dispose()
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If DdlTipoComprobante.SelectedValue = "Cot" Then
|
If DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||||
@@ -15478,7 +15505,7 @@ Partial Class Ventas
|
|||||||
TrAlmacenAsignado.Visible = False
|
TrAlmacenAsignado.Visible = False
|
||||||
TrAlmacenOrigen.Visible = False
|
TrAlmacenOrigen.Visible = False
|
||||||
|
|
||||||
If DdlTipoComprobante.SelectedValue = "Cot" And UsuarioActual.Empresa.Funcionalidad(135) = "1" Then
|
If DdlTipoComprobante.SelectedValue = "Cot" And UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then
|
||||||
Alert("Se ocupa una autorización.", TipoMensaje.MsgAdvertencia)
|
Alert("Se ocupa una autorización.", TipoMensaje.MsgAdvertencia)
|
||||||
TrDireccion.Visible = False
|
TrDireccion.Visible = False
|
||||||
TrCiudad.Visible = False
|
TrCiudad.Visible = False
|
||||||
@@ -21210,8 +21237,14 @@ Partial Class Ventas
|
|||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
|
|
||||||
If ActualizoEstatus Then
|
If ActualizoEstatus Then
|
||||||
'GeneraPDFCotizacion(True)
|
|
||||||
Alert("La cotización ha sido enviada al correo de nuestro cliente:" & Mail)
|
If UsuarioActual.Empresa.Funcionalidad(135) = "1" Then
|
||||||
|
GeneraPDFCotizacion(True)
|
||||||
|
Alert("La cotización ha sido enviada al correo de nuestro cliente:" & Mail)
|
||||||
|
ElseIf UsuarioActual.Empresa.Funcionalidad(135) = "2" Then
|
||||||
|
Alert("La cotización ha sido autorizada.")
|
||||||
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Alert("No se pudo autorizar la cotización", TipoMensaje.MsgError)
|
Alert("No se pudo autorizar la cotización", TipoMensaje.MsgError)
|
||||||
End If
|
End If
|
||||||
|
|||||||
Reference in New Issue
Block a user